Linux IOMMU Development
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Marek Szyprowski <m.szyprowski@samsung.com>,
	dri-devel@lists.freedesktop.org,
	iommu@lists.linux-foundation.org, linaro-mm-sig@lists.linaro.org,
	linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	David Airlie <airlied@linux.ie>,
	Roland Scheidegger <sroland@vmware.com>,
	VMware Graphics <linux-graphics-maintainer@vmware.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v6 23/36] drm: vmwgfx: fix common struct sg_table related issues
Date: Fri, 19 Jun 2020 12:59:46 +0800	[thread overview]
Message-ID: <202006191203.FBjd0U6D%lkp@intel.com> (raw)
In-Reply-To: <20200618153956.29558-24-m.szyprowski@samsung.com>

[-- Attachment #1: Type: text/plain, Size: 4902 bytes --]

Hi Marek,

I love your patch! Yet something to improve:

[auto build test ERROR on next-20200618]
[also build test ERROR on v5.8-rc1]
[cannot apply to linuxtv-media/master staging/staging-testing drm-exynos/exynos-drm-next drm-intel/for-linux-next linus/master v5.8-rc1 v5.7 v5.7-rc7]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use  as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Marek-Szyprowski/DRM-fix-struct-sg_table-nents-vs-orig_nents-misuse/20200619-000417
base:    ce2cc8efd7a40cbd17841add878cb691d0ce0bba
config: x86_64-rhel-7.6 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce (this is a W=1 build):
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

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

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

   drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c: In function 'vmw_ttm_unmap_from_dma':
>> drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c:365:31: error: incompatible type for argument 2 of 'dma_unmap_sgtable'
     365 |  dma_unmap_sgtable(dev, vmw_tt->sgt, DMA_BIDIRECTIONAL, 0);
         |                         ~~~~~~^~~~~
         |                               |
         |                               struct sg_table
   In file included from include/linux/dma-buf.h:20,
                    from drivers/gpu/drm/vmwgfx/ttm_object.h:40,
                    from drivers/gpu/drm/vmwgfx/ttm_lock.h:55,
                    from drivers/gpu/drm/vmwgfx/vmwgfx_drv.h:44,
                    from drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c:28:
   include/linux/dma-mapping.h:651:75: note: expected 'struct sg_table *' but argument is of type 'struct sg_table'
     651 | static inline void dma_unmap_sgtable(struct device *dev, struct sg_table *sgt,
         |                                                          ~~~~~~~~~~~~~~~~~^~~
   drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c: In function 'vmw_ttm_map_for_dma':
>> drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c:386:36: error: incompatible type for argument 2 of 'dma_map_sgtable'
     386 |  return dma_map_sgtable(dev, vmw_tt->sgt, DMA_BIDIRECTIONAL, 0);
         |                              ~~~~~~^~~~~
         |                                    |
         |                                    struct sg_table
   In file included from include/linux/dma-buf.h:20,
                    from drivers/gpu/drm/vmwgfx/ttm_object.h:40,
                    from drivers/gpu/drm/vmwgfx/ttm_lock.h:55,
                    from drivers/gpu/drm/vmwgfx/vmwgfx_drv.h:44,
                    from drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c:28:
   include/linux/dma-mapping.h:628:72: note: expected 'struct sg_table *' but argument is of type 'struct sg_table'
     628 | static inline int dma_map_sgtable(struct device *dev, struct sg_table *sgt,
         |                                                       ~~~~~~~~~~~~~~~~~^~~
>> drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c:387:1: warning: control reaches end of non-void function [-Wreturn-type]
     387 | }
         | ^

vim +/dma_unmap_sgtable +365 drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c

   352	
   353	/**
   354	 * vmw_ttm_unmap_from_dma - unmap  device addresses previsouly mapped for
   355	 * TTM pages
   356	 *
   357	 * @vmw_tt: Pointer to a struct vmw_ttm_backend
   358	 *
   359	 * Used to free dma mappings previously mapped by vmw_ttm_map_for_dma.
   360	 */
   361	static void vmw_ttm_unmap_from_dma(struct vmw_ttm_tt *vmw_tt)
   362	{
   363		struct device *dev = vmw_tt->dev_priv->dev->dev;
   364	
 > 365		dma_unmap_sgtable(dev, vmw_tt->sgt, DMA_BIDIRECTIONAL, 0);
   366		vmw_tt->sgt.nents = vmw_tt->sgt.orig_nents;
   367	}
   368	
   369	/**
   370	 * vmw_ttm_map_for_dma - map TTM pages to get device addresses
   371	 *
   372	 * @vmw_tt: Pointer to a struct vmw_ttm_backend
   373	 *
   374	 * This function is used to get device addresses from the kernel DMA layer.
   375	 * However, it's violating the DMA API in that when this operation has been
   376	 * performed, it's illegal for the CPU to write to the pages without first
   377	 * unmapping the DMA mappings, or calling dma_sync_sg_for_cpu(). It is
   378	 * therefore only legal to call this function if we know that the function
   379	 * dma_sync_sg_for_cpu() is a NOP, and dma_sync_sg_for_device() is at most
   380	 * a CPU write buffer flush.
   381	 */
   382	static int vmw_ttm_map_for_dma(struct vmw_ttm_tt *vmw_tt)
   383	{
   384		struct device *dev = vmw_tt->dev_priv->dev->dev;
   385	
 > 386		return dma_map_sgtable(dev, vmw_tt->sgt, DMA_BIDIRECTIONAL, 0);
 > 387	}
   388	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 49274 bytes --]

[-- Attachment #3: Type: text/plain, Size: 156 bytes --]

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  parent reply	other threads:[~2020-06-19  5:00 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200618154014eucas1p236960ab27d628f94d68a6b8ddb8b07ff@eucas1p2.samsung.com>
2020-06-18 15:39 ` [PATCH v6 00/36] DRM: fix struct sg_table nents vs. orig_nents misuse Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 01/36] drm: prime: add common helper to check scatterlist contiguity Marek Szyprowski
2020-06-18 16:07     ` Robin Murphy
2020-06-18 15:39   ` [PATCH v6 02/36] drm: prime: use sgtable iterators in drm_prime_sg_to_page_addr_arrays() Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 03/36] drm: core: fix common struct sg_table related issues Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 04/36] drm: amdgpu: " Marek Szyprowski
2020-06-18 21:32     ` kernel test robot
2020-06-18 15:39   ` [PATCH v6 05/36] drm: armada: " Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 06/36] drm: etnaviv: " Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 07/36] drm: exynos: use common helper for a scatterlist contiguity check Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 08/36] drm: exynos: fix common struct sg_table related issues Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 09/36] drm: i915: " Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 10/36] drm: lima: " Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 11/36] drm: mediatek: use common helper for a scatterlist contiguity check Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 12/36] drm: mediatek: use common helper for extracting pages array Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 13/36] drm: msm: fix common struct sg_table related issues Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 14/36] drm: omapdrm: use common helper for extracting pages array Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 15/36] drm: omapdrm: fix common struct sg_table related issues Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 16/36] drm: panfrost: " Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 17/36] drm: radeon: " Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 18/36] drm: rockchip: use common helper for a scatterlist contiguity check Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 19/36] drm: rockchip: fix common struct sg_table related issues Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 20/36] drm: tegra: " Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 21/36] drm: v3d: " Marek Szyprowski
2020-06-18 22:28     ` kernel test robot
2020-06-18 15:39   ` [PATCH v6 22/36] drm: virtio: " Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 23/36] drm: vmwgfx: " Marek Szyprowski
2020-06-19  3:05     ` kernel test robot
2020-06-19  4:59     ` kernel test robot [this message]
2020-06-18 15:39   ` [PATCH v6 24/36] xen: gntdev: " Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 25/36] drm: host1x: " Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 26/36] drm: rcar-du: " Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 27/36] dmabuf: " Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 28/36] staging: ion: remove dead code Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 29/36] staging: ion: fix common struct sg_table related issues Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 30/36] staging: tegra-vde: " Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 31/36] misc: fastrpc: " Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 32/36] rapidio: " Marek Szyprowski
2020-06-18 23:39     ` kernel test robot
2020-06-18 15:39   ` [PATCH v6 33/36] samples: vfio-mdev/mbochs: " Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 34/36] media: pci: fix common ALSA DMA-mapping related codes Marek Szyprowski
2020-06-18 15:39   ` [PATCH v6 35/36] videobuf2: use sgtable-based scatterlist wrappers Marek Szyprowski
2020-06-19  0:34     ` kernel test robot
2020-06-19  9:43     ` Robin Murphy
2020-06-18 16:01   ` [PATCH v6 36/36] drm: xen: fix common struct sg_table related issues Marek Szyprowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202006191203.FBjd0U6D%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=airlied@linux.ie \
    --cc=b.zolnierkie@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-graphics-maintainer@vmware.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=robin.murphy@arm.com \
    --cc=sroland@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox