[PATCH v7 07/36] drm: exynos: use common helper for a scatterlist contiguity check

2020-06-19 Thread Marek Szyprowski
Use common helper for checking the contiguity of the imported dma-buf. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_gem.c | 23 +++ 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu

[PATCH v7 08/36] drm: exynos: fix common struct sg_table related issues

2020-06-19 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v7 00/36] DRM: fix struct sg_table nents vs. orig_nents misuse

2020-06-19 Thread Marek Szyprowski
DRM tree. Best regards, Marek Szyprowski References: [1] https://lkml.org/lkml/2020/3/27/555 [2] https://lkml.org/lkml/2020/3/29/65 [3] Documentation/DMA-API-HOWTO.txt [4] https://lore.kernel.org/linux-iommu/20200512121931.gd20...@lst.de/T/#ma18c958a48c3b241d5409517fa7d192eef87459b Chang

[PATCH v7 01/36] drm: prime: add common helper to check scatterlist contiguity

2020-06-19 Thread Marek Szyprowski
It is a common operation done by DRM drivers to check the contiguity of the DMA-mapped buffer described by a scatterlist in the sg_table object. Let's add a common helper for this operation. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/drm_gem_cma_helper.c | 23

[PATCH v7 04/36] drm: amdgpu: fix common struct sg_table related issues

2020-06-19 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 36/36] drm: xen: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
nents or orig_nents entries. This driver reports the number of the pages in the imported scatterlist, so it should refer to sg_table->orig_nents entry. Signed-off-by: Marek Szyprowski Acked-by: Oleksandr Andrushchenko --- drivers/gpu/drm/xen/xen_drm_front_gem.c | 2 +- 1 file changed, 1 insert

[PATCH v6 15/36] drm: omapdrm: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
nents or orig_nents entries. This driver checks for a buffer contiguity in DMA address space, so it should test sg_table->nents entry. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/omapdrm/omap_gem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/

[PATCH v6 28/36] staging: ion: remove dead code

2020-06-18 Thread Marek Szyprowski
ion_heap_pages_zero() function is not used at all, so remove it to simplify the ion_heap_sglist_zero() function later. Signed-off-by: Marek Szyprowski --- drivers/staging/android/ion/ion.h | 1 - drivers/staging/android/ion/ion_heap.c | 9 - 2 files changed, 10 deletions(-) diff

[PATCH v6 29/36] staging: ion: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 30/36] staging: tegra-vde: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 33/36] samples: vfio-mdev/mbochs: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
add missing call to dma_unmap_sgtable. Signed-off-by: Marek Szyprowski --- samples/vfio-mdev/mbochs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/vfio-mdev/mbochs.c b/samples/vfio-mdev/mbochs.c index 3cc5e5921682..e03068917273 100644 --- a/samples/vfio-mdev

[PATCH v6 23/36] drm: vmwgfx: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 31/36] misc: fastrpc: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 20/36] drm: tegra: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 35/36] videobuf2: use sgtable-based scatterlist wrappers

2020-06-18 Thread Marek Szyprowski
. Signed-off-by: Marek Szyprowski --- .../common/videobuf2/videobuf2-dma-contig.c | 41 --- .../media/common/videobuf2/videobuf2-dma-sg.c | 32 ++- .../common/videobuf2/videobuf2-vmalloc.c | 12 ++ 3 files changed, 34 insertions(+), 51 deletions(-) diff

[PATCH v6 18/36] drm: rockchip: use common helper for a scatterlist contiguity check

2020-06-18 Thread Marek Szyprowski
Use common helper for checking the contiguity of the imported dma-buf. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 19 +-- 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers

[PATCH v6 12/36] drm: mediatek: use common helper for extracting pages array

2020-06-18 Thread Marek Szyprowski
Use common helper for converting a sg_table object into struct page pointer array. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/mediatek/mtk_drm_gem.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm

[PATCH v6 07/36] drm: exynos: use common helper for a scatterlist contiguity check

2020-06-18 Thread Marek Szyprowski
Use common helper for checking the contiguity of the imported dma-buf. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_gem.c | 23 +++ 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu

[PATCH v6 03/36] drm: core: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 26/36] drm: rcar-du: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
returns zero or an error code, so adjust the return value check for the vsp1_du_map_sg() function. Signed-off-by: Marek Szyprowski Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 3 +-- drivers/media/platform/vsp1/vsp1_drm.c | 8 2 files changed, 5 insertions(+), 6

[PATCH v6 14/36] drm: omapdrm: use common helper for extracting pages array

2020-06-18 Thread Marek Szyprowski
Use common helper for converting a sg_table object into struct page pointer array. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/omapdrm/omap_gem.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm

[PATCH v6 32/36] rapidio: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 06/36] drm: etnaviv: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 08/36] drm: exynos: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 22/36] drm: virtio: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 27/36] dmabuf: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 10/36] drm: lima: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 34/36] media: pci: fix common ALSA DMA-mapping related codes

2020-06-18 Thread Marek Szyprowski
nts in turn holds the result of the dma_map_sg call as stated in include/linux/scatterlist.h. Adapt the code to obey those rules. Signed-off-by: Marek Szyprowski --- drivers/media/pci/cx23885/cx23885-alsa.c | 2 +- drivers/media/pci/cx25821/cx25821-alsa.c | 2 +- drivers/media/pci/cx88/cx88-als

[PATCH v6 09/36] drm: i915: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
rectly on the struct sg_table objects to the dmabuf related functions, so the other drivers, which might share buffers with i915 could rely on the properly set nents and orig_nents values. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 11 +++ drive

[PATCH v6 01/36] drm: prime: add common helper to check scatterlist contiguity

2020-06-18 Thread Marek Szyprowski
It is a common operation done by DRM drivers to check the contiguity of the DMA-mapped buffer described by a scatterlist in the sg_table object. Let's add a common helper for this operation. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/drm_gem_cma_helper.c | 23

[PATCH v6 13/36] drm: msm: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 21/36] drm: v3d: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 24/36] xen: gntdev: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 19/36] drm: rockchip: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 05/36] drm: armada: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 02/36] drm: prime: use sgtable iterators in drm_prime_sg_to_page_addr_arrays()

2020-06-18 Thread Marek Szyprowski
describing the old code is no longer needed. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/drm_prime.c | 47 +++-- 1 file changed, 14 insertions(+), 33 deletions(-) diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 0784969894c1

[PATCH v6 04/36] drm: amdgpu: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 17/36] drm: radeon: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 16/36] drm: panfrost: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 11/36] drm: mediatek: use common helper for a scatterlist contiguity check

2020-06-18 Thread Marek Szyprowski
Use common helper for checking the contiguity of the imported dma-buf and do this check before allocating resources, so the error path is simpler. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/mediatek/mtk_drm_gem.c | 28 ++ 1 file changed, 6 insertions(+), 22

[PATCH v6 25/36] drm: host1x: fix common struct sg_table related issues

2020-06-18 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v6 00/36] DRM: fix struct sg_table nents vs. orig_nents misuse

2020-06-18 Thread Marek Szyprowski
DRM tree. Best regards, Marek Szyprowski References: [1] https://lkml.org/lkml/2020/3/27/555 [2] https://lkml.org/lkml/2020/3/29/65 [3] Documentation/DMA-API-HOWTO.txt [4] https://lore.kernel.org/linux-iommu/20200512121931.gd20...@lst.de/T/#ma18c958a48c3b241d5409517fa7d192eef87459b Chang

Re: [PATCH 0/8] Convert the intel iommu driver to the dma-iommu api

2020-05-29 Thread Marek Szyprowski
fixed simply by > adjusting the __sgt_iter() function to do something more sensible. > (Better yet, if possible, ditch __sgt_iter() and use the common DRM > function that AMD uses). > > This would at least allow us to make progress with Tom's IOMMU-DMA patch > set and once that gets in, it will be harder for other drivers to make > the same mistake. Best regards -- Marek Szyprowski, PhD Samsung R Institute Poland ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v5 00/38] DRM: fix struct sg_table nents vs. orig_nents misuse

2020-05-26 Thread Marek Szyprowski
ly would take a lots of time because of the dependencies on the sgtable helpers and changes in the DRM core. Best regards -- Marek Szyprowski, PhD Samsung R Institute Poland ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists

[PATCH v5 39/38] drm: xen: fix common struct sg_table related issues

2020-05-22 Thread Marek Szyprowski
nents or orig_nents entries. This driver reports the number of the pages in the imported scatterlist, so it should refer to sg_table->orig_nents entry. Signed-off-by: Marek Szyprowski Acked-by: Oleksandr Andrushchenko --- For more information, see '[PATCH v5 00/38] DRM: fix struct sg_table ne

[PATCH] drm/exynos: Properly propagate return value in drm_iommu_attach_device()

2020-05-22 Thread Marek Szyprowski
Propagate the proper error codes from the called functions instead of unconditionally returning 0. Reported-by: kbuild test robot Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm

[PATCH] drm/exynos: Fix dma_parms allocation

2020-05-20 Thread Marek Szyprowski
Since commit 9495b7e92f71 ("driver core: platform: Initialize dma_parms for platform devices") driver core handles allocation of the dma_parms structure for platform device, so there is no need to manually allocate nor free it. Reported-by: Tomi Valkeinen Signed-off-by: Marek

[PATCH] drm/exynos: mixer: Fix enabling of the runtime power management

2020-05-14 Thread Marek Szyprowski
() call, what results in starting the driver operation without enabling the runtime power management. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_mixer.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu

[PATCH v5 30/38] dmabuf: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v5 16/38] drm: msm: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v5 09/38] drm: etnaviv: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v5 38/38] videobuf2: use sgtable-based scatterlist wrappers

2020-05-13 Thread Marek Szyprowski
. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v5 00/38] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lore.kernel.org/linux-iommu/20200513132114.6046-1-m.szyprow...@samsung.com/T/ --- .../media/common/videobuf2/videobuf2-dma-contig.c | 41

[PATCH v5 05/38] drm: prime: use sgtable iterators in drm_prime_sg_to_page_addr_arrays()

2020-05-13 Thread Marek Szyprowski
describing the old code is no longer needed. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v5 00/38] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lore.kernel.org/linux-iommu/20200513132114.6046-1-m.szyprow...@samsung.com/T/ --- drivers/gpu/drm

[PATCH v5 12/38] drm: i915: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
rectly on the struct sg_table objects to the dmabuf related functions, so the other drivers, which might share buffers with i915 could rely on the properly set nents and orig_nents values. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v5 00/38] DRM: fix struct sg_table ne

[PATCH v5 10/38] drm: exynos: use common helper for a scatterlist contiguity check

2020-05-13 Thread Marek Szyprowski
Use common helper for checking the contiguity of the imported dma-buf. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v5 00/38] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lore.kernel.org/linux-iommu/20200513132114.6046-1-m.szyprow...@samsung.com

[PATCH v5 29/38] drm: rcar-du: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
returns zero or an error code, so adjust the return value check for the vsp1_du_map_sg() function. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v5 00/38] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lore.kernel.org/linux-iommu/20200513132114.6046-1

[PATCH v5 13/38] drm: lima: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v5 08/38] drm: armada: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v5 11/38] drm: exynos: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v5 15/38] drm: mediatek: use common helper for extracting pages array

2020-05-13 Thread Marek Szyprowski
Use common helper for converting a sg_table object into struct page pointer array. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v5 00/38] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lore.kernel.org/linux-iommu/20200513132114.6046-1-m.szyprow

[PATCH v5 20/38] drm: radeon: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v5 21/38] drm: rockchip: use common helper for a scatterlist contiguity check

2020-05-13 Thread Marek Szyprowski
Use common helper for checking the contiguity of the imported dma-buf. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v5 00/38] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lore.kernel.org/linux-iommu/20200513132114.6046-1-m.szyprow...@samsung.com

[PATCH v5 25/38] drm: virtio: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v5 18/38] drm: omapdrm: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
nents or orig_nents entries. This driver checks for a buffer contiguity in DMA address space, so it should test sg_table->nents entry. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v5 00/38] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: ht

[PATCH v5 24/38] drm: v3d: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v5 19/38] drm: panfrost: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v5 14/38] drm: mediatek: use common helper for a scatterlist contiguity check

2020-05-13 Thread Marek Szyprowski
Use common helper for checking the contiguity of the imported dma-buf and do this check before allocating resources, so the error path is simpler. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v5 00/38] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https

[PATCH v5 26/38] drm: vmwgfx: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v5 28/38] drm: host1x: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v5 36/38] samples: vfio-mdev/mbochs: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
add missing call to dma_unmap_sgtable. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v5 00/38] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lore.kernel.org/linux-iommu/20200513132114.6046-1-m.szyprow...@samsung.com/T/ --- samples/vfio-mdev/mbochs.c

[PATCH v5 37/38] media: pci: fix common ALSA DMA-mapping related codes

2020-05-13 Thread Marek Szyprowski
nts in turn holds the result of the dma_map_sg call as stated in include/linux/scatterlist.h. Adapt the code to obey those rules. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v5 00/38] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lore.kernel.org/li

[PATCH v5 34/38] misc: fastrpc: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v5 17/38] drm: omapdrm: use common helper for extracting pages array

2020-05-13 Thread Marek Szyprowski
Use common helper for converting a sg_table object into struct page pointer array. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v5 00/38] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lore.kernel.org/linux-iommu/20200513132114.6046-1-m.szyprow

[PATCH v5 23/38] drm: tegra: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v5 06/38] drm: core: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v5 22/38] drm: rockchip: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v5 31/38] staging: ion: remove dead code

2020-05-13 Thread Marek Szyprowski
ion_heap_pages_zero() function is not used at all, so remove it to simplify the ion_heap_sglist_zero() function later. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v5 00/38] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lore.kernel.org/linux-iommu

[PATCH v5 07/38] drm: amdgpu: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v5 32/38] staging: ion: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v5 35/38] rapidio: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v5 27/38] xen: gntdev: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v5 33/38] staging: tegra-vde: fix common struct sg_table related issues

2020-05-13 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v5 01/38] dma-mapping: add generic helpers for mapping sgtable objects

2020-05-13 Thread Marek Szyprowski
, which take care of the proper use of the nents and orig_nents entries. Signed-off-by: Marek Szyprowski Reviewed-by: Christoph Hellwig Reviewed-by: Robin Murphy --- For more information, see '[PATCH v5 00/38] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lore.kernel.org

[PATCH v5 02/38] scatterlist: add generic wrappers for iterating over sgtable objects

2020-05-13 Thread Marek Szyprowski
entries. While touching this, lets clarify some ambiguities in the comments for the existing for_each helpers. Signed-off-by: Marek Szyprowski Reviewed-by: Christoph Hellwig Reviewed-by: Robin Murphy --- For more information, see '[PATCH v5 00/38] DRM: fix struct sg_table nents vs. orig_nents

[PATCH v5 03/38] iommu: add generic helper for mapping sgtable objects

2020-05-13 Thread Marek Szyprowski
-by: Marek Szyprowski Reviewed-by: Christoph Hellwig Acked-by: Joerg Roedel Reviewed-by: Robin Murphy --- For more information, see '[PATCH v5 00/38] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lore.kernel.org/linux-iommu/20200513132114.6046-1-m.szyprow...@samsung.com/T

[PATCH v5 04/38] drm: prime: add common helper to check scatterlist contiguity

2020-05-13 Thread Marek Szyprowski
It is a common operation done by DRM drivers to check the contiguity of the DMA-mapped buffer described by a scatterlist in the sg_table object. Let's add a common helper for this operation. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v5 00/38] DRM: fix struct sg_table

[PATCH v5 00/38] DRM: fix struct sg_table nents vs. orig_nents misuse

2020-05-13 Thread Marek Szyprowski
tches via DRM tree (on top of that immutable branch). Best regards, Marek Szyprowski References: [1] https://lkml.org/lkml/2020/3/27/555 [2] https://lkml.org/lkml/2020/3/29/65 [3] Documentation/DMA-API-HOWTO.txt [4] https://lore.kernel.org/linux-iommu/20200512121931.gd20...

