Re: [PATCH v5 3/9] dma-mapping: add dma_{map,unmap}_resource

2016-03-07 Thread Christoph Hellwig
Please add some documentation on where/how this should be used. It's not a very obvious interface. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

[PATCH v5 9/9] ARM: dts: r8a7791: add iommus to dmac0 and dmac1

2016-03-07 Thread Niklas Söderlund
A unconfirmed hardware bug prevents channel 0 and 15 to be used by the DMAC together with the IPMMU. The DMAC driver will disable the channels reducing the effective number of channels to 14 per DMAC. Signed-off-by: Niklas Söderlund Acked-by: Laurent Pinchart --- arch/arm/boot/dts/r8a7791.dtsi

[PATCH v5 4/9] arm: dma-mapping: add {map, unmap}_resource for iommu ops

2016-03-07 Thread Niklas Söderlund
Add methods to map/unmap device resources addresses for dma_map_ops that are IOMMU aware. This is needed to map a device MMIO register from a physical address. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- arch/arm/mm/dma-mapping.c | 63 ++

[PATCH v5 1/9] iommu: Add MMIO mapping type

2016-03-07 Thread Niklas Söderlund
From: Robin Murphy On some platforms, MMIO regions might need slightly different treatment compared to mapping regular memory; add the notion of MMIO mappings to the IOMMU API's memory type flags, so that callers can let the IOMMU drivers know to do the right thing. Signed-off-by: Robin Murphy

[PATCH v5 8/9] ARM: dts: r8a7790: add iommus to dmac0 and dmac1

2016-03-07 Thread Niklas Söderlund
A unconfirmed hardware bug prevents channel 0 and 15 to be used by the DMAC together with the IPMMU. The DMAC driver will disable the channels reducing the effective number of channels to 14 per DMAC. Signed-off-by: Niklas Söderlund Acked-by: Laurent Pinchart --- arch/arm/boot/dts/r8a7790.dtsi

[PATCH v5 0/9] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-03-07 Thread Niklas Söderlund
Hi, This series add iommu support to rcar-dmac. It's tested on Koelsch with CONFIG_IPMMU_VMSA and by enabling the ipmmu_ds node in r8a7791.dtsi. I verified operation by interacting with /dev/mmcblk1 and the serial console which both are devices behind the iommu. The series depends patch '[PATCH]

[PATCH v5 5/9] dmaengine: rcar-dmac: slave address are physical

2016-03-07 Thread Niklas Söderlund
Slave addresses coming from a client is physical not dma. Store the address using the correct data type. This is in preparation for hooking up the dma-mapping API to the slave addresses. Signed-off-by: Niklas Söderlund --- drivers/dma/sh/rcar-dmac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 d

[PATCH v5 7/9] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-03-07 Thread Niklas Söderlund
Enable slave transfers to a device behind a IPMMU by mapping the slave addresses using the dma-mapping API. Signed-off-by: Niklas Söderlund --- drivers/dma/sh/rcar-dmac.c | 82 +- 1 file changed, 74 insertions(+), 8 deletions(-) diff --git a/drivers/d

[PATCH v5 3/9] dma-mapping: add dma_{map,unmap}_resource

2016-03-07 Thread Niklas Söderlund
Map/Unmap a device resource from a physical address. If no dma_map_ops method is available the operation is a no-op. Signed-off-by: Niklas Söderlund --- include/linux/dma-mapping.h | 32 1 file changed, 32 insertions(+) diff --git a/include/linux/dma-mapping.h b

[PATCH v5 2/9] dma-mapping: add {map,unmap}_resource to dma_map_ops

2016-03-07 Thread Niklas Söderlund
Add methods to handle mapping of device resources from a physical address. This is needed for example to be able to map MMIO FIFO registers to a IOMMU. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- include/linux/dma-mapping.h | 6 ++ 1 file changed, 6 insertions(+) diff

[PATCH v5 6/9] dmaengine: rcar-dmac: group slave configuration

2016-03-07 Thread Niklas Söderlund
Group slave address and transfer size in own structs for source and destination. This is in preparation for hooking up the dma-mapping API to the slave addresses. Signed-off-by: Niklas Söderlund --- drivers/dma/sh/rcar-dmac.c | 38 ++ 1 file changed, 22 insert

Re: DMAR error messages after 'shutdown -r'.

2016-03-07 Thread Valdis . Kletnieks
(Sorry for the delay, $DAYJOB took a lot of cycles. Adding AHCI maintainers to cc:) On Tue, 16 Feb 2016 17:47:45 +0100, Joerg Roedel said: > On Tue, Feb 09, 2016 at 02:59:00PM -0500, Valdis Kletnieks wrote: > > [0.027629] Freeing SMP alternatives memory: 28K (8e111000 - > >

Re: [RFC v5 03/17] iommu: introduce a reserved iova cookie

2016-03-07 Thread Julien Grall
Hi Eric, On 01/03/16 18:27, Eric Auger wrote: diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 0e3b009..7b2bb94 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -1072,6 +1072,7 @@ static struct iommu_domain *__iommu_domain_alloc(struct bus_type *bus, do

[PATCH 6/7] iommu/fsl: PAMU power management support

2016-03-07 Thread Codrin Ciubotariu
From: Varun Sethi PAMU driver suspend and resume support. Signed-off-by: Varun Sethi Signed-off-by: Codrin Ciubotariu --- drivers/iommu/fsl_pamu.c | 155 +-- 1 file changed, 123 insertions(+), 32 deletions(-) diff --git a/drivers/iommu/fsl_pamu.c b

[PATCH 7/7] iommu/fsl: Added cache controller compatible strings for SOCs

2016-03-07 Thread Codrin Ciubotariu
From: Varun Sethi Added cache controller compatible strings for T2080, B4420, T1040 and T1024. PAMU driver searches for a matching string while setting up L3 cache stashing. Signed-off-by: Varun Sethi Signed-off-by: Codrin Ciubotariu --- drivers/iommu/fsl_pamu.c | 10 ++ 1 file change

[PATCH 5/7] iommu/fsl: Enable default DMA window for PCIe devices once detached from domain

2016-03-07 Thread Codrin Ciubotariu
From: Varun Sethi Once the PCIe device assigned to a guest VM (via VFIO) gets detached from the iommu domain (when guest terminates), its PAMU table entry is disabled. So, this would prevent the device from being used once it's assigned back to the host. This patch allows for creation of a defau

[PATCH 4/7] iommu/fsl: Factor out PCI specific code

2016-03-07 Thread Codrin Ciubotariu
From: Varun Sethi Factor out PCI specific code in the PAMU driver. Signed-off-by: Varun Sethi Signed-off-by: Codrin Ciubotariu --- drivers/iommu/fsl_pamu_domain.c | 77 ++--- 1 file changed, 41 insertions(+), 36 deletions(-) diff --git a/drivers/iommu/fsl_

[PATCH 3/7] iommu/fsl: Enable OMT cache, before invalidating PAACT and SPAACT cache

2016-03-07 Thread Codrin Ciubotariu
From: Varun Sethi Enable OMT cache, before invalidating PAACT and SPAACT cache. This is a PAMU hardware errata work around. Signed-off-by: Varun Sethi Signed-off-by: Codrin Ciubotariu --- drivers/iommu/fsl_pamu.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/iommu/fs

[PATCH 2/7] iommu/fsl: Work around erratum A-007907

2016-03-07 Thread Codrin Ciubotariu
Erratum A-007907 can cause a core hang under certain circumstances. Part of the workaround involves not stashing to L1 Cache. On affected chips, stash to L2 when L1 is requested. Signed-off-by: Scott Wood Signed-off-by: Varun Sethi Signed-off-by: Shengzhou Liu Signed-off-by: Codrin Ciubotariu

[PATCH 1/7] iommu/fsl: Fix most checkpatch warnings and typos

2016-03-07 Thread Codrin Ciubotariu
Signed-off-by: Codrin Ciubotariu --- drivers/iommu/fsl_pamu.c| 92 + drivers/iommu/fsl_pamu.h| 29 +++-- drivers/iommu/fsl_pamu_domain.c | 41 +++--- drivers/iommu/fsl_pamu_domain.h | 2 +- 4 files changed, 109 insertion

[PATCH 0/7] PAMU driver update

2016-03-07 Thread Codrin Ciubotariu
This patchset addresses a few issues found on PAMU IOMMU and small changes to enable power management and to support the L3 cache controller on some newer boards. The series starts with a clean-up patch, followed by two errata fixes: A-007907 and A-005982. It continues with two fixes for PCIe supp