Re: [Linaro-mm-sig] [PATCH v5 05/38] drm: prime: use sgtable iterators in drm_prime_sg_to_page_addr_arrays()

2020-09-30 Thread Marek Szyprowski
Hi All, On 25.09.2020 23:23, Alex Deucher wrote: > On Tue, Sep 22, 2020 at 2:28 AM Marek Szyprowski > wrote: >> On 22.09.2020 01:15, Alex Goins wrote: >>> Tested-by: Alex Goins >>> >>> This change fixes a regression with drm_prime_sg_to_page_addr_arr

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

2020-09-22 Thread Marek Szyprowski
nflict in the -next. Do you have any AMDGPU fixes for v5.9 in the queue? Maybe you can add that patch to the queue? Dave: would it be okay that way? Best regards -- Marek Szyprowski, PhD Samsung R Institute Poland ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: IOVA allocation dependency between firmware buffer and remaining buffers

2020-09-24 Thread Marek Szyprowski
Hi Thierry, On 24.09.2020 12:16, Thierry Reding wrote: > On Thu, Sep 24, 2020 at 10:46:46AM +0200, Marek Szyprowski wrote: >> On 24.09.2020 10:28, Joerg Roedel wrote: >>> On Wed, Sep 23, 2020 at 08:48:26AM +0200, Marek Szyprowski wrote: >>>> It allows to remap giv

Re: IOVA allocation dependency between firmware buffer and remaining buffers

2020-09-24 Thread Marek Szyprowski
Hi Robin, On 24.09.2020 12:40, Robin Murphy wrote: > On 2020-09-24 11:16, Thierry Reding wrote: >> On Thu, Sep 24, 2020 at 10:46:46AM +0200, Marek Szyprowski wrote: >>> On 24.09.2020 10:28, Joerg Roedel wrote: >>>> On Wed, Sep 23, 2020 at 08:48:26AM +0200, Marek Szy

Re: IOVA allocation dependency between firmware buffer and remaining buffers

2020-09-24 Thread Marek Szyprowski
Hi Joerg, On 24.09.2020 10:28, Joerg Roedel wrote: > On Wed, Sep 23, 2020 at 08:48:26AM +0200, Marek Szyprowski wrote: >> It allows to remap given buffer at the specific IOVA address, although >> it doesn't guarantee that those specific addresses won't be later used >>

[PATCH 2/8] iommu: iova: properly handle 0 as a valid IOVA address

2020-09-25 Thread Marek Szyprowski
-by: Marek Szyprowski --- drivers/iommu/dma-iommu.c | 18 ++ drivers/iommu/intel/iommu.c | 12 ++-- drivers/iommu/iova.c| 10 ++ include/linux/iova.h| 2 ++ 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/drivers/iommu/dma-iommu.c b

[PATCH 1/8] dma-mapping: add DMA_ATTR_LOW_ADDRESS attribute

2020-09-25 Thread Marek Szyprowski
be easily fulfilled, simply by enforcing the 'first-fit' IOVA allocation algorithm. This patch adds a DMA attribute for such case. Signed-off-by: Marek Szyprowski --- include/linux/dma-mapping.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/dma-mapping.h b/include

[PATCH 3/8] iommu: iova: add support for 'first-fit' algorithm

2020-09-25 Thread Marek Szyprowski
Add support for the 'first-fit' allocation algorithm. It will be used for the special case of implementing DMA_ATTR_LOW_ADDRESS, so this path doesn't use IOVA cache. Signed-off-by: Marek Szyprowski --- drivers/iommu/iova.c | 78 include/linux/iova.h

[PATCH 0/8] IOMMU-DMA - support old allocation algorithm used on ARM

2020-09-25 Thread Marek Szyprowski
Best regards, Marek Szyprowski References: [1] https://lore.kernel.org/lkml/cover.1597931875.git.robin.mur...@arm.com/ [2] https://lore.kernel.org/linux-iommu/bff57cbe-2247-05e1-9059-d9c66d64c...@arm.com/ [3] https://lore.kernel.org/linux-samsung-soc/20200918144833.14618-1-m.szyprow

[PATCH 4/8] iommu: dma-iommu: refactor iommu_dma_alloc_iova()

2020-09-25 Thread Marek Szyprowski
list, move struct device to the second position to better match the convention of the DMA-mapping related functions. Signed-off-by: Marek Szyprowski --- drivers/iommu/dma-iommu.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/iommu/dma

[PATCH 5/8] iommu: dma-iommu: add support for DMA_ATTR_LOW_ADDRESS

2020-09-25 Thread Marek Szyprowski
Implement support for the DMA_ATTR_LOW_ADDRESS DMA attribute. If it has been set, call alloc_iova_first_fit() instead of the alloc_iova_fast() to allocate the new IOVA from the beginning of the address space. Signed-off-by: Marek Szyprowski --- drivers/iommu/dma-iommu.c | 50

[PATCH 6/8] media: platform: exynos4-is: remove all references to physicall addresses

2020-09-25 Thread Marek Szyprowski
This driver always operates on the DMA/IOVA addresses, so calling them physicall addresses is misleading, although when no IOMMU is used they equal each other. Fix this by renaming all such entries to 'addr' and adjusting comments. Signed-off-by: Marek Szyprowski --- .../media/platform/exynos4

[PATCH 8/8] media: platform: s5p-mfc: use DMA_ATTR_LOW_ADDRESS

2020-09-25 Thread Marek Szyprowski
soon, so limit the dma_mask to size of the DMA window the hardware can use and add the needed DMA attribute to force proper IOVA allocation of the firmware buffer. Signed-off-by: Marek Szyprowski --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions

[PATCH 7/8] media: platform: exynos4-is: use DMA_ATTR_LOW_ADDRESS

2020-09-25 Thread Marek Szyprowski
soon, so add the needed DMA attribute to force such behavior of the DMA-mapping code. Signed-off-by: Marek Szyprowski --- drivers/media/platform/exynos4-is/fimc-is.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/exynos4-is/fimc-is.c b/drivers

Re: IOVA allocation dependency between firmware buffer and remaining buffers

2020-09-23 Thread Marek Szyprowski
address, although it doesn't guarantee that those specific addresses won't be later used by the IOVA allocator. Probably it would make sense to add an API for generic IOMMU-DMA framework to mark the given IOVA range as reserved/unused to protect them. Best regards Marek Szyprowski, PhD Samsung

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 ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

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 ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH] iommu/exynos: add missing put_device() call in exynos_iommu_of_xlate()

2020-09-18 Thread Marek Szyprowski
exynos: Add callback for initializing devices > from device tree") > Signed-off-by: Yu Kuai Thanks for the fix! Acked-by: Marek Szyprowski > --- > drivers/iommu/exynos-iommu.c | 8 ++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/iommu

Re: [PATCH 00/18] Convert arch/arm to use iommu-dma

2020-09-18 Thread Marek Szyprowski
Hi all, On 24.08.2020 13:40, Marek Szyprowski wrote: > On 20.08.2020 17:08, Robin Murphy wrote: >> After 5 years or so of intending to get round to this, finally the >> time comes! The changes themselves actualy turn out to be relatively >> mechanical; the bigger concern app

Re: [PATCH 14/18] drm/exynos: Consolidate IOMMU mapping code

2020-09-18 Thread Marek Szyprowski
PP_CAP_CROP | DRM_EXYNOS_IPP_CAP_ROTATE | > @@ -471,8 +470,7 @@ static void scaler_unbind(struct device *dev, struct > device *master, > struct exynos_drm_ipp *ipp = >ipp; > > exynos_drm_ipp_unregister(dev, ipp); > - exynos_drm_unregister_dma(scaler->drm_dev, scaler->de

[PATCH] scatterlist: protect parameters of the sg_table related macros

2020-06-30 Thread Marek Szyprowski
Add brackets to protect parameters of the recently added sg_table related macros from side-effects. Fixes: 709d6d73c756 ("scatterlist: add generic wrappers for iterating over sgtable objects") Signed-off-by: Marek Szyprowski --- include/linux/scatterlist.h | 8 1 file

[PATCH] iommu: move sg_table wrapper out of CONFIG_IOMMU_SUPPORT

2020-06-30 Thread Marek Szyprowski
Move the recently added sg_table wrapper out of CONFIG_IOMMU_SUPPORT to let the client code copile also when IOMMU support is disabled. Fixes: 48530d9fab0d ("iommu: add generic helper for mapping sgtable objects") Signed-off-by: Marek Szyprowski --- include/linux/io

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

2020-06-30 Thread Marek Szyprowski
Hi All, On 19.06.2020 12:36, Marek Szyprowski wrote: > During the Exynos DRM GEM rework and fixing the issues in the. > drm_prime_sg_to_page_addr_arrays() function [1] I've noticed that most > drivers in DRM framework incorrectly use nents and orig_nents entries of > the str

Re: [PATCH v7 31/36] staging: tegra-vde: fix common struct sg_table related issues

2020-06-30 Thread Marek Szyprowski
On 21.06.2020 06:00, Dmitry Osipenko wrote: > В Fri, 19 Jun 2020 12:36:31 +0200 > Marek Szyprowski пишет: > >> The Documentation/DMA-API-HOWTO.txt states that the dma_map_sg() >> function returns the number of the created entries in the DMA address >> space. H

[PATCH v8] videobuf2: use sgtable-based scatterlist wrappers

2020-06-30 Thread Marek Szyprowski
. Signed-off-by: Marek Szyprowski --- v8: - rebased after recent changes in the code --- .../common/videobuf2/videobuf2-dma-contig.c | 34 --- .../media/common/videobuf2/videobuf2-dma-sg.c | 32 +++-- .../common/videobuf2/videobuf2-vmalloc.c | 12 +++ 3 files

[PATCH v8] rapidio: fix common struct sg_table related issues

2020-06-30 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

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

2020-07-07 Thread Marek Szyprowski
Hi Christian, On 22.06.2020 15:27, Christian König wrote: > Am 19.06.20 um 12:36 schrieb Marek Szyprowski: >> The Documentation/DMA-API-HOWTO.txt states that the dma_map_sg() >> function >> returns the number of the created entries in the DMA address space. >> H

Re: [PATCH] iommu/exynos: Rename update_pte()

2020-07-14 Thread Marek Szyprowski
-by: kernel test robot > Signed-off-by: Robin Murphy Acked-by: Marek Szyprowski > --- > drivers/iommu/exynos-iommu.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c &

[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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

[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 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 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 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 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 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 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 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 v7 34/36] samples: vfio-mdev/mbochs: fix common struct sg_table related issues

2020-06-19 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 v7 24/36] drm: xen: fix common struct sg_table related issues

2020-06-19 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 v7 31/36] staging: tegra-vde: 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 12/36] drm: mediatek: use common helper for extracting pages array

2020-06-19 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 v7 36/36] videobuf2: use sgtable-based scatterlist wrappers

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

[PATCH v7 29/36] staging: ion: remove dead code

2020-06-19 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 v7 19/36] drm: rockchip: 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 33/36] rapidio: 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 35/36] media: pci: fix common ALSA DMA-mapping related codes

2020-06-19 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 v7 16/36] drm: panfrost: 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 21/36] drm: v3d: 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 32/36] misc: fastrpc: 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 23/36] drm: vmwgfx: 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 27/36] drm: rcar-du: fix common struct sg_table related issues

2020-06-19 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 v7 26/36] drm: host1x: 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 28/36] dmabuf: 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 30/36] staging: ion: 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 25/36] xen: gntdev: 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 17/36] drm: radeon: 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 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 14/36] drm: omapdrm: use common helper for extracting pages array

2020-06-19 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 v7 02/36] drm: prime: use sgtable iterators in drm_prime_sg_to_page_addr_arrays()

2020-06-19 Thread Marek Szyprowski
describing the old code is no longer needed. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/drm_prime.c | 49 - 1 file changed, 15 insertions(+), 34 deletions(-) diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 226cd6ad3985

[PATCH v7 05/36] drm: armada: 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 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 10/36] drm: lima: 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 20/36] drm: tegra: 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 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 v7 11/36] drm: mediatek: 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 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 v7 06/36] drm: etnaviv: 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 15/36] drm: omapdrm: fix common struct sg_table related issues

2020-06-19 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 v7 09/36] drm: i915: fix common struct sg_table related issues

2020-06-19 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 v7 03/36] drm: core: 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 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 18/36] drm: rockchip: 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/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 v7 13/36] drm: msm: 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 22/36] drm: virtio: 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

<    3   4   5   6   7   8   9   >