[willy-pagecache:headers 16/21] drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_migrate.c:236:2: error: call to undeclared function 'unlock_page'; ISO C99 and later do not support implicit function declarations

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
tree:   git://git.infradead.org/users/willy/pagecache headers
head:   2c16f123eb253c5d93edfe0e5439120f8f7e3afa
commit: 8f4b7541e27a9da8c5d1d0908af1e739b6e05e05 [16/21] drm/amd: Remove pagemap.h includes
config: x86_64-randconfig-005-20260825 (https://download.01.org/0day-ci/archive/20260825/[email protected]/config)
compiler: clang version 22.1.3 (https://github.com/llvm/llvm-project e9846648fd6183ee6d8cbdb4502213fcf902a211)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260825/[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/../amdkfd/kfd_migrate.c:236:2: error: call to undeclared function 'unlock_page'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     236 |         unlock_page(page);
         |         ^
>> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_migrate.c:256:3: error: call to undeclared function 'lock_page'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     256 |                 lock_page(page);
         |                 ^
   drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_migrate.c:256:3: note: did you mean 'copy_page'?
   arch/x86/include/asm/page_64.h:117:6: note: 'copy_page' declared here
     117 | void copy_page(void *to, void *from);
         |      ^
   drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_migrate.c:266:2: error: call to undeclared function 'unlock_page'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     266 |         unlock_page(page);
         |         ^
   3 errors generated.


vim +/unlock_page +236 drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_migrate.c

0b0e518d61af8e1 Felix Kuehling 2021-02-24  229  
0b0e518d61af8e1 Felix Kuehling 2021-02-24  230  static void
0b0e518d61af8e1 Felix Kuehling 2021-02-24  231  svm_migrate_put_vram_page(struct amdgpu_device *adev, unsigned long addr)
0b0e518d61af8e1 Felix Kuehling 2021-02-24  232  {
0b0e518d61af8e1 Felix Kuehling 2021-02-24  233  	struct page *page;
0b0e518d61af8e1 Felix Kuehling 2021-02-24  234  
0b0e518d61af8e1 Felix Kuehling 2021-02-24  235  	page = pfn_to_page(svm_migrate_addr_to_pfn(adev, addr));
0b0e518d61af8e1 Felix Kuehling 2021-02-24 @236  	unlock_page(page);
0b0e518d61af8e1 Felix Kuehling 2021-02-24  237  	put_page(page);
0b0e518d61af8e1 Felix Kuehling 2021-02-24  238  }
0b0e518d61af8e1 Felix Kuehling 2021-02-24  239  
48ff079b28d82db Felix Kuehling 2021-03-17  240  static unsigned long
48ff079b28d82db Felix Kuehling 2021-03-17  241  svm_migrate_addr(struct amdgpu_device *adev, struct page *page)
48ff079b28d82db Felix Kuehling 2021-03-17  242  {
48ff079b28d82db Felix Kuehling 2021-03-17  243  	unsigned long addr;
48ff079b28d82db Felix Kuehling 2021-03-17  244  
48ff079b28d82db Felix Kuehling 2021-03-17  245  	addr = page_to_pfn(page) << PAGE_SHIFT;
610dab118ff5013 Philip Yang    2023-03-31  246  	return (addr - adev->kfd.pgmap.range.start);
48ff079b28d82db Felix Kuehling 2021-03-17  247  }
48ff079b28d82db Felix Kuehling 2021-03-17  248  
48ff079b28d82db Felix Kuehling 2021-03-17  249  static struct page *
48ff079b28d82db Felix Kuehling 2021-03-17  250  svm_migrate_get_sys_page(struct vm_area_struct *vma, unsigned long addr)
48ff079b28d82db Felix Kuehling 2021-03-17  251  {
48ff079b28d82db Felix Kuehling 2021-03-17  252  	struct page *page;
48ff079b28d82db Felix Kuehling 2021-03-17  253  
48ff079b28d82db Felix Kuehling 2021-03-17  254  	page = alloc_page_vma(GFP_HIGHUSER, vma, addr);
48ff079b28d82db Felix Kuehling 2021-03-17  255  	if (page)
48ff079b28d82db Felix Kuehling 2021-03-17 @256  		lock_page(page);
48ff079b28d82db Felix Kuehling 2021-03-17  257  
48ff079b28d82db Felix Kuehling 2021-03-17  258  	return page;
48ff079b28d82db Felix Kuehling 2021-03-17  259  }
48ff079b28d82db Felix Kuehling 2021-03-17  260  

:::::: The code at line 236 was first introduced by commit
:::::: 0b0e518d61af8e1cb73cbbfb313b215640c8a6f3 drm/amdkfd: HMM migrate ram to vram

:::::: TO: Felix Kuehling <[email protected]>
:::::: CC: Alex Deucher <[email protected]>

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