[intel-gvt-linux:gvt-staging 9992/9999] drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c:1357:2: error: implicit declaration of function 'drm_gem_object_put_unlocked'; did you mean
kernel test robot
lkp at intel.com
Mon Jun 29 21:22:11 UTC 2020
tree: https://github.com/intel/gvt-linux.git gvt-staging
head: bbb75a055175247493145d91497fab1ca6905076
commit: a1e7ba67d94dbf392b229920b354a7f42653e20c [9992/9999] Merge remote-tracking branch 'drm-misc/drm-misc-next' into drm-tip
config: x86_64-randconfig-a015-20200629 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce (this is a W=1 build):
git checkout a1e7ba67d94dbf392b229920b354a7f42653e20c
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>
All errors (new ones prefixed by >>):
In file included from arch/x86/include/asm/bug.h:86,
from include/linux/bug.h:5,
from include/linux/jump_label.h:250,
from arch/x86/include/asm/string_64.h:6,
from arch/x86/include/asm/string.h:5,
from include/linux/string.h:20,
from include/linux/scatterlist.h:5,
from include/linux/dma-buf.h:18,
from drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c:22:
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c: In function 'unreserve_mem_limit':
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c:188:34: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
188 | WARN_ONCE(adev->kfd.vram_used < 0,
| ^
include/asm-generic/bug.h:156:27: note: in definition of macro 'WARN_ONCE'
156 | int __ret_warn_once = !!(condition); \
| ^~~~~~~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c: In function 'amdgpu_amdkfd_gpuvm_free_memory_of_gpu':
>> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c:1357:2: error: implicit declaration of function 'drm_gem_object_put_unlocked'; did you mean 'drm_gem_object_put_locked'? [-Werror=implicit-function-declaration]
1357 | drm_gem_object_put_unlocked(&mem->bo->tbo.base);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| drm_gem_object_put_locked
In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:33,
from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
from drivers/gpu/drm/amd/amdgpu/../include/dm_pp_interface.h:26,
from drivers/gpu/drm/amd/amdgpu/amdgpu.h:65,
from drivers/gpu/drm/amd/amdgpu/amdgpu_object.h:32,
from drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c:28:
At top level:
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:76:32: warning: 'dc_fixpt_ln2_div_2' defined but not used [-Wunused-const-variable=]
76 | static const struct fixed31_32 dc_fixpt_ln2_div_2 = { 1488522236LL };
| ^~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:75:32: warning: 'dc_fixpt_ln2' defined but not used [-Wunused-const-variable=]
75 | static const struct fixed31_32 dc_fixpt_ln2 = { 2977044471LL };
| ^~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:74:32: warning: 'dc_fixpt_e' defined but not used [-Wunused-const-variable=]
74 | static const struct fixed31_32 dc_fixpt_e = { 11674931555LL };
| ^~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:73:32: warning: 'dc_fixpt_two_pi' defined but not used [-Wunused-const-variable=]
73 | static const struct fixed31_32 dc_fixpt_two_pi = { 26986075409LL };
| ^~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:72:32: warning: 'dc_fixpt_pi' defined but not used [-Wunused-const-variable=]
72 | static const struct fixed31_32 dc_fixpt_pi = { 13493037705LL };
| ^~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:67:32: warning: 'dc_fixpt_zero' defined but not used [-Wunused-const-variable=]
67 | static const struct fixed31_32 dc_fixpt_zero = { 0 };
| ^~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +1357 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
a46a2cd103a863 Felix Kuehling 2018-02-06 1278
a46a2cd103a863 Felix Kuehling 2018-02-06 1279 int amdgpu_amdkfd_gpuvm_free_memory_of_gpu(
d4566dee849e4b Mukul Joshi 2020-04-28 1280 struct kgd_dev *kgd, struct kgd_mem *mem, uint64_t *size)
a46a2cd103a863 Felix Kuehling 2018-02-06 1281 {
a46a2cd103a863 Felix Kuehling 2018-02-06 1282 struct amdkfd_process_info *process_info = mem->process_info;
a46a2cd103a863 Felix Kuehling 2018-02-06 1283 unsigned long bo_size = mem->bo->tbo.mem.size;
a46a2cd103a863 Felix Kuehling 2018-02-06 1284 struct kfd_bo_va_list *entry, *tmp;
a46a2cd103a863 Felix Kuehling 2018-02-06 1285 struct bo_vm_reservation_context ctx;
a46a2cd103a863 Felix Kuehling 2018-02-06 1286 struct ttm_validate_buffer *bo_list_entry;
fe158997c8b73c Bernard Zhao 2020-04-20 1287 unsigned int mapped_to_gpu_memory;
a46a2cd103a863 Felix Kuehling 2018-02-06 1288 int ret;
d4566dee849e4b Mukul Joshi 2020-04-28 1289 bool is_imported = 0;
a46a2cd103a863 Felix Kuehling 2018-02-06 1290
a46a2cd103a863 Felix Kuehling 2018-02-06 1291 mutex_lock(&mem->lock);
fe158997c8b73c Bernard Zhao 2020-04-20 1292 mapped_to_gpu_memory = mem->mapped_to_gpu_memory;
d4566dee849e4b Mukul Joshi 2020-04-28 1293 is_imported = mem->is_imported;
fe158997c8b73c Bernard Zhao 2020-04-20 1294 mutex_unlock(&mem->lock);
fe158997c8b73c Bernard Zhao 2020-04-20 1295 /* lock is not needed after this, since mem is unused and will
fe158997c8b73c Bernard Zhao 2020-04-20 1296 * be freed anyway
fe158997c8b73c Bernard Zhao 2020-04-20 1297 */
a46a2cd103a863 Felix Kuehling 2018-02-06 1298
fe158997c8b73c Bernard Zhao 2020-04-20 1299 if (mapped_to_gpu_memory > 0) {
a46a2cd103a863 Felix Kuehling 2018-02-06 1300 pr_debug("BO VA 0x%llx size 0x%lx is still mapped.\n",
a46a2cd103a863 Felix Kuehling 2018-02-06 1301 mem->va, bo_size);
a46a2cd103a863 Felix Kuehling 2018-02-06 1302 return -EBUSY;
a46a2cd103a863 Felix Kuehling 2018-02-06 1303 }
a46a2cd103a863 Felix Kuehling 2018-02-06 1304
a46a2cd103a863 Felix Kuehling 2018-02-06 1305 /* Make sure restore workers don't access the BO any more */
a46a2cd103a863 Felix Kuehling 2018-02-06 1306 bo_list_entry = &mem->validate_list;
a46a2cd103a863 Felix Kuehling 2018-02-06 1307 mutex_lock(&process_info->lock);
a46a2cd103a863 Felix Kuehling 2018-02-06 1308 list_del(&bo_list_entry->head);
a46a2cd103a863 Felix Kuehling 2018-02-06 1309 mutex_unlock(&process_info->lock);
a46a2cd103a863 Felix Kuehling 2018-02-06 1310
f7646585a30ed8 Philip Yang 2020-05-21 1311 /* No more MMU notifiers */
f7646585a30ed8 Philip Yang 2020-05-21 1312 amdgpu_mn_unregister(mem->bo);
f7646585a30ed8 Philip Yang 2020-05-21 1313
a46a2cd103a863 Felix Kuehling 2018-02-06 1314 ret = reserve_bo_and_cond_vms(mem, NULL, BO_VM_ALL, &ctx);
a46a2cd103a863 Felix Kuehling 2018-02-06 1315 if (unlikely(ret))
a46a2cd103a863 Felix Kuehling 2018-02-06 1316 return ret;
a46a2cd103a863 Felix Kuehling 2018-02-06 1317
a46a2cd103a863 Felix Kuehling 2018-02-06 1318 /* The eviction fence should be removed by the last unmap.
a46a2cd103a863 Felix Kuehling 2018-02-06 1319 * TODO: Log an error condition if the bo still has the eviction fence
a46a2cd103a863 Felix Kuehling 2018-02-06 1320 * attached
a46a2cd103a863 Felix Kuehling 2018-02-06 1321 */
a46a2cd103a863 Felix Kuehling 2018-02-06 1322 amdgpu_amdkfd_remove_eviction_fence(mem->bo,
2d086fded1021d Felix Kuehling 2019-02-04 1323 process_info->eviction_fence);
a46a2cd103a863 Felix Kuehling 2018-02-06 1324 pr_debug("Release VA 0x%llx - 0x%llx\n", mem->va,
a46a2cd103a863 Felix Kuehling 2018-02-06 1325 mem->va + bo_size * (1 + mem->aql_queue));
a46a2cd103a863 Felix Kuehling 2018-02-06 1326
a46a2cd103a863 Felix Kuehling 2018-02-06 1327 /* Remove from VM internal data structures */
a46a2cd103a863 Felix Kuehling 2018-02-06 1328 list_for_each_entry_safe(entry, tmp, &mem->bo_va_list, bo_list)
a46a2cd103a863 Felix Kuehling 2018-02-06 1329 remove_bo_from_vm((struct amdgpu_device *)entry->kgd_dev,
a46a2cd103a863 Felix Kuehling 2018-02-06 1330 entry, bo_size);
a46a2cd103a863 Felix Kuehling 2018-02-06 1331
a46a2cd103a863 Felix Kuehling 2018-02-06 1332 ret = unreserve_bo_and_vms(&ctx, false, false);
a46a2cd103a863 Felix Kuehling 2018-02-06 1333
a46a2cd103a863 Felix Kuehling 2018-02-06 1334 /* Free the sync object */
a46a2cd103a863 Felix Kuehling 2018-02-06 1335 amdgpu_sync_free(&mem->sync);
a46a2cd103a863 Felix Kuehling 2018-02-06 1336
d8e408a82704c8 Oak Zeng 2019-04-11 1337 /* If the SG is not NULL, it's one we created for a doorbell or mmio
d8e408a82704c8 Oak Zeng 2019-04-11 1338 * remap BO. We need to free it.
b408a548846f23 Felix Kuehling 2018-11-20 1339 */
b408a548846f23 Felix Kuehling 2018-11-20 1340 if (mem->bo->tbo.sg) {
b408a548846f23 Felix Kuehling 2018-11-20 1341 sg_free_table(mem->bo->tbo.sg);
b408a548846f23 Felix Kuehling 2018-11-20 1342 kfree(mem->bo->tbo.sg);
b408a548846f23 Felix Kuehling 2018-11-20 1343 }
b408a548846f23 Felix Kuehling 2018-11-20 1344
d4566dee849e4b Mukul Joshi 2020-04-28 1345 /* Update the size of the BO being freed if it was allocated from
d4566dee849e4b Mukul Joshi 2020-04-28 1346 * VRAM and is not imported.
d4566dee849e4b Mukul Joshi 2020-04-28 1347 */
d4566dee849e4b Mukul Joshi 2020-04-28 1348 if (size) {
d4566dee849e4b Mukul Joshi 2020-04-28 1349 if ((mem->bo->preferred_domains == AMDGPU_GEM_DOMAIN_VRAM) &&
d4566dee849e4b Mukul Joshi 2020-04-28 1350 (!is_imported))
d4566dee849e4b Mukul Joshi 2020-04-28 1351 *size = bo_size;
d4566dee849e4b Mukul Joshi 2020-04-28 1352 else
d4566dee849e4b Mukul Joshi 2020-04-28 1353 *size = 0;
d4566dee849e4b Mukul Joshi 2020-04-28 1354 }
d4566dee849e4b Mukul Joshi 2020-04-28 1355
a46a2cd103a863 Felix Kuehling 2018-02-06 1356 /* Free the BO*/
fd9a9f8801def3 Felix Kuehling 2020-05-05 @1357 drm_gem_object_put_unlocked(&mem->bo->tbo.base);
a46a2cd103a863 Felix Kuehling 2018-02-06 1358 mutex_destroy(&mem->lock);
a46a2cd103a863 Felix Kuehling 2018-02-06 1359 kfree(mem);
a46a2cd103a863 Felix Kuehling 2018-02-06 1360
a46a2cd103a863 Felix Kuehling 2018-02-06 1361 return ret;
a46a2cd103a863 Felix Kuehling 2018-02-06 1362 }
a46a2cd103a863 Felix Kuehling 2018-02-06 1363
:::::: The code at line 1357 was first introduced by commit
:::::: fd9a9f8801def3908960312e46bb92126add6b66 drm/amdgpu: Use GEM obj reference for KFD BOs
:::::: TO: Felix Kuehling <Felix.Kuehling at amd.com>
:::::: CC: Alex Deucher <alexander.deucher at amd.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 35225 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20200630/0c23157b/attachment-0001.gz>
More information about the intel-gvt-dev
mailing list