[radeon-alex:amd-mainline-dkms-5.2 2082/3212] drivers/gpu/drm/ttm/ttm_bo_vm.c:427:2: warning: initialization from incompatible pointer type

kbuild test robot lkp at intel.com
Mon Dec 9 03:26:43 UTC 2019


tree:   git://people.freedesktop.org/~agd5f/linux.git amd-mainline-dkms-5.2
head:   d269e78d6ce76b6e78f9dad26f336745130b2bfa
commit: 3ba40228e28c15ca2dfec398cd7e5ebebdb5a9c2 [2082/3212] drm/amdkcl: Test whether vmf_insert_*() functions are available
config: x86_64-randconfig-a002-20191206 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.2-10+deb8u1) 4.9.2
reproduce:
        git checkout 3ba40228e28c15ca2dfec398cd7e5ebebdb5a9c2
        # 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 warnings (new ones prefixed by >>):

   In file included from include/linux/kobject.h:23:0,
                    from include/linux/device.h:16,
                    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: warning: passing argument 1 of 'atomic_read' from incompatible pointer type
     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 struct atomic_t *' but argument is of type 'const struct refcount_t *'
    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:2: error: implicit declaration of function 'vm_insert_mixed' [-Werror=implicit-function-declaration]
     err = vm_insert_mixed(vma, addr, pfn_t_to_pfn(pfn));
     ^
   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:3: error: implicit declaration of function 'vm_insert_pfn' [-Werror=implicit-function-declaration]
      int err = vm_insert_pfn(vma, addr, pfn);
      ^
   drivers/gpu/drm/ttm/ttm_bo_vm.c: At top level:
>> drivers/gpu/drm/ttm/ttm_bo_vm.c:427:2: warning: initialization from incompatible pointer type
     .fault = ttm_bo_vm_fault,
     ^
   drivers/gpu/drm/ttm/ttm_bo_vm.c:427:2: warning: (near initialization for 'ttm_bo_vm_ops.fault')
   cc1: some warnings being treated as errors

vim +427 drivers/gpu/drm/ttm/ttm_bo_vm.c

09ac4fcb3f255e Felix Kuehling   2017-07-13  425  
f0f37e2f77731b Alexey Dobriyan  2009-09-27  426  static const struct vm_operations_struct ttm_bo_vm_ops = {
ba4e7d973dd09b Thomas Hellstrom 2009-06-10 @427  	.fault = ttm_bo_vm_fault,
ba4e7d973dd09b Thomas Hellstrom 2009-06-10  428  	.open = ttm_bo_vm_open,
09ac4fcb3f255e Felix Kuehling   2017-07-13  429  	.close = ttm_bo_vm_close,
09ac4fcb3f255e Felix Kuehling   2017-07-13  430  	.access = ttm_bo_vm_access
ba4e7d973dd09b Thomas Hellstrom 2009-06-10  431  };
ba4e7d973dd09b Thomas Hellstrom 2009-06-10  432  

:::::: The code at line 427 was first introduced by commit
:::::: ba4e7d973dd09b66912ac4c0856add8b0703a997 drm: Add the TTM GPU memory manager subsystem.

:::::: TO: Thomas Hellstrom <thellstrom at vmware.com>
:::::: CC: Dave Airlie <airlied at redhat.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: 35341 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20191209/7241e957/attachment-0001.gz>


More information about the dri-devel mailing list