Re: [PATCH v4 4/6] of/pci: add of_pci_dma_configure() update dma configuration

2015-01-27 Thread Murali Karicheri
On 01/26/2015 06:59 PM, Bjorn Helgaas wrote: On Mon, Jan 26, 2015 at 5:25 PM, Murali Karicherim-kariche...@ti.com wrote: On 01/23/2015 06:41 PM, Bjorn Helgaas wrote: On Fri, Jan 23, 2015 at 05:32:37PM -0500, Murali Karicheri wrote: Add of_pci_dma_configure() to allow updating the dma

Re: [PATCH v4 3/6] of: fix size when dma-range is not used

2015-01-27 Thread Murali Karicheri
On 01/27/2015 06:27 AM, Robin Murphy wrote: Hi Murali, On 23/01/15 22:32, Murali Karicheri wrote: Fix the dma-range size when the DT attribute is missing. i.e set size to dev-coherent_dma_mask + 1 instead of dev-coherent_dma_mask. To detect overflow when mask is set to max of u64, add a check,

Re: [PATCH v4 4/6] of/pci: add of_pci_dma_configure() update dma configuration

2015-01-27 Thread Murali Karicheri
On 01/27/2015 01:42 PM, Bjorn Helgaas wrote: On Tue, Jan 27, 2015 at 12:14 PM, Murali Karicherim-kariche...@ti.com wrote: On 01/26/2015 06:59 PM, Bjorn Helgaas wrote: On Mon, Jan 26, 2015 at 5:25 PM, Murali Karicherim-kariche...@ti.com wrote: On 01/23/2015 06:41 PM, Bjorn Helgaas wrote:

Re: [PATCH v4 4/6] of/pci: add of_pci_dma_configure() update dma configuration

2015-01-27 Thread Bjorn Helgaas
On Tue, Jan 27, 2015 at 12:14 PM, Murali Karicheri m-kariche...@ti.com wrote: On 01/26/2015 06:59 PM, Bjorn Helgaas wrote: On Mon, Jan 26, 2015 at 5:25 PM, Murali Karicherim-kariche...@ti.com wrote: On 01/23/2015 06:41 PM, Bjorn Helgaas wrote: On Fri, Jan 23, 2015 at 05:32:37PM -0500,

[PATCH v5 6/8] PCI: update dma configuration from DT

2015-01-27 Thread Murali Karicheri
If there is a DT node available for the root bridge's parent device, use the dma configuration from that device node. For example, keystone PCI devices would require dma_pfn_offset to be set correctly in the device structure of the pci device in order to have the correct dma mask. The DT node will

[PATCH v5 7/8] arm: dma-mapping: limit iommu mapping size

2015-01-27 Thread Murali Karicheri
arm_iommu_create_mapping() has size parameter of size_t and arm_setup_iommu_dma_ops() can take a value higher than that when this is called from the of code. So limit the size to SIZE_MAX. Cc: Joerg Roedel j...@8bytes.org Cc: Grant Likely grant.lik...@linaro.org Cc: Rob Herring robh...@kernel.org

[PATCH v5 5/8] of/pci: add of_pci_dma_configure() update dma configuration

2015-01-27 Thread Murali Karicheri
Add of_pci_dma_configure() to allow updating the dma configuration of the pci device using the configuration from DT of the parent of the root bridge device. Use the newly added APIs pci_get/put_host_bridge_device() for implementing this. Cc: Joerg Roedel j...@8bytes.org Cc: Grant Likely

[PATCH v5 8/8] of: limit dma_mask of the device based on dma-range size

2015-01-27 Thread Murali Karicheri
limit the device dma_mask to the min of default dma_mask and mask calculate from the dma-range size. Cc: Joerg Roedel j...@8bytes.org Cc: Grant Likely grant.lik...@linaro.org Cc: Rob Herring robh...@kernel.org Cc: Bjorn Helgaas bhelg...@google.com Cc: Will Deacon will.dea...@arm.com Cc: Russell

[PATCH v5 4/8] PCI: add helper functions pci_get[put]_host_bridge_device()

