Hi Bas,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tegra-drm/drm/tegra/for-next]
[also build test ERROR on drm-tip/drm-tip linus/master v5.5-rc6 next-20200117]
[cannot apply to drm-exynos/exynos-drm-next drm-intel/for-linux-next 
drm/drm-next]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    
https://github.com/0day-ci/linux/commits/Bas-Nieuwenhuizen/drm-msm-Add-syncobj-support/20200118-033342
base:   git://anongit.freedesktop.org/tegra/linux.git drm/tegra/for-next
config: arm-defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0
reproduce:
        wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <l...@intel.com>

All error/warnings (new ones prefixed by >>):

   drivers/gpu/drm/msm/msm_gem_submit.c: In function 'msm_parse_post_deps':
>> drivers/gpu/drm/msm/msm_gem_submit.c:512:23: error: 'syncobj_desc' 
>> undeclared (first use in this function); did you mean 'syncobj_stride'?
      if (copy_from_user(&syncobj_desc,
                          ^~~~~~~~~~~~
                          syncobj_stride
   drivers/gpu/drm/msm/msm_gem_submit.c:512:23: note: each undeclared 
identifier is reported only once for each function it appears in
   In file included from include/linux/list.h:9:0,
                    from include/linux/preempt.h:11,
                    from include/linux/spinlock.h:51,
                    from include/linux/seqlock.h:36,
                    from include/linux/time.h:6,
                    from include/linux/ktime.h:24,
                    from include/linux/sync_file.h:17,
                    from drivers/gpu/drm/msm/msm_gem_submit.c:8:
>> include/linux/kernel.h:868:2: error: first argument to 
>> '__builtin_choose_expr' not a constant
     __builtin_choose_expr(__safe_cmp(x, y), \
     ^
   include/linux/kernel.h:877:19: note: in expansion of macro '__careful_cmp'
    #define min(x, y) __careful_cmp(x, y, <)
                      ^~~~~~~~~~~~~
>> drivers/gpu/drm/msm/msm_gem_submit.c:514:15: note: in expansion of macro 
>> 'min'
                  min(syncobj_stride, sizeof(syncobj_desc)))) {
                  ^~~

vim +512 drivers/gpu/drm/msm/msm_gem_submit.c

   491  
   492  static int msm_parse_post_deps(struct drm_device *dev,
   493                                 struct drm_file *file,
   494                                 uint64_t out_syncobjs_addr,
   495                                 uint32_t nr_out_syncobjs,
   496                                 uint32_t syncobj_stride,
   497                                 struct msm_submit_post_dep **post_deps)
   498  {
   499          int ret = 0;
   500          uint32_t i, j;
   501  
   502          *post_deps = kmalloc_array(nr_out_syncobjs, sizeof(**post_deps),
   503                                     GFP_KERNEL | __GFP_NOWARN | 
__GFP_NORETRY);
   504          if (!*post_deps) {
   505                  ret = -ENOMEM;
   506                  goto out_syncobjs;
   507          }
   508  
   509          for (i = 0; i < nr_out_syncobjs; ++i) {
   510                  uint64_t address = out_syncobjs_addr + i * 
syncobj_stride;
   511  
 > 512                  if (copy_from_user(&syncobj_desc,
   513                                     u64_to_user_ptr(address),
 > 514                                     min(syncobj_stride, 
 > sizeof(syncobj_desc)))) {
   515                          ret = -EFAULT;
   516                          goto out_syncobjs;
   517                  }
   518  
   519                  (*post_deps)[i].point = syncobj_desc.point;
   520                  (*post_deps)[i].chain = NULL;
   521  
   522                  if (syncobj_desc.flags) {
   523                          ret = -EINVAL;
   524                          break;
   525                  }
   526  
   527                  if (syncobj_desc.point) {
   528                          if (!drm_core_check_feature(dev,
   529                                                      
DRIVER_SYNCOBJ_TIMELINE)) {
   530                                  ret = -EOPNOTSUPP;
   531                                  break;
   532                          }
   533  
   534                          (*post_deps)[i].chain =
   535                                  kmalloc(sizeof(*(*post_deps)[i].chain),
   536                                          GFP_KERNEL);
   537                          if (!(*post_deps)[i].chain) {
   538                                  ret = -ENOMEM;
   539                                  break;
   540                          }
   541                  }
   542  
   543                  (*post_deps)[i].syncobj =
   544                          drm_syncobj_find(file, syncobj_desc.handle);
   545                  if (!(*post_deps)[i].syncobj) {
   546                          ret = -EINVAL;
   547                          break;
   548                  }
   549          }
   550  
   551          if (ret) {
   552                  for (j = 0; j <= i; ++j) {
   553                          kfree((*post_deps)[j].chain);
   554                          if ((*post_deps)[j].syncobj)
   555                                  
drm_syncobj_put((*post_deps)[j].syncobj);
   556                  }
   557  
   558                  kfree(*post_deps);
   559                  *post_deps = NULL;
   560          }
   561  
   562  out_syncobjs:
   563          return ret;
   564  }
   565  

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org Intel Corporation

Attachment: .config.gz
Description: application/gzip

_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

Reply via email to