drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:3042:73: sparse: sparse: incorrect type in argument 2 (different address spaces)
kernel test robot
build bottree: https://gitlab.freedesktop.org/drm/amdgpu/kernel drm-amdgpu-next head: a69db917063c539fa09325ea22f3ff7b0626b478 commit: bffef1cc5b3d97e503c87f51759a31249d4a3d1e [242/243] drm/amdgpu: Add gfx v13 ip block config: um-randconfig-r2306-20261126 (https://download.01.org/0day-ci/archive/20261126/[email protected]/config) compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff) rustc: rustc 1.96.0 (ac68faa20 2026-05-25) sparse: v0.6.5-rc1-21-g84ec0658 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261126/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
sparse warnings: (new ones prefixed by >>)
drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c: note: in included file:
drivers/gpu/drm/amd/amdgpu/clearstate_gfx13.h:113:7: sparse: sparse: Using plain integer as NULL pointer drivers/gpu/drm/amd/amdgpu/clearstate_gfx13.h:118:7: sparse: sparse: Using plain integer as NULL pointer
drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:506:28: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] @@ got restricted __le32 [usertype] @@
drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:506:28: sparse: expected unsigned int [usertype]
drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:506:28: sparse: got restricted __le32 [usertype]
drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:540:13: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:573:36: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:574:41: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:575:36: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:577:25: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:621:33: sparse: sparse: cast to restricted __le16 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:622:33: sparse: sparse: cast to restricted __le16
drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:708:57: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] @@ got restricted __le32 [usertype] @@
drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:708:57: sparse: expected unsigned int [usertype]
drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:708:57: sparse: got restricted __le32 [usertype]
drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1172:17: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1173:19: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1178:17: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1179:19: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1189:17: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1190:19: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1195:17: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1196:19: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1206:17: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1207:19: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1212:17: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1213:19: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1227:25: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1228:19: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1232:25: sparse: sparse: cast to restricted __le16 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1233:25: sparse: sparse: cast to restricted __le16 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1239:41: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1240:35: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1245:41: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1246:35: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1254:41: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1255:35: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1260:41: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1261:35: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1278:25: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1279:19: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1306:33: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1307:27: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1312:33: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:1313:27: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:2014:28: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:2015:19: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:2036:25: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:2037:19: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:2050:25: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:2051:19: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:2080:25: sparse: sparse: cast to restricted __le16 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:2423:17: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:2424:25: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:2427:17: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:2428:24: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:2564:17: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:2565:25: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:2568:17: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:2569:24: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:2795:33: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:2796:25: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:2799:33: sparse: sparse: cast to restricted __le32 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:2800:24: sparse: sparse: cast to restricted __le32
>> drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:3042:73: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got struct v13_gfx_mqd *mqd @@ drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:3042:73: sparse: expected void const volatile [noderef] __iomem *addr drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:3042:73: sparse: got struct v13_gfx_mqd *mqd >> drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:3046:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got struct v13_gfx_mqd *mqd @@ drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:3046:37: sparse: expected void volatile [noderef] __iomem *addr drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:3046:37: sparse: got struct v13_gfx_mqd *mqd >> drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:3380:74: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got struct v13_compute_mqd *mqd @@ drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:3380:74: sparse: expected void const volatile [noderef] __iomem *addr drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:3380:74: sparse: got struct v13_compute_mqd *mqd >> drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:3384:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got struct v13_compute_mqd *mqd @@
drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:3384:37: sparse: expected void volatile [noderef] __iomem *addr
drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:3384:37: sparse: got struct v13_compute_mqd *mqd
drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c:4628:21: sparse: sparse: cast to restricted __le32
vim +3042 drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c
3027
3028 static int gfx_v13_0_kgq_init_queue(struct amdgpu_ring *ring, bool reset)
3029 {
3030 struct amdgpu_device *adev = ring->adev;
3031 struct v13_gfx_mqd *mqd = ring->mqd_ptr;
3032 int mqd_idx = ring - &adev->gfx.gfx_ring[0];
3033
3034 if (!reset && !amdgpu_in_reset(adev) && !adev->in_suspend) {
3035 memset((void *)mqd, 0, sizeof(*mqd));
3036 mutex_lock(&adev->srbm_mutex);
3037 soc_v2_0_grbm_select(adev, ring->me, ring->pipe, ring->queue, 0);
3038 amdgpu_ring_init_mqd(ring);
3039 soc_v2_0_grbm_select(adev, 0, 0, 0, 0);
3040 mutex_unlock(&adev->srbm_mutex);
3041 if (adev->gfx.me.mqd_backup[mqd_idx])
> 3042 memcpy_fromio(adev->gfx.me.mqd_backup[mqd_idx], mqd, sizeof(*mqd));
3043 } else {
3044 /* restore mqd with the backup copy */
3045 if (adev->gfx.me.mqd_backup[mqd_idx])
> 3046 memcpy_toio(mqd, adev->gfx.me.mqd_backup[mqd_idx], sizeof(*mqd)); 3047 /* reset the ring */
3048 ring->wptr = 0;
3049 *(u64 *)ring->wptr_cpu_addr = 0;
3050 amdgpu_ring_clear_ring(ring);
3051 }
3052
3053 return 0;
3054 }
3055
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki