tree: git://people.freedesktop.org/~agd5f/linux.git amd-mainline-dkms-5.2 head: b027ed8d9051470f4ed6bc071fcde172fe1fc595 commit: f2d51786363ee2a72c55570835e4c79066af2782 [2129/2647] drm/amdkcl: Test whether kmap_atomic() wants one argument config: x86_64-randconfig-g002-201943 (attached as .config) compiler: gcc-7 (Debian 7.4.0-14) 7.4.0 reproduce: git checkout f2d51786363ee2a72c55570835e4c79066af2782 # save the attached .config to linux build tree make ARCH=x86_64 If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@xxxxxxxxx> All errors (new ones prefixed by >>): from include/drm/drm_print.h:32, from include/drm/drm_mm.h:49, from include/drm/drm_vma_manager.h:26, from include/kcl/kcl_drm_vma_manager.h:8, from drivers/gpu/drm/ttm/backport/backport.h:5, from <command-line>:0: include/linux/kref.h:36:28: note: previous definition of 'kref_read' was here static inline unsigned int kref_read(const struct kref *kref) ^~~~~~~~~ In file included from drivers/gpu/drm/ttm/backport/backport.h:11:0, from <command-line>:0: include/kcl/kcl_kref.h: In function 'kref_read': include/kcl/kcl_kref.h:9:21: error: passing argument 1 of 'atomic_read' from incompatible pointer type [-Werror=incompatible-pointer-types] return atomic_read(&kref->refcount); ^ In file included from arch/x86/include/asm/atomic.h:265:0, from include/linux/atomic.h:7, from include/linux/rcupdate.h:25, from include/linux/rbtree.h:34, from include/drm/drm_mm.h:41, from include/drm/drm_vma_manager.h:26, from include/kcl/kcl_drm_vma_manager.h:8, from drivers/gpu/drm/ttm/backport/backport.h:5, from <command-line>:0: include/asm-generic/atomic-instrumented.h:24:1: note: expected 'const atomic_t * {aka const struct <anonymous> *}' but argument is of type 'const refcount_t * {aka const struct refcount_struct *}' atomic_read(const atomic_t *v) ^~~~~~~~~~~ In file included from drivers/gpu/drm/ttm/backport/backport.h:12:0, from <command-line>:0: include/kcl/kcl_mm_types.h: At top level: include/kcl/kcl_mm_types.h:10:3: error: conflicting types for 'pfn_t' } pfn_t; ^~~~~ In file included from include/asm-generic/memory_model.h:5:0, from arch/x86/include/asm/page.h:76, from arch/x86/include/asm/thread_info.h:12, from include/linux/thread_info.h:38, from arch/x86/include/asm/preempt.h:7, from include/linux/preempt.h:78, from include/linux/rcupdate.h:27, from include/linux/rbtree.h:34, from include/drm/drm_mm.h:41, from include/drm/drm_vma_manager.h:26, from include/kcl/kcl_drm_vma_manager.h:8, from drivers/gpu/drm/ttm/backport/backport.h:5, from <command-line>:0: include/linux/pfn.h:15:3: note: previous declaration of 'pfn_t' was here } pfn_t; ^~~~~ In file included from drivers/gpu/drm/ttm/backport/backport.h:12:0, from <command-line>:0: include/kcl/kcl_mm_types.h:33:13: error: conflicting types for 'vm_fault_t' typedef int vm_fault_t; ^~~~~~~~~~ In file included from include/drm/drm_mm.h:43:0, from include/drm/drm_vma_manager.h:26, from include/kcl/kcl_drm_vma_manager.h:8, from drivers/gpu/drm/ttm/backport/backport.h:5, from <command-line>:0: include/linux/mm_types.h:631:32: note: previous declaration of 'vm_fault_t' was here typedef __bitwise unsigned int vm_fault_t; ^~~~~~~~~~ In file included from drivers/gpu/drm/ttm/backport/backport.h:12:0, from <command-line>:0: include/kcl/kcl_mm_types.h:35:26: error: conflicting types for 'vmf_insert_mixed' static inline vm_fault_t vmf_insert_mixed(struct vm_area_struct *vma, ^~~~~~~~~~~~~~~~ In file included from include/drm/drm_vma_manager.h:27:0, from include/kcl/kcl_drm_vma_manager.h:8, from drivers/gpu/drm/ttm/backport/backport.h:5, from <command-line>:0: include/linux/mm.h:2587:12: note: previous declaration of 'vmf_insert_mixed' was here vm_fault_t vmf_insert_mixed(struct vm_area_struct *vma, unsigned long addr, ^~~~~~~~~~~~~~~~ In file included from drivers/gpu/drm/ttm/backport/backport.h:12:0, from <command-line>:0: include/kcl/kcl_mm_types.h: In function 'vmf_insert_mixed': include/kcl/kcl_mm_types.h:41:8: error: implicit declaration of function 'vm_insert_mixed'; did you mean 'vmf_insert_mixed'? [-Werror=implicit-function-declaration] err = vm_insert_mixed(vma, addr, pfn_t_to_pfn(pfn)); ^~~~~~~~~~~~~~~ vmf_insert_mixed include/kcl/kcl_mm_types.h: At top level: include/kcl/kcl_mm_types.h:53:26: error: conflicting types for 'vmf_insert_pfn' static inline vm_fault_t vmf_insert_pfn(struct vm_area_struct *vma, ^~~~~~~~~~~~~~ In file included from include/drm/drm_vma_manager.h:27:0, from include/kcl/kcl_drm_vma_manager.h:8, from drivers/gpu/drm/ttm/backport/backport.h:5, from <command-line>:0: include/linux/mm.h:2583:12: note: previous declaration of 'vmf_insert_pfn' was here vm_fault_t vmf_insert_pfn(struct vm_area_struct *vma, unsigned long addr, ^~~~~~~~~~~~~~ In file included from drivers/gpu/drm/ttm/backport/backport.h:12:0, from <command-line>:0: include/kcl/kcl_mm_types.h: In function 'vmf_insert_pfn': include/kcl/kcl_mm_types.h:56:13: error: implicit declaration of function 'vm_insert_pfn'; did you mean 'vmf_insert_pfn'? [-Werror=implicit-function-declaration] int err = vm_insert_pfn(vma, addr, pfn); ^~~~~~~~~~~~~ vmf_insert_pfn drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_kmap_atomic_prot': >> drivers/gpu/drm/ttm/ttm_bo_util.c:265:57: error: 'KM_USER0' undeclared (first use in this function); did you mean 'SI_USER'? #define __kcl__kmap_atomic(__page) kmap_atomic(__page, KM_USER0) ^ drivers/gpu/drm/ttm/ttm_bo_util.c:303:10: note: in expansion of macro '__kcl__kmap_atomic' return __kcl__kmap_atomic(page); ^~~~~~~~~~~~~~~~~~ drivers/gpu/drm/ttm/ttm_bo_util.c:265:57: note: each undeclared identifier is reported only once for each function it appears in #define __kcl__kmap_atomic(__page) kmap_atomic(__page, KM_USER0) ^ drivers/gpu/drm/ttm/ttm_bo_util.c:303:10: note: in expansion of macro '__kcl__kmap_atomic' return __kcl__kmap_atomic(page); ^~~~~~~~~~~~~~~~~~ >> drivers/gpu/drm/ttm/ttm_bo_util.c:265:37: error: too many arguments to function 'kmap_atomic' #define __kcl__kmap_atomic(__page) kmap_atomic(__page, KM_USER0) ^ drivers/gpu/drm/ttm/ttm_bo_util.c:303:10: note: in expansion of macro '__kcl__kmap_atomic' return __kcl__kmap_atomic(page); ^~~~~~~~~~~~~~~~~~ In file included from include/drm/drmP.h:40:0, from include/kcl/kcl_drm.h:6, from drivers/gpu/drm/ttm/backport/backport.h:6, from <command-line>:0: include/linux/highmem.h:91:21: note: declared here static inline void *kmap_atomic(struct page *page) ^~~~~~~~~~~ >> drivers/gpu/drm/ttm/ttm_bo_util.c:305:43: error: macro "kmap_atomic_prot" passed 3 arguments, but takes just 2 return __ttm_kmap_atomic_prot(page, prot); ^ >> drivers/gpu/drm/ttm/ttm_bo_util.c:274:48: error: 'kmap_atomic_prot' undeclared (first use in this function); did you mean 'ttm_kmap_atomic_prot'? #define __ttm_kmap_atomic_prot(__page, __prot) kmap_atomic_prot(__page, KM_USER0, __prot) ^ drivers/gpu/drm/ttm/ttm_bo_util.c:305:10: note: in expansion of macro '__ttm_kmap_atomic_prot' return __ttm_kmap_atomic_prot(page, prot); ^~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_kunmap_atomic_prot': >> drivers/gpu/drm/ttm/ttm_bo_util.c:319:28: error: macro "kunmap_atomic" passed 2 arguments, but takes just 1 __kcl__kunmap_atomic(addr); ^ >> drivers/gpu/drm/ttm/ttm_bo_util.c:266:39: error: 'kunmap_atomic' undeclared (first use in this function); did you mean '__kunmap_atomic'? #define __kcl__kunmap_atomic(__addr) kunmap_atomic(__addr, KM_USER0) ^ drivers/gpu/drm/ttm/ttm_bo_util.c:319:3: note: in expansion of macro '__kcl__kunmap_atomic' __kcl__kunmap_atomic(addr); ^~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/ttm/ttm_bo_util.c:321:27: error: macro "kunmap_atomic" passed 2 arguments, but takes just 1 __ttm_kunmap_atomic(addr); ^ drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_kmap_atomic_prot': drivers/gpu/drm/ttm/ttm_bo_util.c:306:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ cc1: some warnings being treated as errors vim +265 drivers/gpu/drm/ttm/ttm_bo_util.c ba4e7d973dd09b Thomas Hellstrom 2009-06-10 263 f2d51786363ee2 Yifan Zhang 2019-08-20 264 #if !defined(HAVE_KMAP_ATOMIC_ONE_ARG) 0abf5b3276d4c7 Kevin Wang 2018-08-17 @265 #define __kcl__kmap_atomic(__page) kmap_atomic(__page, KM_USER0) 0abf5b3276d4c7 Kevin Wang 2018-08-17 @266 #define __kcl__kunmap_atomic(__addr) kunmap_atomic(__addr, KM_USER0) 0abf5b3276d4c7 Kevin Wang 2018-08-17 267 #else 0abf5b3276d4c7 Kevin Wang 2018-08-17 268 #define __kcl__kmap_atomic(__page) kmap_atomic(__page) 0abf5b3276d4c7 Kevin Wang 2018-08-17 269 #define __kcl__kunmap_atomic(__addr) kunmap_atomic(__addr) f2d51786363ee2 Yifan Zhang 2019-08-20 270 #endif f2d51786363ee2 Yifan Zhang 2019-08-20 271 f2d51786363ee2 Yifan Zhang 2019-08-20 272 #ifdef CONFIG_X86 f2d51786363ee2 Yifan Zhang 2019-08-20 273 #if !defined(HAVE_KMAP_ATOMIC_ONE_ARG) f2d51786363ee2 Yifan Zhang 2019-08-20 @274 #define __ttm_kmap_atomic_prot(__page, __prot) kmap_atomic_prot(__page, KM_USER0, __prot) f2d51786363ee2 Yifan Zhang 2019-08-20 275 #define __ttm_kunmap_atomic(__addr) kunmap_atomic(__addr, KM_USER0) f2d51786363ee2 Yifan Zhang 2019-08-20 276 #else 403c1826a45644 Thomas Hellstrom 2018-01-16 277 #define __ttm_kunmap_atomic(__addr) kunmap_atomic(__addr) f2d51786363ee2 Yifan Zhang 2019-08-20 278 #define __ttm_kmap_atomic_prot(__page, __prot) kmap_atomic_prot(__page, __prot) 0abf5b3276d4c7 Kevin Wang 2018-08-17 279 #endif 403c1826a45644 Thomas Hellstrom 2018-01-16 280 #else 403c1826a45644 Thomas Hellstrom 2018-01-16 281 #define __ttm_kmap_atomic_prot(__page, __prot) vmap(&__page, 1, 0, __prot) 403c1826a45644 Thomas Hellstrom 2018-01-16 282 #define __ttm_kunmap_atomic(__addr) vunmap(__addr) 403c1826a45644 Thomas Hellstrom 2018-01-16 283 #endif 403c1826a45644 Thomas Hellstrom 2018-01-16 284 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 285 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 286 /** 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 287 * ttm_kmap_atomic_prot - Efficient kernel map of a single page with 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 288 * specified page protection. 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 289 * 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 290 * @page: The page to map. 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 291 * @prot: The page protection. 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 292 * 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 293 * This function maps a TTM page using the kmap_atomic api if available, 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 294 * otherwise falls back to vmap. The user must make sure that the 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 295 * specified page does not have an aliased mapping with a different caching 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 296 * policy unless the architecture explicitly allows it. Also mapping and 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 297 * unmapping using this api must be correctly nested. Unmapping should 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 298 * occur in the reverse order of mapping. 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 299 */ 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 300 void *ttm_kmap_atomic_prot(struct page *page, pgprot_t prot) 403c1826a45644 Thomas Hellstrom 2018-01-16 301 { 403c1826a45644 Thomas Hellstrom 2018-01-16 302 if (pgprot_val(prot) == pgprot_val(PAGE_KERNEL)) 0abf5b3276d4c7 Kevin Wang 2018-08-17 @303 return __kcl__kmap_atomic(page); 403c1826a45644 Thomas Hellstrom 2018-01-16 304 else 403c1826a45644 Thomas Hellstrom 2018-01-16 @305 return __ttm_kmap_atomic_prot(page, prot); 403c1826a45644 Thomas Hellstrom 2018-01-16 306 } 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 307 EXPORT_SYMBOL(ttm_kmap_atomic_prot); 403c1826a45644 Thomas Hellstrom 2018-01-16 308 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 309 /** 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 310 * ttm_kunmap_atomic_prot - Unmap a page that was mapped using 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 311 * ttm_kmap_atomic_prot. 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 312 * 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 313 * @addr: The virtual address from the map. 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 314 * @prot: The page protection. 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 315 */ 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 316 void ttm_kunmap_atomic_prot(void *addr, pgprot_t prot) 403c1826a45644 Thomas Hellstrom 2018-01-16 317 { 403c1826a45644 Thomas Hellstrom 2018-01-16 318 if (pgprot_val(prot) == pgprot_val(PAGE_KERNEL)) 0abf5b3276d4c7 Kevin Wang 2018-08-17 @319 __kcl__kunmap_atomic(addr); 403c1826a45644 Thomas Hellstrom 2018-01-16 320 else 403c1826a45644 Thomas Hellstrom 2018-01-16 321 __ttm_kunmap_atomic(addr); 403c1826a45644 Thomas Hellstrom 2018-01-16 322 } 9c11fcf1a74d33 Thomas Hellstrom 2018-01-16 323 EXPORT_SYMBOL(ttm_kunmap_atomic_prot); 403c1826a45644 Thomas Hellstrom 2018-01-16 324 :::::: The code at line 265 was first introduced by commit :::::: 0abf5b3276d4c78556c09a4ef7d59898c3da363d drm/amdkcl: [RHEL 6] support kmap_atomic funciton for ttm module :::::: TO: Kevin Wang <Kevin1.Wang@xxxxxxx> :::::: CC: Chengming Gui <Jack.Gui@xxxxxxx> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip
_______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel