Re: [PATCH] iommu: Check for deferred attach in iommu_group_do_dma_attach()

From: kernel test robot
Date: Thu Jun 04 2020 - 08:38:09 EST


Hi Joerg,

I love your patch! Yet something to improve:

[auto build test ERROR on iommu/next]
[also build test ERROR on next-20200604]
[cannot apply to v5.7]
[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/Joerg-Roedel/iommu-Check-for-deferred-attach-in-iommu_group_do_dma_attach/20200604-172315
base: https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next
config: arm-randconfig-s032-20200604 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-244-g0ee050a8-dirty
# save the attached .config to linux build tree
make W=1 C=1 ARCH=arm CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>, old ones prefixed by <<):

drivers/iommu/iommu.c:386:5: warning: no previous prototype for 'iommu_insert_resv_region' [-Wmissing-prototypes]
386 | int iommu_insert_resv_region(struct iommu_resv_region *new,
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/iommu/iommu.c: In function 'iommu_group_do_dma_attach':
>> drivers/iommu/iommu.c:1685:32: error: 'group' undeclared (first use in this function); did you mean 'cgroup'?
1685 | if (!iommu_is_attach_deferred(group->domain, dev))
| ^~~~~
| cgroup
drivers/iommu/iommu.c:1685:32: note: each undeclared identifier is reported only once for each function it appears in
drivers/iommu/iommu.c:1682:23: warning: unused variable 'domain' [-Wunused-variable]
1682 | struct iommu_domain *domain = data;
| ^~~~~~
drivers/iommu/iommu.c: At top level:
drivers/iommu/iommu.c:2171:5: warning: no previous prototype for '__iommu_map' [-Wmissing-prototypes]
2171 | int __iommu_map(struct iommu_domain *domain, unsigned long iova,
| ^~~~~~~~~~~
drivers/iommu/iommu.c:2322:8: warning: no previous prototype for '__iommu_map_sg' [-Wmissing-prototypes]
2322 | size_t __iommu_map_sg(struct iommu_domain *domain, unsigned long iova,
| ^~~~~~~~~~~~~~

vim +1685 drivers/iommu/iommu.c

1679
1680 static int iommu_group_do_dma_attach(struct device *dev, void *data)
1681 {
1682 struct iommu_domain *domain = data;
1683 int ret = 0;
1684
> 1685 if (!iommu_is_attach_deferred(group->domain, dev))
1686 ret = __iommu_attach_device(group->domain, dev);
1687
1688 return ret;
1689 }
1690

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip