[radeon-alex:amd-19.50 2129/2680] drivers/gpu/drm/ttm/ttm_bo_util.c:305:43: error: macro "kmap_atomic_prot" passed 3 arguments, but takes just 2

kbuild test robot lkp at intel.com
Wed Jan 8 06:16:16 UTC 2020


Hi Yifan,

FYI, the error/warning still remains.

tree:   git://people.freedesktop.org/~agd5f/linux.git amd-19.50
head:   f981f76437edab0861f3721c27f1c3cec5903dcc
commit: f2d51786363ee2a72c55570835e4c79066af2782 [2129/2680] drm/amdkcl: Test whether kmap_atomic() wants one argument
config: x86_64-randconfig-h003-20200107 (attached as .config)
compiler: gcc-7 (Debian 7.5.0-3) 7.5.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 at intel.com>

All errors (new ones prefixed by >>):

    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 +/kmap_atomic_prot +305 drivers/gpu/drm/ttm/ttm_bo_util.c

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  

:::::: The code at line 305 was first introduced by commit
:::::: 403c1826a456441ee983acefbd03ce7d73d1ff00 drm/ttm: Clean up kmap_atomic_prot selection code

:::::: TO: Thomas Hellstrom <thellstrom at vmware.com>
:::::: CC: Thomas Hellstrom <thellstrom at vmware.com>

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


More information about the dri-devel mailing list