[PATCH] drm/exynos: Fix dma_parms allocation

kbuild test robot lkp at intel.com
Wed May 20 21:04:25 UTC 2020


Hi Marek,

I love your patch! Perhaps something to improve:

[auto build test WARNING on drm-exynos/exynos-drm-next]
[also build test WARNING on drm-intel/for-linux-next tegra-drm/drm/tegra/for-next v5.7-rc6 next-20200519]
[cannot apply to 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/Marek-Szyprowski/drm-exynos-Fix-dma_parms-allocation/20200521-015443
base:   https://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git exynos-drm-next
config: alpha-allyesconfig (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.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
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp at intel.com>

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

drivers/gpu/drm/exynos/exynos_drm_dma.c: In function 'drm_iommu_attach_device':
>> drivers/gpu/drm/exynos/exynos_drm_dma.c:47:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
47 |  int ret;
|      ^~~

vim +/ret +47 drivers/gpu/drm/exynos/exynos_drm_dma.c

67fbf3a3ef84436c Andrzej Hajda    2018-10-12  33  
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  34  /*
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  35   * drm_iommu_attach_device- attach device to iommu mapping
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  36   *
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  37   * @drm_dev: DRM device
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  38   * @subdrv_dev: device to be attach
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  39   *
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  40   * This function should be called by sub drivers to attach it to iommu
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  41   * mapping.
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  42   */
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  43  static int drm_iommu_attach_device(struct drm_device *drm_dev,
07dc3678bacc2a75 Marek Szyprowski 2020-03-09  44  				struct device *subdrv_dev, void **dma_priv)
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  45  {
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  46  	struct exynos_drm_private *priv = drm_dev->dev_private;
67fbf3a3ef84436c Andrzej Hajda    2018-10-12 @47  	int ret;
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  48  
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  49  	if (get_dma_ops(priv->dma_dev) != get_dma_ops(subdrv_dev)) {
6f83d20838c09936 Inki Dae         2019-04-15  50  		DRM_DEV_ERROR(subdrv_dev, "Device %s lacks support for IOMMU\n",
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  51  			  dev_name(subdrv_dev));
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  52  		return -EINVAL;
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  53  	}
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  54  
1698f69d5f384fad Marek Szyprowski 2020-05-20  55  	dma_set_max_seg_size(subdrv_dev, DMA_BIT_MASK(32));
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  56  	if (IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU)) {
07dc3678bacc2a75 Marek Szyprowski 2020-03-09  57  		/*
07dc3678bacc2a75 Marek Szyprowski 2020-03-09  58  		 * Keep the original DMA mapping of the sub-device and
07dc3678bacc2a75 Marek Szyprowski 2020-03-09  59  		 * restore it on Exynos DRM detach, otherwise the DMA
07dc3678bacc2a75 Marek Szyprowski 2020-03-09  60  		 * framework considers it as IOMMU-less during the next
07dc3678bacc2a75 Marek Szyprowski 2020-03-09  61  		 * probe (in case of deferred probe or modular build)
07dc3678bacc2a75 Marek Szyprowski 2020-03-09  62  		 */
07dc3678bacc2a75 Marek Szyprowski 2020-03-09  63  		*dma_priv = to_dma_iommu_mapping(subdrv_dev);
07dc3678bacc2a75 Marek Szyprowski 2020-03-09  64  		if (*dma_priv)
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  65  			arm_iommu_detach_device(subdrv_dev);
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  66  
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  67  		ret = arm_iommu_attach_device(subdrv_dev, priv->mapping);
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  68  	} else if (IS_ENABLED(CONFIG_IOMMU_DMA)) {
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  69  		ret = iommu_attach_device(priv->mapping, subdrv_dev);
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  70  	}
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  71  
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  72  	return 0;
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  73  }
67fbf3a3ef84436c Andrzej Hajda    2018-10-12  74  

:::::: The code at line 47 was first introduced by commit
:::::: 67fbf3a3ef84436c58b5ead53b4b866125ad7ce9 drm/exynos/iommu: merge IOMMU and DMA code

:::::: TO: Andrzej Hajda <a.hajda at samsung.com>
:::::: CC: Inki Dae <inki.dae at samsung.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 61434 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20200521/3e902bcd/attachment-0001.gz>


More information about the dri-devel mailing list