2015-01-27 Thread Murali Karicheri
Add a helper function to get/put the root bus's host bridge device. Cc: Joerg Roedel j...@8bytes.org Cc: Grant Likely grant.lik...@linaro.org Cc: Rob Herring robh...@kernel.org Cc: Will Deacon will.dea...@arm.com Cc: Russell King li...@arm.linux.org.uk Cc: Arnd Bergmann a...@arndb.de Cc: Suravee

[PATCH v5 1/8] of: iommu: add ptr to OF node arg to of_iommu_configure()

2015-01-27 Thread Murali Karicheri
Function of_iommu_configure() is called from of_dma_configure() to setup iommu ops using DT property. This API is currently used for platform devices for which DMA configuration (including iommu ops) may come from device's parent. To extend this functionality for PCI devices, this API need to take

[PATCH v5 3/8] of: fix size when dma-range is not used

2015-01-27 Thread Murali Karicheri
Fix the dma-range size when the DT attribute is missing. i.e set size to dev-coherent_dma_mask + 1 instead of dev-coherent_dma_mask. Also add code to check invalid values of size configured in DT and log error. Cc: Joerg Roedel j...@8bytes.org Cc: Grant Likely grant.lik...@linaro.org Cc: Rob

Re: [PATCH URGENT] arm: dma-mapping: Set DMA IOMMU ops in arm_iommu_attach_device()

2015-01-27 Thread Heiko Stübner
Hi Arnd, Olof, Am Freitag, 23. Januar 2015, 16:21:49 schrieb Laurent Pinchart: Commit 4bb25789ed28228a (arm: dma-mapping: plumb our iommu mapping ops into arch_setup_dma_ops) moved the setting of the DMA operations from arm_iommu_attach_device() to arch_setup_dma_ops() where the DMA

[Patch Part2 v4] x86/irq: Kill x86_io_apic_ops.eoi_ioapic_pin and related interfaces

2015-01-27 Thread Jiang Liu
Now there is no user of x86_io_apic_ops.eoi_ioapic_pin anymore, so kill it. Signed-off-by: Jiang Liu jiang@linux.intel.com Cc: Konrad Rzeszutek Wilk konrad.w...@oracle.com Cc: Tony Luck tony.l...@intel.com Cc: Greg Kroah-Hartman gre...@linuxfoundation.org Cc: iommu@lists.linux-foundation.org

Re: [PATCH v4 6/6] arm: dma-mapping: updates to limit dma_mask and iommu mapping size

2015-01-27 Thread Murali Karicheri
On 01/27/2015 06:34 AM, Catalin Marinas wrote: On Tue, Jan 27, 2015 at 11:12:32AM +, Robin Murphy wrote: On 23/01/15 22:32, Murali Karicheri wrote: Limit the dma_mask to minimum of dma_mask and dma_base + size - 1. Also arm_iommu_create_mapping() has size parameter of size_t and

Re: [PATCH 4/4] iommu/fsl: Use %pa to print phys_addr_t

2015-01-27 Thread Emil Medve
Hello Joerg, On 01/26/2015 05:50 PM, Joerg Roedel wrote: From: Joerg Roedel jroedel-l3a5bk7w...@public.gmane.org Fix two compile warnings. Signed-off-by: Joerg Roedel jroedel-l3a5bk7w...@public.gmane.org --- drivers/iommu/fsl_pamu.c | 4 ++-- 1 file changed, 2 insertions(+), 2

Re: [PATCH 4/4] iommu/fsl: Use %pa to print phys_addr_t

2015-01-27 Thread Joerg Roedel
On Tue, Jan 27, 2015 at 04:40:35AM -0600, Emil Medve wrote: Hello Joerg, On 01/26/2015 05:50 PM, Joerg Roedel wrote: From: Joerg Roedel jroedel-l3a5bk7w...@public.gmane.org Fix two compile warnings. Signed-off-by: Joerg Roedel jroedel-l3a5bk7w...@public.gmane.org ---

Re: [PATCH v4 3/6] of: fix size when dma-range is not used

2015-01-27 Thread Robin Murphy
Hi Murali, On 23/01/15 22:32, Murali Karicheri wrote: Fix the dma-range size when the DT attribute is missing. i.e set size to dev-coherent_dma_mask + 1 instead of dev-coherent_dma_mask. To detect overflow when mask is set to max of u64, add a check, log error and return. Some platform use

Re: [PATCH v4 6/6] arm: dma-mapping: updates to limit dma_mask and iommu mapping size

2015-01-27 Thread Catalin Marinas
On Tue, Jan 27, 2015 at 11:12:32AM +, Robin Murphy wrote: On 23/01/15 22:32, Murali Karicheri wrote: Limit the dma_mask to minimum of dma_mask and dma_base + size - 1. Also arm_iommu_create_mapping() has size parameter of size_t and arm_setup_iommu_dma_ops() can take a value higher

Re: [PATCH v4 6/6] arm: dma-mapping: updates to limit dma_mask and iommu mapping size

2015-01-27 Thread Robin Murphy
Hi Murali, On 23/01/15 22:32, Murali Karicheri wrote: Limit the dma_mask to minimum of dma_mask and dma_base + size - 1. Also arm_iommu_create_mapping() has size parameter of size_t and arm_setup_iommu_dma_ops() can take a value higher than that. So limit the size to SIZE_MAX. Signed-off-by:

RE: [v3 00/26] Add VT-d Posted-Interrupts support

2015-01-27 Thread Wu, Feng
-Original Message- From: Alex Williamson [mailto:alex.william...@redhat.com] Sent: Wednesday, January 28, 2015 11:44 AM To: Wu, Feng Cc: t...@linutronix.de; mi...@redhat.com; h...@zytor.com; x...@kernel.org; g...@kernel.org; pbonz...@redhat.com; dw...@infradead.org;

Re: [RFC PATCH 3/5] iommu: implement common IOMMU ops for DMA mapping

2015-01-27 Thread Robin Murphy
Hi Joerg, On 27/01/15 00:21, Joerg Roedel wrote: Hi Robin, thanks for the patch, I think it is good start to move forward. See my comments below. On Mon, Jan 12, 2015 at 08:48:55PM +, Robin Murphy wrote: Taking inspiration from the existing arch/arm code, break out some generic functions

Re: [RFC PATCH 3/5] iommu: implement common IOMMU ops for DMA mapping

2015-01-27 Thread Joerg Roedel
On Tue, Jan 27, 2015 at 12:27:39PM +, Robin Murphy wrote: Laz^WPragmatism - I'm expecting quite a lot of changes to get this looking good, so keeping the series as lean as possible to aid reviewing/rebasing/etc. seemed sensible. In the same vein, since the other architectures already have

Re: [PATCH v4 3/6] of: fix size when dma-range is not used

2015-01-27 Thread Murali Karicheri
On 01/27/2015 06:27 AM, Robin Murphy wrote: Hi Murali, On 23/01/15 22:32, Murali Karicheri wrote: Fix the dma-range size when the DT attribute is missing. i.e set size to dev-coherent_dma_mask + 1 instead of dev-coherent_dma_mask. To detect overflow when mask is set to max of u64, add a check,

[PATCH v1 1/3] xgene-ahbc-iommu: Add support for APM X-Gene SoC AHBC IOMMU driver.

2015-01-27 Thread Suman Tripathi
This patch adds the support for the APM X-Gene SoC AHBC IOMMU driver. This driver translates the 32-bit AHB address from the dma master to 42-bit AXI address with the help of a set of AHBC inbound mapper (AIM) registers. The AHB dma master for slaves, eg: sdhci etc, will use this driver to do a

[PATCH v1 2/3] arm64: dts: Add the APM X-Gene AHBC IOMMU DTS node.

2015-01-27 Thread Suman Tripathi
This patch adds the device tree node for APM X-Gene AHBC IOMMU and master node as SDHCI. Signed-off-by: Suman Tripathi stripa...@apm.com --- arch/arm64/boot/dts/apm-storm.dtsi | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/boot/dts/apm-storm.dtsi

[PATCH v1 3/3] Documentation: dt-bindings: Add the binding info for APM X-Gene AHBC IOMMU driver.

2015-01-27 Thread Suman Tripathi
This patch adds the device tree binding information for X-Gene AHBC IOMMU driver. Signed-off-by: Suman Tripathi stripa...@apm.com --- .../devicetree/bindings/iommu/xgene,ahbc-iommu.txt | 31 ++ 1 file changed, 31 insertions(+) create mode 100644

[PATCH 6/6] dmaengine: rcar-dmac: Disable channel 0 when using IOMMU

2015-01-27 Thread Laurent Pinchart
A still unconfirmed hardware bug prevents the IPMMU microTLB 0 to be flushed correctly, resulting in memory corruption. DMAC 0 channel 0 is connected to microTLB 0 on currently supported platforms, so we can't use it with the IPMMU. As the IOMMU API operates at the device level we can't disable it

[PATCH v1 0/3] Add support for APM X-Gene SoC AHBC IOMMU driver.

2015-01-27 Thread Suman Tripathi
This patch adds the support for the APM X-Gene SoC AHBC IOMMU driver. v1 change: * Change the binding info as per Arnd comments. Signed-off-by: Suman Tripathi stripa...@apm.com --- Suman Tripathi (3): xgene-ahbc-iommu: Add support for APM X-Gene SoC AHBC IOMMU driver. arm64: dts: Add the

Re: [RFC PATCH 4/5] arm64: add IOMMU dma_ops

2015-01-27 Thread Robin Murphy
Hi Joseph, Thanks for giving it a spin, On 26/01/15 03:25, Joseph Lo wrote: On 01/13/2015 04:48 AM, Robin Murphy wrote: Taking some inspiration from the arch/arm code, implement the arch-specific side of the DMA mapping ops using the new IOMMU-DMA layer. Signed-off-by: Robin Murphy

Re: [RFC PATCH 4/5] arm64: add IOMMU dma_ops

2015-01-27 Thread Joseph Lo
Hi Robin Sorry for separate the comments into many replies. On 01/13/2015 04:48 AM, Robin Murphy wrote: Taking some inspiration from the arch/arm code, implement the arch-specific side of the DMA mapping ops using the new IOMMU-DMA layer. Signed-off-by: Robin Murphy robin.mur...@arm.com ---

RE: [v3 00/26] Add VT-d Posted-Interrupts support

2015-01-27 Thread Wu, Feng
-Original Message- From: Wu, Feng Sent: Wednesday, January 21, 2015 10:26 AM To: t...@linutronix.de; mi...@redhat.com; h...@zytor.com; x...@kernel.org; g...@kernel.org; pbonz...@redhat.com; dw...@infradead.org; j...@8bytes.org; alex.william...@redhat.com; jiang@linux.intel.com

Re: [PATCH v5 3/8] of: fix size when dma-range is not used

2015-01-27 Thread Rob Herring
On Tue, Jan 27, 2015 at 3:00 PM, Murali Karicheri m-kariche...@ti.com wrote: Fix the dma-range size when the DT attribute is missing. i.e set size to dev-coherent_dma_mask + 1 instead of dev-coherent_dma_mask. Also add code to check invalid values of size configured in DT and log error. Cc:

Re: [v3 00/26] Add VT-d Posted-Interrupts support

2015-01-27 Thread Alex Williamson
On Wed, 2015-01-28 at 03:01 +, Wu, Feng wrote: -Original Message- From: Wu, Feng Sent: Wednesday, January 21, 2015 10:26 AM To: t...@linutronix.de; mi...@redhat.com; h...@zytor.com; x...@kernel.org; g...@kernel.org; pbonz...@redhat.com; dw...@infradead.org;

Re: [PATCH v5 1/8] of: iommu: add ptr to OF node arg to of_iommu_configure()

2015-01-27 Thread Rob Herring
On Tue, Jan 27, 2015 at 2:59 PM, Murali Karicheri m-kariche...@ti.com wrote: Function of_iommu_configure() is called from of_dma_configure() to setup iommu ops using DT property. This API is currently used for platform devices for which DMA configuration (including iommu ops) may come from

Re: [PATCH v5 5/8] of/pci: add of_pci_dma_configure() update dma configuration

2015-01-27 Thread Rob Herring
On Tue, Jan 27, 2015 at 3:00 PM, Murali Karicheri m-kariche...@ti.com wrote: Add of_pci_dma_configure() to allow updating the dma configuration of the pci device using the configuration from DT of the parent of the root bridge device. Use the newly added APIs pci_get/put_host_bridge_device()