[agd5f:ualink 121/183] drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:2051:26: error: assignment to 'dma_addr_t *' {aka 'unsigned int *'} from incompatible pointer type 'u64 *' {aka 'long long unsigned int *'}

lkp <[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: 6a0b2491c4a894d2dd8d4fa86b1c50008841c017 [121/183] drm/amdgpu: Add UALink GART helpers for NPA address access
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 errors (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:2051:26: error: assignment to 'dma_addr_t *' {aka 'unsigned int *'} from incompatible pointer type 'u64 *' {aka 'long long unsigned int *'} [-Wincompatible-pointer-types]
    2051 |                 dma_addr = &npa;
         |                          ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c: At top level:
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:2077:13: warning: 'amdgpu_ualink_gart_unmap' defined but not used [-Wunused-function]
    2077 | static void amdgpu_ualink_gart_unmap(struct amdgpu_device *adev, u64 npages,
         |             ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:2030:12: warning: 'amdgpu_ualink_gart_map' defined but not used [-Wunused-function]
    2030 | static int amdgpu_ualink_gart_map(struct amdgpu_device *adev, u64 npages,
         |            ^~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:2007:13: warning: 'amdgpu_ualink_sdma_entities_fini' defined but not used [-Wunused-function]
    2007 | static void amdgpu_ualink_sdma_entities_fini(struct amdgpu_device *adev)
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:1974:12: warning: 'amdgpu_ualink_sdma_entities_init' defined but not used [-Wunused-function]
    1974 | static int amdgpu_ualink_sdma_entities_init(struct amdgpu_device *adev)
         |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:1818:12: warning: 'amdgpu_ualink_metadata_npa_mapping' defined but not used [-Wunused-function]
    1818 | static int amdgpu_ualink_metadata_npa_mapping(struct amdgpu_device *adev)
         |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:1696:13: warning: 'amdgpu_ualink_metadata_npa_unmapping' defined but not used [-Wunused-function]
    1696 | static void amdgpu_ualink_metadata_npa_unmapping(struct amdgpu_device *adev)
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c:1609:12: warning: 'amdgpu_ualink_gart_npa_addr' defined but not used [-Wunused-function]
    1609 | static u64 amdgpu_ualink_gart_npa_addr(struct amdgpu_device *adev, u32 type,
         |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~


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

  2017	
  2018	/**
  2019	 * amdgpu_ualink_gart_map - Allocate GART entry and map NPA address
  2020	 * @adev: amdgpu device pointer
  2021	 * @npages: Number of pages to map
  2022	 * @npa: NPA address to map
  2023	 * @mm_node: DRM memory manager node for GART allocation
  2024	 * @pte_flags: the GART mapping flags
  2025	 *
  2026	 * Allocates GART entries and sets up NPA address mapping without TTM BO.
  2027	 *
  2028	 * Return: 0 on success, negative error code on failure
  2029	 */
  2030	static int amdgpu_ualink_gart_map(struct amdgpu_device *adev, u64 npages,
  2031					   u64 npa, struct drm_mm_node *mm_node,
  2032					   u64 pte_flags)
  2033	{
  2034		struct ttm_resource_manager *man =
  2035					ttm_manager_type(&adev->mman.bdev, TTM_PL_TT);
  2036		struct amdgpu_gtt_mgr *mgr =
  2037					container_of(man, struct amdgpu_gtt_mgr, manager);
  2038		dma_addr_t *dma_addr;
  2039		int i, r;
  2040	
  2041		dev_dbg(adev->dev, "npa 0x%llx npages 0x%llx\n", npa, npages);
  2042	
  2043		if (npages > 1) {
  2044			dma_addr = kmalloc_array(npages, sizeof(*dma_addr), GFP_KERNEL);
  2045			if (!dma_addr)
  2046				return -ENOMEM;
  2047	
  2048			for (i = 0; i < npages; i++)
  2049				dma_addr[i] = npa + i * AMDGPU_GPU_PAGE_SIZE;
  2050		} else {
> 2051			dma_addr = &npa;
  2052		}
  2053	
  2054		r = amdgpu_gtt_mgr_alloc_entries(mgr, mm_node, npages, DRM_MM_INSERT_BEST);
  2055		if (r)
  2056			goto out;
  2057		amdgpu_gart_bind(adev, mm_node->start << AMDGPU_GPU_PAGE_SHIFT, npages, dma_addr,
  2058				 pte_flags);
  2059	
  2060	out:
  2061		dev_dbg(adev->dev, "npa 0x%llx mapped to 0x%llx npages 0x%llx r=%d\n",
  2062			npa, mm_node->start << AMDGPU_GPU_PAGE_SHIFT, npages, r);
  2063	
  2064		if (npages > 1)
  2065			kfree(dma_addr);
  2066		return r;
  2067	}
  2068	

--
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.