[radeon-alex:amd-mainline-hybrid-4.11 1373/2257] drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:352:70: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 2 has type 'resource_size_t {aka unsigned int}'

kbuild test robot fengguang.wu at intel.com
Sun Jul 30 08:24:25 UTC 2017


tree:   git://people.freedesktop.org/~agd5f/linux.git amd-mainline-hybrid-4.11
head:   4e9a9bc851d8ecea7b6cabb485f1aa3e914a42a9
commit: a2a89723a7d85d57bad83a0baa839d18f0db0805 [1373/2257] port in all files
config: i386-allyesconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        git checkout a2a89723a7d85d57bad83a0baa839d18f0db0805
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c: In function 'amdgdu_amdkfd_restore_mem_worker':
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:193:22: error: 'struct amdgpu_bo' has no member named 'adev'
     adev = mem->data2.bo->adev;
                         ^~
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c: In function 'get_local_mem_info':
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:342:24: warning: left shift count >= width of type [-Wshift-count-overflow]
     address_mask = ~((1UL << 40) - 1);
                           ^~
>> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:352:70: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 2 has type 'resource_size_t {aka unsigned int}' [-Wformat=]
      pr_err("amdgpu: vram aperture is out of 40bit address base: 0x%llx limit 0x%llx\n",
                                                                         ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:352:84: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'resource_size_t {aka unsigned int}' [-Wformat=]
      pr_err("amdgpu: vram aperture is out of 40bit address base: 0x%llx limit 0x%llx\n",
                                                                                       ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:356:24: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 2 has type 'resource_size_t {aka unsigned int}' [-Wformat=]
     pr_debug("amdgpu: address base: 0x%llx limit 0x%llx public 0x%llx private 0x%llx\n",
                           ^~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:356:24: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'resource_size_t {aka unsigned int}' [-Wformat=]
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:361:6: error: 'amdgpu_powerplay' undeclared (first use in this function)
     if (amdgpu_powerplay || rdev->pm.funcs->get_mclk)
         ^~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:361:6: note: each undeclared identifier is reported only once for each function it appears in
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c: In function 'get_max_engine_clock_in_mhz':
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:379:6: error: 'amdgpu_powerplay' undeclared (first use in this function)
     if (amdgpu_powerplay)
         ^~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c: In function 'get_cu_info':
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:402:33: error: 'struct amdgpu_cu_info' has no member named 'simd_per_cu'
     cu_info->simd_per_cu = acu_info.simd_per_cu;
                                    ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:403:40: error: 'struct amdgpu_cu_info' has no member named 'max_waves_per_simd'
     cu_info->max_waves_per_simd = acu_info.max_waves_per_simd;
                                           ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:405:46: error: 'struct amdgpu_cu_info' has no member named 'max_scratch_slots_per_cu'
     cu_info->max_scratch_slots_per_cu = acu_info.max_scratch_slots_per_cu;
                                                 ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:406:30: error: 'struct amdgpu_cu_info' has no member named 'lds_size'
     cu_info->lds_size = acu_info.lds_size;
                                 ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c: In function 'amdgpu_amdkfd_get_dmabuf_info':
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:432:23: error: 'drm_gem_prime_dmabuf_ops' undeclared (first use in this function)
     if (dma_buf->ops != &drm_gem_prime_dmabuf_ops)
                          ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:443:10: error: 'struct amdgpu_bo' has no member named 'initial_domain'
     if (!(bo->initial_domain & (AMDGPU_GEM_DOMAIN_VRAM |
             ^~
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:459:15: error: 'struct amdgpu_bo' has no member named 'initial_domain'
      *flags = (bo->initial_domain & AMDGPU_GEM_DOMAIN_VRAM) ?
                  ^~
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c: In function 'get_max_engine_clock_in_mhz':
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:383:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^

vim +352 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c

   183	
   184	static void amdgdu_amdkfd_restore_mem_worker(struct work_struct *work)
   185	{
   186		struct delayed_work *dwork = to_delayed_work(work);
   187		struct kgd_mem *mem = container_of(dwork, struct kgd_mem, data2.work);
   188		struct amdgpu_device *adev;
   189		struct mm_struct *mm;
   190	
   191		mutex_lock(&mem->data2.lock);
   192	
 > 193		adev = mem->data2.bo->adev;
   194		mm = mem->data2.mm;
   195	
   196		/* Restoration may have been canceled by another eviction or
   197		 * could already be done by a restore scheduled earlier */
   198		if (mem->data2.evicted == 1) {
   199			amdgpu_amdkfd_gpuvm_restore_mem(mem, mm);
   200			mem->data2.evicted = 0;
   201		}
   202	
   203		mutex_unlock(&mem->data2.lock);
   204	}
   205	
   206	int amdgpu_amdkfd_schedule_restore_mem(struct amdgpu_device *adev,
   207					       struct kgd_mem *mem,
   208					       struct mm_struct *mm,
   209					       unsigned long delay)
   210	{
   211		int r = 0;
   212	
   213		if (!adev->kfd)
   214			return -ENODEV;
   215	
   216		mutex_lock(&mem->data2.lock);
   217	
   218		if (mem->data2.evicted <= 1) {
   219			/* Buffer is not evicted (== 0) or its restoration is
   220			 * already scheduled (== 1) */
   221			pr_err("Unbalanced restore of evicted buffer %p\n", mem);
   222			mutex_unlock(&mem->data2.lock);
   223			return -EFAULT;
   224		} else if (--mem->data2.evicted > 1) {
   225			mutex_unlock(&mem->data2.lock);
   226			return 0;
   227		}
   228	
   229		/* mem->data2.evicted is 1 after decrememting. Schedule
   230		 * restoration. */
   231		if (delayed_work_pending(&mem->data2.work))
   232			cancel_delayed_work(&mem->data2.work);
   233		mem->data2.mm = mm;
   234		INIT_DELAYED_WORK(&mem->data2.work,
   235				  amdgdu_amdkfd_restore_mem_worker);
   236		schedule_delayed_work(&mem->data2.work, delay);
   237	
   238		mutex_unlock(&mem->data2.lock);
   239	
   240		return r;
   241	}
   242	
   243	void amdgpu_amdkfd_cancel_restore_mem(struct amdgpu_device *adev,
   244					      struct kgd_mem *mem)
   245	{
   246		if (delayed_work_pending(&mem->data2.work))
   247			cancel_delayed_work_sync(&mem->data2.work);
   248	}
   249	
   250	u32 pool_to_domain(enum kgd_memory_pool p)
   251	{
   252		switch (p) {
   253		case KGD_POOL_FRAMEBUFFER: return AMDGPU_GEM_DOMAIN_VRAM;
   254		default: return AMDGPU_GEM_DOMAIN_GTT;
   255		}
   256	}
   257	
   258	int alloc_gtt_mem(struct kgd_dev *kgd, size_t size,
   259				void **mem_obj, uint64_t *gpu_addr,
   260				void **cpu_ptr)
   261	{
   262		struct amdgpu_device *rdev = (struct amdgpu_device *)kgd;
   263		struct kgd_mem **mem = (struct kgd_mem **) mem_obj;
   264		int r;
   265	
   266		BUG_ON(kgd == NULL);
   267		BUG_ON(gpu_addr == NULL);
   268		BUG_ON(cpu_ptr == NULL);
   269	
   270		*mem = kmalloc(sizeof(struct kgd_mem), GFP_KERNEL);
   271		if ((*mem) == NULL)
   272			return -ENOMEM;
   273	
   274		r = amdgpu_bo_create(rdev, size, PAGE_SIZE, true, AMDGPU_GEM_DOMAIN_GTT,
   275				AMDGPU_GEM_CREATE_CPU_GTT_USWC, NULL, NULL, &((*mem)->data1.bo));
   276		if (r) {
   277			dev_err(rdev->dev,
   278				"failed to allocate BO for amdkfd (%d)\n", r);
   279			return r;
   280		}
   281	
   282		/* map the buffer */
   283		r = amdgpu_bo_reserve((*mem)->data1.bo, true);
   284		if (r) {
   285			dev_err(rdev->dev, "(%d) failed to reserve bo for amdkfd\n", r);
   286			goto allocate_mem_reserve_bo_failed;
   287		}
   288	
   289		r = amdgpu_bo_pin((*mem)->data1.bo, AMDGPU_GEM_DOMAIN_GTT,
   290					&(*mem)->data1.gpu_addr);
   291		if (r) {
   292			dev_err(rdev->dev, "(%d) failed to pin bo for amdkfd\n", r);
   293			goto allocate_mem_pin_bo_failed;
   294		}
   295		*gpu_addr = (*mem)->data1.gpu_addr;
   296	
   297		r = amdgpu_bo_kmap((*mem)->data1.bo, &(*mem)->data1.cpu_ptr);
   298		if (r) {
   299			dev_err(rdev->dev,
   300				"(%d) failed to map bo to kernel for amdkfd\n", r);
   301			goto allocate_mem_kmap_bo_failed;
   302		}
   303		*cpu_ptr = (*mem)->data1.cpu_ptr;
   304	
   305		amdgpu_bo_unreserve((*mem)->data1.bo);
   306	
   307		return 0;
   308	
   309	allocate_mem_kmap_bo_failed:
   310		amdgpu_bo_unpin((*mem)->data1.bo);
   311	allocate_mem_pin_bo_failed:
   312		amdgpu_bo_unreserve((*mem)->data1.bo);
   313	allocate_mem_reserve_bo_failed:
   314		amdgpu_bo_unref(&(*mem)->data1.bo);
   315	
   316		return r;
   317	}
   318	
   319	void free_gtt_mem(struct kgd_dev *kgd, void *mem_obj)
   320	{
   321		struct kgd_mem *mem = (struct kgd_mem *) mem_obj;
   322	
   323		BUG_ON(mem == NULL);
   324	
   325		amdgpu_bo_reserve(mem->data1.bo, true);
   326		amdgpu_bo_kunmap(mem->data1.bo);
   327		amdgpu_bo_unpin(mem->data1.bo);
   328		amdgpu_bo_unreserve(mem->data1.bo);
   329		amdgpu_bo_unref(&(mem->data1.bo));
   330		kfree(mem);
   331	}
   332	
   333	void get_local_mem_info(struct kgd_dev *kgd,
   334					struct kfd_local_mem_info *mem_info)
   335	{
   336		uint64_t address_mask;
   337		resource_size_t aper_limit;
   338		struct amdgpu_device *rdev = (struct amdgpu_device *)kgd;
   339	
   340		BUG_ON(kgd == NULL);
   341	
   342		address_mask = ~((1UL << 40) - 1);
   343		aper_limit = rdev->mc.aper_base + rdev->mc.aper_size;
   344		memset(mem_info, 0, sizeof(*mem_info));
   345		if (!(rdev->mc.aper_base & address_mask ||
   346				aper_limit & address_mask)) {
   347			mem_info->local_mem_size_public = rdev->mc.visible_vram_size;
   348			mem_info->local_mem_size_private = rdev->mc.real_vram_size -
   349					rdev->mc.visible_vram_size;
   350			mem_info->vram_width = rdev->mc.vram_width;
   351		} else {
 > 352			pr_err("amdgpu: vram aperture is out of 40bit address base: 0x%llx limit 0x%llx\n",
   353					rdev->mc.aper_base, aper_limit);
   354		}
   355	
   356		pr_debug("amdgpu: address base: 0x%llx limit 0x%llx public 0x%llx private 0x%llx\n",
   357				rdev->mc.aper_base, aper_limit,
   358				mem_info->local_mem_size_public,
   359				mem_info->local_mem_size_private);
   360	
   361		if (amdgpu_powerplay || rdev->pm.funcs->get_mclk)
   362			mem_info->mem_clk_max = amdgpu_dpm_get_mclk(rdev, false) / 100;
   363	}
   364	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 58355 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20170730/591706b0/attachment-0001.gz>


More information about the dri-devel mailing list