[agd5f:ualink 124/183] drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:2669:22: warning: cast from pointer to integer of different size

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
tree:   https://gitlab.freedesktop.org/agd5f/linux.git ualink
head:   67bd1d6d1b25ea1f893a76fffd13dd6335d297d0
commit: 53459fed72b6d01843bb228453ddd905efc32038 [124/183] drm/amdgpu: Add UALink firmware writeback address configuration
config: csky-allmodconfig (https://download.01.org/0day-ci/archive/20260823/[email protected]/config)
compiler: csky-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260823/[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]/

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c: In function 'amdgpu_ualink_gart_map':
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:2073:26: error: assignment to 'dma_addr_t *' {aka 'unsigned int *'} from incompatible pointer type 'u64 *' {aka 'long long unsigned int *'} [-Wincompatible-pointer-types]
    2073 |                 dma_addr = &npa;
         |                          ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c: In function 'amdgpu_ualink_get_wb_addr':
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:2669:22: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    2669 |                 wb = (u64)remote->rb_cpu_addr + rb_size * remote->num_accel;
         |                      ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:2673:22: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    2673 |                 wb = (u64)remote->rptr_cpu_addr;
         |                      ^
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:2683:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    2683 |         *wb_cpu = (struct amdgpu_ualink_wb *)(wb + offset);
         |                   ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c: At top level:
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:2691:12: warning: 'amdgpu_ualink_update_wb_address' defined but not used [-Wunused-function]
    2691 | static int amdgpu_ualink_update_wb_address(struct amdgpu_device *adev,
         |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:2443:13: warning: 'amdgpu_ualink_emit_interrupt' defined but not used [-Wunused-function]
    2443 | static void amdgpu_ualink_emit_interrupt(u32 **cpu_addr_p, u32 wb_data,
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:2404:13: warning: 'amdgpu_ualink_emit_shootdown' defined but not used [-Wunused-function]
    2404 | static void amdgpu_ualink_emit_shootdown(u32 **cpu_addr_p, u32 wb_data,
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:2144:12: warning: 'amdgpu_ualink_metadata_init' defined but not used [-Wunused-function]
    2144 | static int amdgpu_ualink_metadata_init(struct amdgpu_device *adev)
         |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:2099:13: warning: 'amdgpu_ualink_gart_unmap' defined but not used [-Wunused-function]
    2099 | static void amdgpu_ualink_gart_unmap(struct amdgpu_device *adev, u64 npages,
         |             ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:2052:12: warning: 'amdgpu_ualink_gart_map' defined but not used [-Wunused-function]
    2052 | static int amdgpu_ualink_gart_map(struct amdgpu_device *adev, u64 npages,
         |            ^~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:2029:13: warning: 'amdgpu_ualink_sdma_entities_fini' defined but not used [-Wunused-function]
    2029 | static void amdgpu_ualink_sdma_entities_fini(struct amdgpu_device *adev)
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:1996:12: warning: 'amdgpu_ualink_sdma_entities_init' defined but not used [-Wunused-function]
    1996 | static int amdgpu_ualink_sdma_entities_init(struct amdgpu_device *adev)
         |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:1840:12: warning: 'amdgpu_ualink_metadata_npa_mapping' defined but not used [-Wunused-function]
    1840 | static int amdgpu_ualink_metadata_npa_mapping(struct amdgpu_device *adev)
         |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:1718:13: warning: 'amdgpu_ualink_metadata_npa_unmapping' defined but not used [-Wunused-function]
    1718 | static void amdgpu_ualink_metadata_npa_unmapping(struct amdgpu_device *adev)
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:1631:12: warning: 'amdgpu_ualink_gart_npa_addr' defined but not used [-Wunused-function]
    1631 | static u64 amdgpu_ualink_gart_npa_addr(struct amdgpu_device *adev, u32 type,
         |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +2669 drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c

  2656	
  2657	static void amdgpu_ualink_get_wb_addr(struct amdgpu_device *adev,
  2658					      u32 remote_accel_id,
  2659					      struct amdgpu_ualink_wb **wb_cpu,
  2660					      u64 *wb_npa, u32 type)
  2661	{
  2662		struct amdgpu_ualink_remote *remote = to_remote(adev);
  2663		u32 accel_id = ualink_accel_id(adev);
  2664		u32 rb_size = AMDGPU_GPU_PAGE_ALIGN(2 * AMDGPU_UALINK_RB_SIZE);
  2665		u64 wb, npa;
  2666		u32 offset = 0;
  2667	
  2668		if (ualink_addr_mode(adev) == AMDGPU_UALINK_ADDR_MODE_SOURCE_IDENT) {
> 2669			wb = (u64)remote->rb_cpu_addr + rb_size * remote->num_accel;
  2670			npa = amdgpu_ualink_npa_addr(adev, RB_TYPE_TAILPTR,
  2671						     remote_accel_id, accel_id);
  2672		} else {
  2673			wb = (u64)remote->rptr_cpu_addr;
  2674			npa = remote->rptr_npa;
  2675			npa |= (u64)accel_id << AMDGPU_UALINK_GART_NPA_ADDR_GPUID_SHIFT;
  2676		}
  2677	
  2678		if (type == RB_TYPE_TLB_INV)
  2679			offset = ualink_tlb_wb_offset(adev, remote_accel_id);
  2680		else if (type == RB_TYPE_REMOTE_INTERRUPT)
  2681			offset = ualink_wb_offset(adev, remote_accel_id);
  2682	
> 2683		*wb_cpu = (struct amdgpu_ualink_wb *)(wb + offset);
  2684		if (wb_npa)
  2685			*wb_npa = npa + offset;
  2686	
  2687		dev_dbg(adev->dev, "source %d remote %d wb npa 0x%llx\n", accel_id,
  2688			remote_accel_id, npa + offset);
  2689	}
  2690	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.