Skip to contentSkip to conversation

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c:95:20: sparse: sparse: incompatible types in comparison expression (different address spaces):

DISCUSSION kernel test robot 1 participant 1 message Jul 9

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw

Hi Harry,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0e35b9b6ec0ffcc5e23cbdec09f5c622ad532b53
commit: af3f2f5db2659a13c256d2fb096c473eb50412ef drm/amdgpu: Remove UML build exclusion from Kconfig
date:   7 weeks ago
config: um-randconfig-r122-20260709 (https://download.01.org/0day-ci/archive/20260709/[email protected]/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260709/[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

| Fixes: af3f2f5db265 ("drm/amdgpu: Remove UML build exclusion from Kconfig")
| 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/amdgpu_amdkfd_fence.c:95:20: sparse: sparse: incompatible types in comparison expression (different address spaces):

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c:95:20: sparse: struct dma_fence_ops const [noderef] __rcu *
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c:95:20: sparse: struct dma_fence_ops const *
--
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c: note: in included file (through drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h, drivers/gpu/drm/amd/amdgpu/amdgpu.h, drivers/gpu/drm/amd/amdgpu/amdgpu_object.h):
drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:519:49: sparse: sparse: static assertion failed: "amd_sriov_msg_vf2pf_info must be 1 KB"

>> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c:3097:17: sparse: sparse: incompatible types in comparison expression (different address spaces):

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c:3097:17: sparse: struct dma_fence [noderef] __rcu *
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c:3097:17: sparse: struct dma_fence *

vim +95 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c

d8d019ccffb838b Felix Kuehling       2018-02-06   86  
d8d019ccffb838b Felix Kuehling       2018-02-06   87  struct amdgpu_amdkfd_fence *to_amdgpu_amdkfd_fence(struct dma_fence *f)
d8d019ccffb838b Felix Kuehling       2018-02-06   88  {
d8d019ccffb838b Felix Kuehling       2018-02-06   89  	struct amdgpu_amdkfd_fence *fence;
d8d019ccffb838b Felix Kuehling       2018-02-06   90  
d8d019ccffb838b Felix Kuehling       2018-02-06   91  	if (!f)
d8d019ccffb838b Felix Kuehling       2018-02-06   92  		return NULL;
d8d019ccffb838b Felix Kuehling       2018-02-06   93  
d8d019ccffb838b Felix Kuehling       2018-02-06   94  	fence = container_of(f, struct amdgpu_amdkfd_fence, base);
bf2ad4fb8adca89 Srinivasan Shanmugam 2023-12-27  @95  	if (f->ops == &amdkfd_fence_ops)
d8d019ccffb838b Felix Kuehling       2018-02-06   96  		return fence;
d8d019ccffb838b Felix Kuehling       2018-02-06   97  
d8d019ccffb838b Felix Kuehling       2018-02-06   98  	return NULL;
d8d019ccffb838b Felix Kuehling       2018-02-06   99  }
d8d019ccffb838b Felix Kuehling       2018-02-06  100  

:::::: The code at line 95 was first introduced by commit
:::::: bf2ad4fb8adca89374b54b225d494e0b1956dbea drm/amdgpu: Drop 'fence' check in 'to_amdgpu_amdkfd_fence()'

:::::: TO: Srinivasan Shanmugam <[email protected]> :::::: CC: Alex Deucher <[email protected]>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki