drivers/gpu/drm/nouveau/nouveau_dmem.c:404:25: sparse: sparse: cast removes address space '__iomem' of expression

From: kernel test robot
Date: Fri Feb 05 2021 - 15:09:53 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 61556703b610a104de324e4f061dc6cf7b218b46
commit: 71e741ad124d07b15d7f1cd481f98d69867ca0a2 drm/nouveau/svm: convert migrate_copy to new push macros
date: 7 months ago
config: x86_64-randconfig-s022-20210206 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-215-g0fb77bb6-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=71e741ad124d07b15d7f1cd481f98d69867ca0a2
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 71e741ad124d07b15d7f1cd481f98d69867ca0a2
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


"sparse warnings: (new ones prefixed by >>)"
>> drivers/gpu/drm/nouveau/nouveau_dmem.c:404:25: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/gpu/drm/nouveau/nouveau_dmem.c:404:25: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/nouveau_dmem.c:407:25: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/nouveau_dmem.c:407:25: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/nouveau_dmem.c:418:25: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/nouveau_dmem.c:418:25: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/nouveau_dmem.c:421:25: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/nouveau_dmem.c:421:25: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/nouveau_dmem.c:429:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/nouveau_dmem.c:429:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/nouveau_dmem.c:429:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/nouveau_dmem.c:429:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/nouveau_dmem.c:429:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/nouveau_dmem.c:429:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/nouveau_dmem.c:429:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/nouveau_dmem.c:429:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/nouveau_dmem.c:429:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/nouveau_dmem.c:437:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/nouveau_dmem.c:437:9: sparse: sparse: cast removes address space '__iomem' of expression

vim +/__iomem +404 drivers/gpu/drm/nouveau/nouveau_dmem.c

383
384 static int
385 nvc0b5_migrate_copy(struct nouveau_drm *drm, u64 npages,
386 enum nouveau_aper dst_aper, u64 dst_addr,
387 enum nouveau_aper src_aper, u64 src_addr)
388 {
389 struct nvif_push *push = drm->dmem->migrate.chan->chan.push;
390 u32 launch_dma = (1 << 9) /* MULTI_LINE_ENABLE. */ |
391 (1 << 8) /* DST_MEMORY_LAYOUT_PITCH. */ |
392 (1 << 7) /* SRC_MEMORY_LAYOUT_PITCH. */ |
393 (1 << 2) /* FLUSH_ENABLE_TRUE. */ |
394 (2 << 0) /* DATA_TRANSFER_TYPE_NON_PIPELINED. */;
395 int ret;
396
397 ret = PUSH_WAIT(push, 13);
398 if (ret)
399 return ret;
400
401 if (src_aper != NOUVEAU_APER_VIRT) {
402 switch (src_aper) {
403 case NOUVEAU_APER_VRAM:
> 404 PUSH_NVIM(push, NVA0B5, 0x0260, 0);
405 break;
406 case NOUVEAU_APER_HOST:
407 PUSH_NVIM(push, NVA0B5, 0x0260, 1);
408 break;
409 default:
410 return -EINVAL;
411 }
412 launch_dma |= 0x00001000; /* SRC_TYPE_PHYSICAL. */
413 }
414
415 if (dst_aper != NOUVEAU_APER_VIRT) {
416 switch (dst_aper) {
417 case NOUVEAU_APER_VRAM:
418 PUSH_NVIM(push, NVA0B5, 0x0264, 0);
419 break;
420 case NOUVEAU_APER_HOST:
421 PUSH_NVIM(push, NVA0B5, 0x0264, 1);
422 break;
423 default:
424 return -EINVAL;
425 }
426 launch_dma |= 0x00002000; /* DST_TYPE_PHYSICAL. */
427 }
428
429 PUSH_NVSQ(push, NVA0B5, 0x0400, upper_32_bits(src_addr),
430 0x0404, lower_32_bits(src_addr),
431 0x0408, upper_32_bits(dst_addr),
432 0x040c, lower_32_bits(dst_addr),
433 0x0410, PAGE_SIZE,
434 0x0414, PAGE_SIZE,
435 0x0418, PAGE_SIZE,
436 0x041c, npages);
437 PUSH_NVSQ(push, NVA0B5, 0x0300, launch_dma);
438 return 0;
439 }
440

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip