[PATCH v3 13/25] drm: tegra: fix common struct sg_table related issues

2020-05-05 Thread Marek Szyprowski
struct sg_table objects and adjust references to the nents and orig_nents respectively. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v3 00/25] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/5/5/187 --- drivers/gpu/drm/tegra/gem.c

[PATCH v3 22/25] misc: fastrpc: fix common struct sg_table related issues

2020-05-05 Thread Marek Szyprowski
struct sg_table objects and adjust references to the nents and orig_nents respectively. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v3 00/25] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/5/5/187 --- drivers/misc/fastrpc.c | 4 +

[PATCH v3 11/25] drm: radeon: fix common struct sg_table related issues

2020-05-05 Thread Marek Szyprowski
struct sg_table objects and adjust references to the nents and orig_nents respectively. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v3 00/25] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/5/5/187 --- drivers/gpu/drm/radeon/radeon

[PATCH v3 04/25] drm: armada: fix common struct sg_table related issues

2020-05-05 Thread Marek Szyprowski
struct sg_table objects and adjust references to the nents and orig_nents respectively. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v3 00/25] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/5/5/187 --- drivers/gpu/drm/armada/armada

[PATCH v3 23/25] rapidio: fix common struct sg_table related issues

2020-05-05 Thread Marek Szyprowski
struct sg_table objects and adjust references to the nents and orig_nents respectively. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v3 00/25] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/5/5/187 --- drivers/rapidio/d

[PATCH v3 16/25] xen: gntdev: fix common struct sg_table related issues

2020-05-05 Thread Marek Szyprowski
struct sg_table objects and adjust references to the nents and orig_nents respectively. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v3 00/25] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/5/5/187 --- drivers/xen/gntdev-dmabuf

[PATCH v3 00/25] DRM: fix struct sg_table nents vs. orig_nents misuse

2020-05-05 Thread Marek Szyprowski
ctions. I hope that I didn't break anything there. Patches are based on top of Linux next-20200504. 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 Changelog: v3: - introduce dma_*

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

2020-05-04 Thread Marek Szyprowski
Hi Christoph, On 04.05.2020 14:52, Christoph Hellwig wrote: > On Mon, May 04, 2020 at 02:50:17PM +0200, Marek Szyprowski wrote: >> v2: >> - dropped most of the changes to drm/i915 >> - added fixes for rcar-du, xen, media and ion >> - fixed a few issues pointed by kbuild

[PATCH v2 07/21] drm: lima: fix sg_table nents vs. orig_nents misuse

2020-05-04 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 v2 00/21] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/

[PATCH v2 17/21] drm: rcar-du: fix sg_table nents vs. orig_nents misuse

2020-05-04 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 v2 00/21] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/

[PATCH v2 13/21] drm: virtio: fix sg_table nents vs. orig_nents misuse

2020-05-04 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 v2 00/21] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/

[PATCH v2 20/21] media: pci: fix common ALSA DMA-mapping related code

2020-05-04 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 v2 00/21] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/

[PATCH v2 02/21] drm: amdgpu: fix sg_table nents vs. orig_nents misuse

2020-05-04 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 Reviewed-by: Christian König --- For more information, see '[PATCH v2 00/21] DRM: fix struct sg_table nents vs. orig_nents misuse' thr

[PATCH v2 12/21] drm: tegra: fix sg_table nents vs. orig_nents misuse

2020-05-04 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 v2 00/21] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/

[PATCH v2 18/21] xen: gntdev: fix sg_table nents vs. orig_nents misuse

2020-05-04 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 v2 00/21] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/

[PATCH v2 05/21] drm: exynos: fix sg_table nents vs. orig_nents misuse

2020-05-04 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 v2 00/21] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/

[PATCH v2 19/21] dmabuf: fix sg_table nents vs. orig_nents misuse

2020-05-04 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 v2 00/21] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/

[PATCH v2 03/21] drm: armada: fix sg_table nents vs. orig_nents misuse

2020-05-04 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 v2 00/21] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/

[PATCH v2 09/21] drm: panfrost: fix sg_table nents vs. orig_nents misuse

2020-05-04 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 v2 00/21] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/

[PATCH v2 15/21] drm: xen: fix sg_table nents vs. orig_nents misuse

2020-05-04 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 v2 00/21] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/

[PATCH v2 06/21] drm: i915: fix sg_table nents vs. orig_nents misuse for dmabuf objects

2020-05-04 Thread Marek Szyprowski
(mis)used to properly free the (over)allocated scatterlist. This patch only fixes the sg_table->nents entries in the sg_table objects exported by the dmabuf related functions, so the other drivers, which might share buffers with i915 could rely on the nents and orig_nents values. Signed-off-by: Mare

[PATCH v2 21/21] staging: ion: fix sg_table nents vs. orig_nents misuse

2020-05-04 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 v2 00/21] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/

[PATCH v2 01/21] drm: core: fix sg_table nents vs. orig_nents misuse

2020-05-04 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/gpu/drm/drm_cache.c| 2 +- drivers/gpu/drm/drm_gem_shmem_helper.c | 7 --- drivers/gpu/drm/drm_prim

[PATCH v2 04/21] drm: etnaviv: fix sg_table nents vs. orig_nents misuse

2020-05-04 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 v2 00/21] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/

[PATCH v2 16/21] drm: host1x: fix sg_table nents vs. orig_nents misuse

2020-05-04 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 v2 00/21] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/

[PATCH v2 08/21] drm: msm: fix sg_table nents vs. orig_nents misuse

2020-05-04 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 v2 00/21] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/

[PATCH v2 10/21] drm: radeon: fix sg_table nents vs. orig_nents misuse

2020-05-04 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 Reviewed-by: Christian König --- For more information, see '[PATCH v2 00/21] DRM: fix struct sg_table nents vs. orig_nents misuse' thr

[PATCH v2 14/21] drm: vmwgfx: fix sg_table nents vs. orig_nents misuse

2020-05-04 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 v2 00/21] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/

[PATCH v2 11/21] drm: rockchip: fix sg_table nents vs. orig_nents misuse

2020-05-04 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 v2 00/21] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lkml.org/lkml/2020/

[PATCH v2 00/21] DRM: fix struct sg_table nents vs. orig_nents misuse

2020-05-04 Thread Marek Szyprowski
}_sgtable() wrappers, which will use a proper sg_table entries and call respective DMA-mapping functions. I hope this will help to avoid issue like this in the future. Patches are based on top of Linux next-20200504. Best regards, Marek Szyprowski References: [1] https://lkml.org/lkml/2020/3/27/555

Re: [Intel-gfx] [RFC 06/17] drm: i915: fix sg_table nents vs. orig_nents misuse

2020-04-30 Thread Marek Szyprowski
Hi On 28.04.2020 16:27, Tvrtko Ursulin wrote: > > On 28/04/2020 14:19, Marek Szyprowski wrote: >> The Documentation/DMA-API-HOWTO.txt states that dma_map_sg returns the >> numer of the created entries in the DMA address space. However the >> subsequent calls to dma

[RFC 08/17] drm: msm: fix sg_table nents vs. orig_nents misuse

2020-04-28 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/gpu/drm/msm/msm_gem.c | 8 drivers/gpu/drm/msm/msm_iommu.c | 3 ++- 2 files changed, 6 insertions(+), 5 deleti

[RFC 00/17] DRM: fix struct sg_table nents vs. orig_nents misuse

2020-04-28 Thread Marek Szyprowski
lists, the next version I will try to send to the maintainers of the respective drivers. 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 Patch summary: Marek Szyprowski (17): drm: cor

[RFC 12/17] drm: tegra: fix sg_table nents vs. orig_nents misuse

2020-04-28 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/gpu/drm/tegra/gem.c | 25 + drivers/gpu/drm/tegra/plane.c | 13 +++-- 2 files changed,

[RFC 17/17] dmabuf: fix sg_table nents vs. orig_nents misuse

2020-04-28 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/dma-buf/heaps/heap-helpers.c | 7 --- drivers/dma-buf/udmabuf.c| 5 +++-- 2 files changed, 7 insertions(+)

[RFC 03/17] drm: armada: fix sg_table nents vs. orig_nents misuse

2020-04-28 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/gpu/drm/armada/armada_gem.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/

[RFC 13/17] drm: virtio: fix sg_table nents vs. orig_nents misuse

2020-04-28 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/gpu/drm/virtio/virtgpu_object.c | 11 ++- drivers/gpu/drm/virtio/virtgpu_vq.c | 8 2 files changed,

[RFC 14/17] drm: vmwgfx: fix sg_table nents vs. orig_nents misuse

2020-04-28 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/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/

[RFC 09/17] drm: panfrost: fix sg_table nents vs. orig_nents misuse

2020-04-28 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/gpu/drm/panfrost/panfrost_gem.c | 3 ++- drivers/gpu/drm/panfrost/panfrost_mmu.c | 4 +++- 2 files changed, 5 insertions(+)

[RFC 05/17] drm: exynos: fix sg_table nents vs. orig_nents misuse

2020-04-28 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/gpu/drm/exynos/exynos_drm_g2d.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/

[RFC 04/17] drm: etnaviv: fix sg_table nents vs. orig_nents misuse

2020-04-28 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/gpu/drm/etnaviv/etnaviv_gem.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/

[RFC 15/17] drm: xen: fix sg_table nents vs. orig_nents misuse

2020-04-28 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/gpu/drm/xen/xen_drm_front_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/

[RFC 10/17] drm: radeon: fix sg_table nents vs. orig_nents misuse

2020-04-28 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/gpu/drm/radeon/radeon_ttm.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/

[RFC 16/17] drm: host1x: fix sg_table nents vs. orig_nents misuse

2020-04-28 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/gpu/host1x/job.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/host1x/jo

[RFC 01/17] drm: core: fix sg_table nents vs. orig_nents misuse

2020-04-28 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/gpu/drm/drm_cache.c| 2 +- drivers/gpu/drm/drm_gem_shmem_helper.c | 7 --- drivers/gpu/drm/drm_prim

[RFC 02/17] drm: amdgpu: fix sg_table nents vs. orig_nents misuse

2020-04-28 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/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 7 --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 8 2 files changed

[RFC 07/17] drm: lima: fix sg_table nents vs. orig_nents misuse

2020-04-28 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/gpu/drm/lima/lima_gem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/lima/lima_ge

[RFC 11/17] drm: rockchip: fix sg_table nents vs. orig_nents misuse

2020-04-28 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/gpu/drm/rockchip/rockchip_drm_gem.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/driv

[RFC 06/17] drm: i915: fix sg_table nents vs. orig_nents misuse

2020-04-28 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/gpu/drm/i915/gem/i915_gem_dmabuf.c | 13 +++-- drivers/gpu/drm/i915/gem/i915_gem_internal.c | 4 ++-- driv

Re: [PATCH v2 00/33] iommu: Move iommu_group setup to IOMMU core code

2020-04-16 Thread Marek Szyprowski
boards (ARM and ARM64). Tested-by: Marek Szyprowski Acked-by: Marek Szyprowski (for Exynos and core changes) > * Fixed a missing mutex_unlock() reported by Marek Szyprowski, > thanks for that. > > There is also a git-branch available with these patches applied: > &

Re: [RFC PATCH 33/34] iommu: Remove add_device()/remove_device() code-paths

2020-04-10 Thread Marek Szyprowski
s from the hardware TLBs and empty > flush >*queue >* @iova_to_phys: translate iova to physical address > - * @add_device: add device to iommu grouping > - * @remove_device: remove device from iommu grouping >* @probe_device: Add device to iommu driver handling >

[PATCH] iommu/exynos: Rework intialization

2020-04-09 Thread Marek Szyprowski
Fix initialization after driver conversion to probe_device()/release_device(). Prepared on top of: https://git.kernel.org/pub/scm/linux/kernel/git/joro/linux.git/log/?h=iommu-probe-device Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 80

Re: [PATCH] iommu/exynos: Get rid of 'struct exynos_iommu_owner' exynos_iommu_owner

2020-04-09 Thread Marek Szyprowski
_by_node(spec->np); > struct sysmmu_drvdata *data, *entry; > > @@ -1302,22 +1317,28 @@ static int exynos_iommu_of_xlate(struct device *dev, > if (!data) > return -ENODEV; > > - if (!owner) { > - owner = kzalloc(sizeof(*owner), GFP_KERNEL); > - if (!owner) > - return -ENOMEM; > + data->master = dev; > > - INIT_LIST_HEAD(>controllers); > - mutex_init(>rpm_lock); > - dev->archdata.iommu = owner; > + if (!dev->archdata.iommu) { > + WARN_ON(data->next != NULL); > + > + /* SYSMMU list is empty - add drvdata and return */ > + data->next = ERR_PTR(-ENODEV); > + dev->archdata.iommu = data; > + > + return 0; > } > > - list_for_each_entry(entry, >controllers, owner_node) > + /* Check if SYSMMU is already in the list */ > + for_each_sysmmu(dev, entry) > if (entry == data) > return 0; > > - list_add_tail(>owner_node, >controllers); > - data->master = dev; > + /* Not in the list yet */ > + WARN_ON(data->next != NULL); > + entry = dev->archdata.iommu; > + data->next = entry->next; > + entry->next = data; > > return 0; > } 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: [RFC PATCH 31/34] iommu/exynos: Create iommu_device in struct exynos_iommu_owner

2020-04-08 Thread Marek Szyprowski
Hi again, On 08.04.2020 14:23, Marek Szyprowski wrote: > Hi Joerg, > > On 07.04.2020 20:37, Joerg Roedel wrote: >> From: Joerg Roedel >> >> The 'struct exynos_iommu_owner' is an umbrella for multiple SYSMMU >> instances attached to one master. As such all these

Re: [RFC PATCH 31/34] iommu/exynos: Create iommu_device in struct exynos_iommu_owner

2020-04-08 Thread Marek Szyprowski
@@ -1302,15 +1356,11 @@ static int exynos_iommu_of_xlate(struct device *dev, > if (!data) > return -ENODEV; > > - if (!owner) { > - owner = kzalloc(sizeof(*owner), GFP_KERNEL); > - if (!owner) > - return -ENOMEM; > + ret =

Re: [PATCH v1 2/2] of: Let of_for_each_phandle fallback to non-negative cell_count

2019-09-17 Thread Marek Szyprowski
_iterator *it) >> { >> >> ... >> >> if (it->cells_name) { >> >> ... >> >> } else { >> count = it->cell_count;/*

[PATCH] iommu: exynos: Remove __init annotation from exynos_sysmmu_probe()

2019-08-12 Thread Marek Szyprowski
obe() function. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index b0c1e5f9daae..a48236c1d5cb 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/io

Re: [RFC PATCH v7 2/5] iommu/dma: Add a new dma_map_ops of get_merge_boundary()

2019-06-21 Thread Marek Szyprowski
mu_dma_sync_sg_for_device, > .map_resource = iommu_dma_map_resource, > .unmap_resource = iommu_dma_unmap_resource, > + .get_merge_boundary = iommu_dma_get_merge_boundary, > }; > > /* Best regards -- Marek Szyprowski, PhD Samsung R Institute Poland

Re: [Freedreno] [PATCH] of/device: add blacklist for iommu dma_ops

2019-06-05 Thread Marek Szyprowski
s://patchwork.kernel.org/patch/4677941/ https://patchwork.kernel.org/patch/4677401/ It looks that my idea was a bit ahead of its time ;) Best regards -- Marek Szyprowski, PhD Samsung R Institute Poland ___ iommu mailing list iommu@li

Re: [PATCH] swiotlb: sync buffer when mapping FROM_DEVICE

2019-05-22 Thread Marek Szyprowski
fer because we *don't* know exactly which parts the device may > write to". So indeed if we did go down that route we wouldn't need any > of the sync stuff I was worrying about (but I might suggest naming it > DMA_ATTR_UPDATE instead). Apologies for being slow :) Don't we have DMA_BID

Re: [PATCH] dma-contiguous: do not allocate a single page from CMA area

2019-02-18 Thread Marek Szyprowski
allocations. > > Signed-off-by: Nicolin Chen Acked-by: Marek Szyprowski > --- > kernel/dma/contiguous.c | 22 +++--- > 1 file changed, 19 insertions(+), 3 deletions(-) > > diff --git a/kernel/dma/contiguous.c b/kernel/dma/contiguous.c > index b2a87905846d..0

Re: [PATCH] dma-direct: Export dma_direct_alloc() and dma_direct_free()

2019-02-05 Thread Marek Szyprowski
irst CRTC device that has been registered. Then that device is used for DMA-mapping calls. It is not very elegant, but works fine and allows to use standard DMA-mapping calls. Best regards -- Marek Szyprowski, PhD Samsung R Institute Poland ___ iommu mail

Re: [PATCH] ARM: dma-mapping: Clear DMA ops on teardown

2019-02-04 Thread Marek Szyprowski
omatically installed by its counterpart. > > Reported-by: Tobias Jakobi > Reported-by: Marek Szyprowski > Fixes: 1874619a7df4 "ARM: dma-mapping: Set proper DMA ops in > arm_iommu_detach_device()" > Tested-by: Tobias Jakobi > Signed-off-by: Robin Murphy > --- > > S

Re: fix a layering violation in videobuf2 and improve dma_map_resource v2

2019-01-31 Thread Marek Szyprowski
ma_map_resource > implementation to not provide a somewhat dangerous default and improve > the error handling. > > Changes since v1: > - don't apply bus offsets in dma_direct_map_resource Works fine on older Exynos based boards with IOMMU and CMA disabled. Tested-by: Marek Szypr

Re: [PATCH 3/3] videobuf2: replace a layering violation with dma_map_resource

2019-01-18 Thread Marek Szyprowski
Hi Christoph, On 2019-01-17 18:21, Christoph Hellwig wrote: > On Mon, Jan 14, 2019 at 01:42:26PM +0100, Marek Szyprowski wrote: >> On 2019-01-11 19:17, Christoph Hellwig wrote: >>> vb2_dc_get_userptr pokes into arm direct mapping details to get the >>> r

Re: [PATCH] Revert "ARM: dma-mapping: Set proper DMA ops in arm_iommu_detach_device()"

2019-01-16 Thread Marek Szyprowski
Hi Robin, On 2019-01-14 17:38, Robin Murphy wrote: > On 14/01/2019 16:09, Thierry Reding wrote: >> On Mon, Jan 14, 2019 at 02:22:40PM +0100, Marek Szyprowski wrote: >>> This reverts commit 1874619a7df4b14b23b14877e705ae15325773e3. >>> >>> That patch broke IO

[PATCH] Revert "ARM: dma-mapping: Set proper DMA ops in arm_iommu_detach_device()"

2019-01-14 Thread Marek Szyprowski
() and stays with non-IOMMU dma_ops. Reported-by: Tobias Jakobi Fixes: 1874619a7df4 "ARM: dma-mapping: Set proper DMA ops in arm_iommu_detach_device()" Signed-off-by: Marek Szyprowski --- arch/arm/mm/dma-mapping.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --

Re: fix a layering violation in videobuf2 and improve dma_map_resource

2019-01-14 Thread Marek Szyprowski
ut the DMA mapping internals. Feel free to add my: Reviewed-by: Marek Szyprowski 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 3/4] iommu/of: Don't call iommu_ops->add_device directly

2018-12-19 Thread Marek Szyprowski
Hi Joerg, On 2018-12-19 15:34, Joerg Roedel wrote: > Hi Marek, > > thanks for the report! > > On Wed, Dec 19, 2018 at 10:54:18AM +0100, Marek Szyprowski wrote: >> On 2018-12-11 16:05, Joerg Roedel wrote: >>> From: Joerg Roedel >>> >>> Make

Re: [PATCH 3/4] iommu/of: Don't call iommu_ops->add_device directly

2018-12-19 Thread Marek Szyprowski
ps from local variable. > > /* Ignore all other errors apart from EPROBE_DEFER */ > if (err == -EPROBE_DEFER) { 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 15/15] dma-mapping: bypass indirect calls for dma-direct

2018-12-14 Thread Marek Szyprowski
Hi Christoph, On 2018-12-14 15:24, Christoph Hellwig wrote: > On Fri, Dec 14, 2018 at 03:11:37PM +0100, Marek Szyprowski wrote: >> Hi Christoph, >> >> On 2018-12-07 20:07, Christoph Hellwig wrote: >>> Avoid expensive indirect calls in the fast path DMA mapping >

Re: [PATCH 15/15] dma-mapping: bypass indirect calls for dma-direct

2018-12-14 Thread Marek Szyprowski
ps = get_dma_ops(dev); > void *cpu_addr; > > - BUG_ON(!ops); > WARN_ON_ONCE(dev && !dev->coherent_dma_mask); > > if (dma_alloc_from_dev_coherent(dev, size, dma_handle, _addr)) > @@ -352,10 +354,14 @@ void *dma_alloc_attrs(struct device *dev, size_

[PATCH] dma-mapping: fix lack of DMA address assignment in generic remap allocator

2018-12-05 Thread Marek Szyprowski
uot;dma-mapping: support highmem in the generic remap allocator") Signed-off-by: Marek Szyprowski --- kernel/dma/remap.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kernel/dma/remap.c b/kernel/dma/remap.c index 68a64e3ff6a1..8a44317cfc1a 100644 --- a/kernel/dma/

Re: [PATCH 5/9] dma-mapping: support highmem in the generic remap allocator

2018-12-04 Thread Marek Szyprowski
*dev, size_t >> size, void *vaddr, >>   dma_addr_t dma_handle, unsigned long attrs) >>   { >>   if (!dma_free_from_pool(vaddr, PAGE_ALIGN(size))) { >> -    void *kaddr = phys_to_virt(dma_to_phys(dev, dma_handle)); >> +    phys_addr_t phys = dma_to_phys

Re: [PATCH] of/device: add blacklist for iommu dma_ops

2018-12-03 Thread Marek Szyprowski
truct device *dev, struct >> device_node *np, bool force_dma) >> dev_dbg(dev, "device is%sbehind an iommu\n", >> iommu ? " " : " not "); >> >> + /* >> +* There is at least one case where the driver wan

Re: [PATCH v2 2/3] iommu/dma: Use fast DMA domain lookup

2018-09-28 Thread Marek Szyprowski
Hi Robin, On 2018-09-28 17:31, Robin Murphy wrote: > On 28/09/18 15:21, Marek Szyprowski wrote: >> On 2018-09-28 15:52, Robin Murphy wrote: >>> On 28/09/18 14:26, Marek Szyprowski wrote: >>>> On 2018-09-12 17:24, Robin Murphy wrote: >>>>> Most parts o

[PATCH] drm/exynos: Use selected dma_dev default iommu domain instead of a fake one

2018-09-28 Thread Marek Szyprowski
Instead of allocating a fake IOMMU domain for all Exynos DRM components, simply reuse the default IOMMU domain of the already selected DMA device. This allows some design changes in IOMMU framework without breaking IOMMU support in Exynos DRM. Signed-off-by: Marek Szyprowski --- Inki

Re: [PATCH v2 2/3] iommu/dma: Use fast DMA domain lookup

2018-09-28 Thread Marek Szyprowski
Hi Robin, On 2018-09-28 15:52, Robin Murphy wrote: > On 28/09/18 14:26, Marek Szyprowski wrote: >> On 2018-09-12 17:24, Robin Murphy wrote: >>> Most parts of iommu-dma already assume they are operating on a default >>> domain set up by iommu_dma_init_domain(), an

Re: [PATCH v2 2/3] iommu/dma: Use fast DMA domain lookup

2018-09-28 Thread Marek Szyprowski
(dev), handle, size); > } > > int iommu_dma_mapping_error(struct device *dev, dma_addr_t dma_addr) > @@ -850,7 +851,7 @@ static struct iommu_dma_msi_page > *iommu_dma_get_msi_page(struct device *dev, > if (!msi_page) > return NULL; > > -

Re: [PATCH] kernel/dma: Fix panic caused by passing cma to command line

2018-09-18 Thread Marek Szyprowski
t; [0.00] secondary_startup_64+0xa4/0xb0 > > This patch adds a check to prevent the panic. > > Signed-off-by: He Zhe > Cc: sta...@vger.kernel.org > Cc: h...@lst.de > Cc: m.szyprow...@samsung.com > Cc: robin.mur...@arm.com Thanks for the fix. Reviewed-by: Marek Szypr

Re: [PATCH v12 1/4] iommu/arm-smmu: Add pm_runtime/sleep ops

2018-07-23 Thread Marek Szyprowski
Hi Rafael, On 2018-07-11 22:36, Rafael J. Wysocki wrote: > On Wed, Jul 11, 2018 at 3:40 PM, Marek Szyprowski > wrote: >> Hi Tomasz, >> >> On 2018-07-11 14:51, Tomasz Figa wrote: >>> On Wed, Jul 11, 2018 at 8:11 PM Rafael J. Wysocki wrote: >>>> O

Re: [PATCH v12 1/4] iommu/arm-smmu: Add pm_runtime/sleep ops

2018-07-11 Thread Marek Szyprowski
e) >>>> This is suspicious. >>>> >>>> If you need a runtime suspend method, why do you think that it is not >>>> necessary >>>> to suspend the device during system-wide transitions? >>> Okay, so you suggest to put clock disabling i

[PATCH 2/2] dma: remove unsupported gfp_mask parameter from dma_alloc_from_contiguous()

2018-07-09 Thread Marek Szyprowski
to avoid giving false feeling that this function supports standard gfp flags and callers can pass __GFP_ZERO to get zeroed buffer, what has already been an issue: see commit dd65a941f6ba ("arm64: dma-mapping: clear buffers allocated with FORCE_CONTIGUOUS flag"). Signed-off-by: Marek

[PATCH 1/2] mm/cma: remove unsupported gfp_mask parameter from cma_alloc()

2018-07-09 Thread Marek Szyprowski
already been an issue: see commit dd65a941f6ba ("arm64: dma-mapping: clear buffers allocated with FORCE_CONTIGUOUS flag"). Signed-off-by: Marek Szyprowski --- arch/powerpc/kvm/book3s_hv_builtin.c | 2 +- drivers/s390/char/vmcp.c | 2 +- drivers/staging/a

[PATCH 0/2] CMA: remove unsupported gfp mask parameter

2018-07-09 Thread Marek Szyprowski
/ Best regards Marek Szyprowski Samsung R Institute Poland Patch summary: Marek Szyprowski (2): mm/cma: remove unsupported gfp_mask parameter from cma_alloc() dma: remove unsupported gfp_mask parameter from dma_alloc_from_contiguous() arch/arm/mm/dma-mapping.c | 5

Re: [PATCH v2 7/8] iommu: Remove IOMMU_OF_DECLARE

2018-05-28 Thread Marek Szyprowski
> Cc: Frank Rowand <frowand.l...@gmail.com> > Cc: linux-arm-ker...@lists.infradead.org > Cc: iommu@lists.linux-foundation.org > Cc: linux-samsung-...@vger.kernel.org > Cc: linux-arm-...@vger.kernel.org > Cc: linux-rockc...@lists.infradead.org > Cc: devicet...@vger.kern

Re: [PATCH 1/3] dma-debug: move initialization to common code

2018-05-08 Thread Marek Szyprowski
stoph Hellwig <h...@lst.de> Nice! Unification of this is definitely needed and solves the issues reported some time ago: https://patchwork.kernel.org/patch/9429637/ (arm) https://patchwork.kernel.org/patch/9431161/ (arm64, rejected) Acked-by: Marek Szyprowski <m.szyprow...@samsung.com&g

Re: [PATCH] iommu/exynos: Use generic group callback

2018-01-26 Thread Marek Szyprowski
ion; let's just use that one instead. Signed-off-by: Robin Murphy <robin.mur...@arm.com> Thanks for this cleanup! Tested-by: Marek Szyprowski <m.szyprow...@samsung.com> --- drivers/iommu/exynos-iommu.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff

Re: [PATCH 1/9] iommu/of: Drop early initialisation hooks

2018-01-11 Thread Marek Szyprowski
Hi Jeffy, On 2018-01-11 12:14, JeffyChen wrote: Hi Marek, Thanks for your reply. On 01/11/2018 05:40 PM, Marek Szyprowski wrote: Hi Jeffy, On 2018-01-11 09:22, Jeffy Chen wrote: With the probe-deferral mechanism, early initialisation hooks are no longer needed. Suggested-by: Robin Murphy

Re: [PATCH 1/9] iommu/of: Drop early initialisation hooks

2018-01-11 Thread Marek Szyprowski
+- drivers/iommu/arm-smmu.c | 12 ++-- drivers/iommu/exynos-iommu.c | 2 +- For Exynos IOMMU: Acked-by: Marek Szyprowski <m.szyprow...@samsung.com> IPMMU and MSM IOMMU are no longer multi-platform safe after this patch. It breaks them in the same way as my commit 928055a01

Re: [PATCH v2] iommu/exynos: Don't unconditionally steal bus ops

2018-01-09 Thread Marek Szyprowski
custom platform device registration code") Signed-off-by: Robin Murphy <robin.mur...@arm.com> Acked-by: Marek Szyprowski <m.szyprow...@samsung.com> --- v2: Use the simpler explicit DT check. drivers/iommu/exynos-iommu.c | 7 +++ 1 file changed, 7 insertions(+) diff --git

Re: [PATCH] iommu/exynos: Don't unconditionally steal bus ops

2018-01-09 Thread Marek Szyprowski
__func__); - goto err_set_iommu; - } - return 0; -err_set_iommu: - kmem_cache_free(lv2table_kmem_cache, zero_lv2_table); + err_zero_lv2: platform_driver_unregister(_sysmmu_driver); err_reg_driver: Best regards -- Marek Szy

Re: [RFC 2/2] drivers: dma-mapping: parse per device reserved mem at probe time

2017-12-07 Thread Marek Szyprowski
Hi Peng, On 2017-11-27 10:04, Peng Fan wrote: On Mon, Nov 27, 2017 at 09:44:20AM +0100, Marek Szyprowski wrote: On 2017-11-27 09:37, Peng Fan wrote: On Mon, Nov 27, 2017 at 09:31:00AM +0100, Marek Szyprowski wrote: On 2017-11-26 14:13, Peng Fan wrote: Invoke of_reserved_mem_device_init

Re: [RFC 2/2] drivers: dma-mapping: parse per device reserved mem at probe time

2017-11-27 Thread Marek Szyprowski
Hi Peng, On 2017-11-27 09:37, Peng Fan wrote: Hi Marek, On Mon, Nov 27, 2017 at 09:31:00AM +0100, Marek Szyprowski wrote: Hi On 2017-11-26 14:13, Peng Fan wrote: Invoke of_reserved_mem_device_init at dma_configure, then there is no need to call of_reserved_mem_device_init in device specific

Re: [RFC 2/2] drivers: dma-mapping: parse per device reserved mem at probe time

2017-11-27 Thread Marek Szyprowski
_DMA_NOT_SUPPORTED) @@ -367,5 +370,6 @@ int dma_configure(struct device *dev) void dma_deconfigure(struct device *dev) { of_dma_deconfigure(dev); + of_reserved_mem_device_release(dev); acpi_dma_deconfigure(dev); } Best regards -- Marek Szyprowski, PhD Samsung

Re: [RFC PATCH] drivers: base: dma-coherent: find free region without alignment

2017-11-14 Thread Marek Szyprowski
ro_area(mem->bitmap, mem->size, 0, + nr_page, 0); + if (unlikely(pageno >= mem->size)) { goto err; + bitmap_set(mem->bitmap, pageno, nr_page); /* * Memory was found in the coherent area. Best regards --

Re: [PATCH] xhci: Set DMA parameters appropriately

2017-10-17 Thread Marek Szyprowski
Hi Robin, On 2017-10-13 12:48, Robin Murphy wrote: On 13/10/17 09:15, Marek Szyprowski wrote: On 2017-10-11 15:56, Robin Murphy wrote: xHCI requires that data buffers do not cross 64KB boundaries (and are thus at most 64KB long as well) - whilst xhci_queue_{bulk,isoc}_tx() already split

Re: [PATCH] xhci: Set DMA parameters appropriately

2017-10-13 Thread Marek Szyprowski
ma_parms are provided, so there is very little value added by this patch. 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: Remove initconst attribute to avoid potential kernel oops

2017-10-10 Thread Marek Szyprowski
Hi Joerg, On 2017-10-10 14:13, Joerg Roedel wrote: On Mon, Oct 09, 2017 at 01:40:23PM +0200, Marek Szyprowski wrote: Exynos SYSMMU registers standard platform device with sysmmu_of_match table, what means that this table is accessed every time a new platform device is registered in a system

[PATCH] iommu/exynos: Remove initconst attribute to avoid potential kernel oops

2017-10-09 Thread Marek Szyprowski
caused by access to freed memory. Fixes: 6b21a5db3642 ("iommu/exynos: Support for device tree") Signed-off-by: Marek Szyprowski <m.szyprow...@samsung.com> --- Hi! This issue was there from the beggining of the device tree support, I'm really surprised that it has not been not

<    1   2   3   4   5   6   7   8   9   >