Re: [PATCH v4 38/38] videobuf2: use sgtable-based scatterlist wrappers

2020-05-12 Thread Marek Szyprowski
Hi Michael, On 12.05.2020 19:52, Ruhl, Michael J wrote: >> -Original Message- >> From: dri-devel On Behalf Of >> Marek Szyprowski >> Sent: Tuesday, May 12, 2020 5:01 AM >> To: dri-devel@lists.freedesktop.org; io...@lists.linux-foundation.org; >> linar

Re: [PATCH v4 01/38] dma-mapping: add generic helpers for mapping sgtable objects

2020-05-12 Thread Marek Szyprowski
Hi Christoph, On 12.05.2020 15:09, Christoph Hellwig wrote: > On Tue, May 12, 2020 at 03:00:31PM +0200, Marek Szyprowski wrote: >>> if (n <= 0) >>> return -EINVAL; >>> sgt->nents = n; >>> return 0; >>> >> Inde

Re: [PATCH v4 01/38] dma-mapping: add generic helpers for mapping sgtable objects

2020-05-12 Thread Marek Szyprowski
Hi Christoph, On 12.05.2020 14:18, Christoph Hellwig wrote: > On Tue, May 12, 2020 at 11:00:21AM +0200, Marek Szyprowski wrote: >> struct sg_table is a common structure used for describing a memory >> buffer. It consists of a scatterlist with memory pages and DMA addresses >>

[PATCH v4 14/38] drm: mediatek: use common helper for a scatterlist contiguity check

2020-05-12 Thread Marek Szyprowski
Use common helper for checking the contiguity of the imported dma-buf and do this check before allocating resources, so the error path is simpler. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v4 00/38] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https

[PATCH v4 19/38] drm: panfrost: fix common struct sg_table related issues

2020-05-12 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v4 08/38] drm: armada: fix common struct sg_table related issues

2020-05-12 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v4 33/38] staging: tegra-vde: fix common struct sg_table related issues

2020-05-12 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v4 37/38] media: pci: fix common ALSA DMA-mapping related codes

2020-05-12 Thread Marek Szyprowski
nts in turn holds the result of the dma_map_sg call as stated in include/linux/scatterlist.h. Adapt the code to obey those rules. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v4 00/38] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lore.kernel.org/

[PATCH v4 18/38] drm: omapdrm: fix common struct sg_table related issues

2020-05-12 Thread Marek Szyprowski
nents or orig_nents entries. This driver checks for a buffer contiguity in DMA address space, so it should test sg_table->nents entry. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v4 00/38] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: ht

Re: [PATCH v3 02/25] drm: core: fix common struct sg_table related issues

2020-05-12 Thread Marek Szyprowski
Hi Christoph, On 08.05.2020 09:16, Christoph Hellwig wrote: > On Fri, May 08, 2020 at 09:12:13AM +0200, Marek Szyprowski wrote: >> Then we would just need one more helper to construct scatterlist, as the >> above two are read-only don't allow to modify scatterlist

[PATCH v4 30/38] dmabuf: fix common struct sg_table related issues

2020-05-12 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v4 28/38] drm: host1x: fix common struct sg_table related issues

2020-05-12 Thread Marek Szyprowski
a common dma-mapping wrappers operating directly on the struct sg_table objects and use scatterlist page iterators where possible. This, almost always, hides references to the nents and orig_nents entries, making the code robust, easier to follow and copy/paste safe. Signed-off-by: Marek Szyprowski

[PATCH v4 36/38] samples: vfio-mdev/mbochs: fix common struct sg_table related issues

2020-05-12 Thread Marek Szyprowski
add missing call to dma_unmap_sgtable. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v4 00/38] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lore.kernel.org/dri-devel/20200512085710.14688-1-m.szyprow...@samsung.com/T/ --- samples/vfio-mdev/mbochs.c

<    1   2   3   4   5   6   7   8   9   10   >