[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202211090348.wzvaHU8A-lkp@intel.com>
Date: Wed, 9 Nov 2022 03:38:44 +0800
From: kernel test robot <lkp@...el.com>
To: Kefeng Wang <wangkefeng.wang@...wei.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
Will Deacon <will@...nel.org>, Christoph Hellwig <hch@....de>,
Arnd Bergmann <arnd@...db.de>,
"Russell King (Oracle)" <rmk+kernel@...linux.org.uk>
Subject: drivers/gpu/drm/qxl/qxl_kms.c:275:21: sparse: sparse: incorrect type
in argument 1 (different address spaces)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 59f2f4b8a757412fce372f6d0767bdb55da127a8
commit: d803336abdbc1bfacdb32b2cf9f4fdbee072b8ee ARM: mm: kill unused runtime hook arch_iounmap()
date: 4 months ago
config: arm-randconfig-s032-20221108
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d803336abdbc1bfacdb32b2cf9f4fdbee072b8ee
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout d803336abdbc1bfacdb32b2cf9f4fdbee072b8ee
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm SHELL=/bin/bash drivers/gpu/drm/qxl/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
sparse warnings: (new ones prefixed by >>)
drivers/gpu/drm/qxl/qxl_kms.c:168:19: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct qxl_rom *rom @@ got void [noderef] __iomem * @@
drivers/gpu/drm/qxl/qxl_kms.c:168:19: sparse: expected struct qxl_rom *rom
drivers/gpu/drm/qxl/qxl_kms.c:168:19: sparse: got void [noderef] __iomem *
drivers/gpu/drm/qxl/qxl_kms.c:186:26: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct qxl_ram_header *ram_header @@ got void [noderef] __iomem * @@
drivers/gpu/drm/qxl/qxl_kms.c:186:26: sparse: expected struct qxl_ram_header *ram_header
drivers/gpu/drm/qxl/qxl_kms.c:186:26: sparse: got void [noderef] __iomem *
>> drivers/gpu/drm/qxl/qxl_kms.c:275:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *io_addr @@ got struct qxl_ram_header *ram_header @@
drivers/gpu/drm/qxl/qxl_kms.c:275:21: sparse: expected void volatile [noderef] __iomem *io_addr
drivers/gpu/drm/qxl/qxl_kms.c:275:21: sparse: got struct qxl_ram_header *ram_header
>> drivers/gpu/drm/qxl/qxl_kms.c:279:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *io_addr @@ got struct qxl_rom *rom @@
drivers/gpu/drm/qxl/qxl_kms.c:279:21: sparse: expected void volatile [noderef] __iomem *io_addr
drivers/gpu/drm/qxl/qxl_kms.c:279:21: sparse: got struct qxl_rom *rom
drivers/gpu/drm/qxl/qxl_kms.c:323:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *io_addr @@ got struct qxl_ram_header *ram_header @@
drivers/gpu/drm/qxl/qxl_kms.c:323:21: sparse: expected void volatile [noderef] __iomem *io_addr
drivers/gpu/drm/qxl/qxl_kms.c:323:21: sparse: got struct qxl_ram_header *ram_header
drivers/gpu/drm/qxl/qxl_kms.c:324:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *io_addr @@ got struct qxl_rom *rom @@
drivers/gpu/drm/qxl/qxl_kms.c:324:21: sparse: expected void volatile [noderef] __iomem *io_addr
drivers/gpu/drm/qxl/qxl_kms.c:324:21: sparse: got struct qxl_rom *rom
vim +275 drivers/gpu/drm/qxl/qxl_kms.c
f64122c1f6ade3 Dave Airlie 2013-02-25 108
2b65d5677a797f Gabriel Krisman Bertazi 2017-01-19 109 int qxl_device_init(struct qxl_device *qdev,
aa5b62bac05d4b Gabriel Krisman Bertazi 2017-02-27 110 struct pci_dev *pdev)
f64122c1f6ade3 Dave Airlie 2013-02-25 111 {
35541782dcc1e5 Gerd Hoffmann 2013-10-11 112 int r, sb;
f64122c1f6ade3 Dave Airlie 2013-02-25 113
cbdded7f8a633e Gabriel Krisman Bertazi 2017-01-26 114 pci_set_drvdata(pdev, &qdev->ddev);
cbdded7f8a633e Gabriel Krisman Bertazi 2017-01-26 115
f64122c1f6ade3 Dave Airlie 2013-02-25 116 mutex_init(&qdev->gem.mutex);
f64122c1f6ade3 Dave Airlie 2013-02-25 117 mutex_init(&qdev->update_area_mutex);
f64122c1f6ade3 Dave Airlie 2013-02-25 118 mutex_init(&qdev->release_mutex);
f64122c1f6ade3 Dave Airlie 2013-02-25 119 mutex_init(&qdev->surf_evict_mutex);
b3740e88601d69 Christophe Fergeau 2016-11-08 120 qxl_gem_init(qdev);
f64122c1f6ade3 Dave Airlie 2013-02-25 121
f64122c1f6ade3 Dave Airlie 2013-02-25 122 qdev->rom_base = pci_resource_start(pdev, 2);
f64122c1f6ade3 Dave Airlie 2013-02-25 123 qdev->rom_size = pci_resource_len(pdev, 2);
f64122c1f6ade3 Dave Airlie 2013-02-25 124 qdev->vram_base = pci_resource_start(pdev, 0);
f64122c1f6ade3 Dave Airlie 2013-02-25 125 qdev->io_base = pci_resource_start(pdev, 3);
f64122c1f6ade3 Dave Airlie 2013-02-25 126
f64122c1f6ade3 Dave Airlie 2013-02-25 127 qdev->vram_mapping = io_mapping_create_wc(qdev->vram_base, pci_resource_len(pdev, 0));
5043348a4969ae Anton Vasilyev 2018-07-27 128 if (!qdev->vram_mapping) {
5043348a4969ae Anton Vasilyev 2018-07-27 129 pr_err("Unable to create vram_mapping");
a9b0b24a6fff2d Daniel Vetter 2020-04-15 130 return -ENOMEM;
5043348a4969ae Anton Vasilyev 2018-07-27 131 }
35541782dcc1e5 Gerd Hoffmann 2013-10-11 132
35541782dcc1e5 Gerd Hoffmann 2013-10-11 133 if (pci_resource_len(pdev, 4) > 0) {
35541782dcc1e5 Gerd Hoffmann 2013-10-11 134 /* 64bit surface bar present */
35541782dcc1e5 Gerd Hoffmann 2013-10-11 135 sb = 4;
35541782dcc1e5 Gerd Hoffmann 2013-10-11 136 qdev->surfaceram_base = pci_resource_start(pdev, sb);
35541782dcc1e5 Gerd Hoffmann 2013-10-11 137 qdev->surfaceram_size = pci_resource_len(pdev, sb);
35541782dcc1e5 Gerd Hoffmann 2013-10-11 138 qdev->surface_mapping =
35541782dcc1e5 Gerd Hoffmann 2013-10-11 139 io_mapping_create_wc(qdev->surfaceram_base,
35541782dcc1e5 Gerd Hoffmann 2013-10-11 140 qdev->surfaceram_size);
35541782dcc1e5 Gerd Hoffmann 2013-10-11 141 }
35541782dcc1e5 Gerd Hoffmann 2013-10-11 142 if (qdev->surface_mapping == NULL) {
35541782dcc1e5 Gerd Hoffmann 2013-10-11 143 /* 64bit surface bar not present (or mapping failed) */
35541782dcc1e5 Gerd Hoffmann 2013-10-11 144 sb = 1;
35541782dcc1e5 Gerd Hoffmann 2013-10-11 145 qdev->surfaceram_base = pci_resource_start(pdev, sb);
35541782dcc1e5 Gerd Hoffmann 2013-10-11 146 qdev->surfaceram_size = pci_resource_len(pdev, sb);
35541782dcc1e5 Gerd Hoffmann 2013-10-11 147 qdev->surface_mapping =
35541782dcc1e5 Gerd Hoffmann 2013-10-11 148 io_mapping_create_wc(qdev->surfaceram_base,
35541782dcc1e5 Gerd Hoffmann 2013-10-11 149 qdev->surfaceram_size);
5043348a4969ae Anton Vasilyev 2018-07-27 150 if (!qdev->surface_mapping) {
5043348a4969ae Anton Vasilyev 2018-07-27 151 pr_err("Unable to create surface_mapping");
5043348a4969ae Anton Vasilyev 2018-07-27 152 r = -ENOMEM;
5043348a4969ae Anton Vasilyev 2018-07-27 153 goto vram_mapping_free;
5043348a4969ae Anton Vasilyev 2018-07-27 154 }
35541782dcc1e5 Gerd Hoffmann 2013-10-11 155 }
35541782dcc1e5 Gerd Hoffmann 2013-10-11 156
35541782dcc1e5 Gerd Hoffmann 2013-10-11 157 DRM_DEBUG_KMS("qxl: vram %llx-%llx(%dM %dk), surface %llx-%llx(%dM %dk, %s)\n",
970fa986fadb11 Dave Airlie 2013-05-31 158 (unsigned long long)qdev->vram_base,
970fa986fadb11 Dave Airlie 2013-05-31 159 (unsigned long long)pci_resource_end(pdev, 0),
f64122c1f6ade3 Dave Airlie 2013-02-25 160 (int)pci_resource_len(pdev, 0) / 1024 / 1024,
f64122c1f6ade3 Dave Airlie 2013-02-25 161 (int)pci_resource_len(pdev, 0) / 1024,
970fa986fadb11 Dave Airlie 2013-05-31 162 (unsigned long long)qdev->surfaceram_base,
35541782dcc1e5 Gerd Hoffmann 2013-10-11 163 (unsigned long long)pci_resource_end(pdev, sb),
f64122c1f6ade3 Dave Airlie 2013-02-25 164 (int)qdev->surfaceram_size / 1024 / 1024,
35541782dcc1e5 Gerd Hoffmann 2013-10-11 165 (int)qdev->surfaceram_size / 1024,
35541782dcc1e5 Gerd Hoffmann 2013-10-11 166 (sb == 4) ? "64bit" : "32bit");
f64122c1f6ade3 Dave Airlie 2013-02-25 167
59ab4ee012f016 Cong Liu 2022-03-24 168 qdev->rom = ioremap_wc(qdev->rom_base, qdev->rom_size);
f64122c1f6ade3 Dave Airlie 2013-02-25 169 if (!qdev->rom) {
f64122c1f6ade3 Dave Airlie 2013-02-25 170 pr_err("Unable to ioremap ROM\n");
5043348a4969ae Anton Vasilyev 2018-07-27 171 r = -ENOMEM;
5043348a4969ae Anton Vasilyev 2018-07-27 172 goto surface_mapping_free;
f64122c1f6ade3 Dave Airlie 2013-02-25 173 }
f64122c1f6ade3 Dave Airlie 2013-02-25 174
5043348a4969ae Anton Vasilyev 2018-07-27 175 if (!qxl_check_device(qdev)) {
5043348a4969ae Anton Vasilyev 2018-07-27 176 r = -ENODEV;
dbe3ad61dcebc4 Markus Elfring 2019-11-07 177 goto rom_unmap;
5043348a4969ae Anton Vasilyev 2018-07-27 178 }
f64122c1f6ade3 Dave Airlie 2013-02-25 179
f64122c1f6ade3 Dave Airlie 2013-02-25 180 r = qxl_bo_init(qdev);
f64122c1f6ade3 Dave Airlie 2013-02-25 181 if (r) {
f64122c1f6ade3 Dave Airlie 2013-02-25 182 DRM_ERROR("bo init failed %d\n", r);
5043348a4969ae Anton Vasilyev 2018-07-27 183 goto rom_unmap;
f64122c1f6ade3 Dave Airlie 2013-02-25 184 }
f64122c1f6ade3 Dave Airlie 2013-02-25 185
59ab4ee012f016 Cong Liu 2022-03-24 186 qdev->ram_header = ioremap_wc(qdev->vram_base +
f64122c1f6ade3 Dave Airlie 2013-02-25 187 qdev->rom->ram_header_offset,
f64122c1f6ade3 Dave Airlie 2013-02-25 188 sizeof(*qdev->ram_header));
5043348a4969ae Anton Vasilyev 2018-07-27 189 if (!qdev->ram_header) {
5043348a4969ae Anton Vasilyev 2018-07-27 190 DRM_ERROR("Unable to ioremap RAM header\n");
5043348a4969ae Anton Vasilyev 2018-07-27 191 r = -ENOMEM;
5043348a4969ae Anton Vasilyev 2018-07-27 192 goto bo_fini;
5043348a4969ae Anton Vasilyev 2018-07-27 193 }
f64122c1f6ade3 Dave Airlie 2013-02-25 194
f64122c1f6ade3 Dave Airlie 2013-02-25 195 qdev->command_ring = qxl_ring_create(&(qdev->ram_header->cmd_ring_hdr),
f64122c1f6ade3 Dave Airlie 2013-02-25 196 sizeof(struct qxl_command),
f64122c1f6ade3 Dave Airlie 2013-02-25 197 QXL_COMMAND_RING_SIZE,
f64122c1f6ade3 Dave Airlie 2013-02-25 198 qdev->io_base + QXL_IO_NOTIFY_CMD,
f64122c1f6ade3 Dave Airlie 2013-02-25 199 false,
f64122c1f6ade3 Dave Airlie 2013-02-25 200 &qdev->display_event);
5043348a4969ae Anton Vasilyev 2018-07-27 201 if (!qdev->command_ring) {
5043348a4969ae Anton Vasilyev 2018-07-27 202 DRM_ERROR("Unable to create command ring\n");
5043348a4969ae Anton Vasilyev 2018-07-27 203 r = -ENOMEM;
5043348a4969ae Anton Vasilyev 2018-07-27 204 goto ram_header_unmap;
5043348a4969ae Anton Vasilyev 2018-07-27 205 }
f64122c1f6ade3 Dave Airlie 2013-02-25 206
f64122c1f6ade3 Dave Airlie 2013-02-25 207 qdev->cursor_ring = qxl_ring_create(
f64122c1f6ade3 Dave Airlie 2013-02-25 208 &(qdev->ram_header->cursor_ring_hdr),
f64122c1f6ade3 Dave Airlie 2013-02-25 209 sizeof(struct qxl_command),
f64122c1f6ade3 Dave Airlie 2013-02-25 210 QXL_CURSOR_RING_SIZE,
80e5f89da3ab94 Huacai Chen 2020-03-31 211 qdev->io_base + QXL_IO_NOTIFY_CURSOR,
f64122c1f6ade3 Dave Airlie 2013-02-25 212 false,
f64122c1f6ade3 Dave Airlie 2013-02-25 213 &qdev->cursor_event);
f64122c1f6ade3 Dave Airlie 2013-02-25 214
5043348a4969ae Anton Vasilyev 2018-07-27 215 if (!qdev->cursor_ring) {
5043348a4969ae Anton Vasilyev 2018-07-27 216 DRM_ERROR("Unable to create cursor ring\n");
5043348a4969ae Anton Vasilyev 2018-07-27 217 r = -ENOMEM;
5043348a4969ae Anton Vasilyev 2018-07-27 218 goto command_ring_free;
5043348a4969ae Anton Vasilyev 2018-07-27 219 }
5043348a4969ae Anton Vasilyev 2018-07-27 220
f64122c1f6ade3 Dave Airlie 2013-02-25 221 qdev->release_ring = qxl_ring_create(
f64122c1f6ade3 Dave Airlie 2013-02-25 222 &(qdev->ram_header->release_ring_hdr),
f64122c1f6ade3 Dave Airlie 2013-02-25 223 sizeof(uint64_t),
f64122c1f6ade3 Dave Airlie 2013-02-25 224 QXL_RELEASE_RING_SIZE, 0, true,
f64122c1f6ade3 Dave Airlie 2013-02-25 225 NULL);
f64122c1f6ade3 Dave Airlie 2013-02-25 226
5043348a4969ae Anton Vasilyev 2018-07-27 227 if (!qdev->release_ring) {
5043348a4969ae Anton Vasilyev 2018-07-27 228 DRM_ERROR("Unable to create release ring\n");
5043348a4969ae Anton Vasilyev 2018-07-27 229 r = -ENOMEM;
5043348a4969ae Anton Vasilyev 2018-07-27 230 goto cursor_ring_free;
5043348a4969ae Anton Vasilyev 2018-07-27 231 }
f64122c1f6ade3 Dave Airlie 2013-02-25 232
5d4c1edf0ddcf8 Deepak R Varma 2020-11-06 233 idr_init_base(&qdev->release_idr, 1);
f64122c1f6ade3 Dave Airlie 2013-02-25 234 spin_lock_init(&qdev->release_idr_lock);
2f453ed4038526 Maarten Lankhorst 2014-04-02 235 spin_lock_init(&qdev->release_lock);
f64122c1f6ade3 Dave Airlie 2013-02-25 236
5d4c1edf0ddcf8 Deepak R Varma 2020-11-06 237 idr_init_base(&qdev->surf_id_idr, 1);
f64122c1f6ade3 Dave Airlie 2013-02-25 238 spin_lock_init(&qdev->surf_id_idr_lock);
f64122c1f6ade3 Dave Airlie 2013-02-25 239
f64122c1f6ade3 Dave Airlie 2013-02-25 240 mutex_init(&qdev->async_io_mutex);
f64122c1f6ade3 Dave Airlie 2013-02-25 241
f64122c1f6ade3 Dave Airlie 2013-02-25 242 /* reset the device into a known state - no memslots, no primary
f64122c1f6ade3 Dave Airlie 2013-02-25 243 * created, no surfaces. */
f64122c1f6ade3 Dave Airlie 2013-02-25 244 qxl_io_reset(qdev);
f64122c1f6ade3 Dave Airlie 2013-02-25 245
f64122c1f6ade3 Dave Airlie 2013-02-25 246 /* must initialize irq before first async io - slot creation */
f64122c1f6ade3 Dave Airlie 2013-02-25 247 r = qxl_irq_init(qdev);
5043348a4969ae Anton Vasilyev 2018-07-27 248 if (r) {
5043348a4969ae Anton Vasilyev 2018-07-27 249 DRM_ERROR("Unable to init qxl irq\n");
2ec6bd67b76ea0 Gerd Hoffmann 2019-01-18 250 goto release_ring_free;
5043348a4969ae Anton Vasilyev 2018-07-27 251 }
f64122c1f6ade3 Dave Airlie 2013-02-25 252
f64122c1f6ade3 Dave Airlie 2013-02-25 253 /*
f64122c1f6ade3 Dave Airlie 2013-02-25 254 * Note that virtual is surface0. We rely on the single ioremap done
f64122c1f6ade3 Dave Airlie 2013-02-25 255 * before.
f64122c1f6ade3 Dave Airlie 2013-02-25 256 */
2ec6bd67b76ea0 Gerd Hoffmann 2019-01-18 257 setup_slot(qdev, &qdev->main_slot, 0, "main",
f64122c1f6ade3 Dave Airlie 2013-02-25 258 (unsigned long)qdev->vram_base,
2ec6bd67b76ea0 Gerd Hoffmann 2019-01-18 259 (unsigned long)qdev->rom->ram_header_offset);
2ec6bd67b76ea0 Gerd Hoffmann 2019-01-18 260 setup_slot(qdev, &qdev->surfaces_slot, 1, "surfaces",
d9bbf1895f354c Gerd Hoffmann 2013-10-11 261 (unsigned long)qdev->surfaceram_base,
d9bbf1895f354c Gerd Hoffmann 2013-10-11 262 (unsigned long)qdev->surfaceram_size);
f64122c1f6ade3 Dave Airlie 2013-02-25 263
f64122c1f6ade3 Dave Airlie 2013-02-25 264 INIT_WORK(&qdev->gc_work, qxl_gc_work);
f64122c1f6ade3 Dave Airlie 2013-02-25 265
f64122c1f6ade3 Dave Airlie 2013-02-25 266 return 0;
5043348a4969ae Anton Vasilyev 2018-07-27 267
5043348a4969ae Anton Vasilyev 2018-07-27 268 release_ring_free:
5043348a4969ae Anton Vasilyev 2018-07-27 269 qxl_ring_free(qdev->release_ring);
5043348a4969ae Anton Vasilyev 2018-07-27 270 cursor_ring_free:
5043348a4969ae Anton Vasilyev 2018-07-27 271 qxl_ring_free(qdev->cursor_ring);
5043348a4969ae Anton Vasilyev 2018-07-27 272 command_ring_free:
5043348a4969ae Anton Vasilyev 2018-07-27 273 qxl_ring_free(qdev->command_ring);
5043348a4969ae Anton Vasilyev 2018-07-27 274 ram_header_unmap:
5043348a4969ae Anton Vasilyev 2018-07-27 @275 iounmap(qdev->ram_header);
5043348a4969ae Anton Vasilyev 2018-07-27 276 bo_fini:
5043348a4969ae Anton Vasilyev 2018-07-27 277 qxl_bo_fini(qdev);
5043348a4969ae Anton Vasilyev 2018-07-27 278 rom_unmap:
5043348a4969ae Anton Vasilyev 2018-07-27 @279 iounmap(qdev->rom);
5043348a4969ae Anton Vasilyev 2018-07-27 280 surface_mapping_free:
5043348a4969ae Anton Vasilyev 2018-07-27 281 io_mapping_free(qdev->surface_mapping);
5043348a4969ae Anton Vasilyev 2018-07-27 282 vram_mapping_free:
5043348a4969ae Anton Vasilyev 2018-07-27 283 io_mapping_free(qdev->vram_mapping);
5043348a4969ae Anton Vasilyev 2018-07-27 284 return r;
f64122c1f6ade3 Dave Airlie 2013-02-25 285 }
f64122c1f6ade3 Dave Airlie 2013-02-25 286
:::::: The code at line 275 was first introduced by commit
:::::: 5043348a4969ae1661c008efe929abd0d76e3792 drm: qxl: Fix error handling at qxl_device_init
:::::: TO: Anton Vasilyev <vasilyev@...ras.ru>
:::::: CC: Gerd Hoffmann <kraxel@...hat.com>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (207851 bytes)
Powered by blists - more mailing lists