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; > j...@8by

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; > > j.

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

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 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() for implementing

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 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: Joerg Roedel

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 --- arch/arm64/include/a

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 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 device's parent. To

[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 Cc: Konrad Rzeszutek Wilk Cc: Tony Luck Cc: Greg Kroah-Hartman Cc: iommu@lists.linux-foundation.org Cc: Bjorn Helgaas Cc: Benjamin Herrenschmidt Cc: Rafael J. Wysocki Cc: Randy Dunlap Cc: Y

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

[PATCH v5 2/8] of: move of_dma_configure() to device.c to help re-use

2015-01-27 Thread Murali Karicheri
Move of_dma_configure() to device.c so that same function can be re-used for PCI devices to obtain DMA configuration from DT. Also add a second argument so that for PCI, DT node of root bus host bridge can be used to obtain the DMA configuration for the slave PCI device. Cc: Joerg Roedel Cc: Gran

[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 Cc: Grant Likely Cc: Rob Herring Cc: Bjorn Helgaas Cc: Will Dea

[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 Cc: Grant Likely Cc: Rob Herring Cc: Will Deacon Cc: Russell King Cc: Arnd Bergmann Cc: Suravee Suthikulpanit Acked-by: Bjorn Helgaas Signed-off-by: Murali Karicheri --- drivers/pci/host-bridge.c | 14

[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 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 Cc: Grant Likely Cc: Rob Herring Cc: Wi

[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 Cc: Grant Likely Cc: Rob Herring Cc: Bjorn Helgaas Cc: Will Deacon Cc: Russell King Cc: Arnd Bergmann Cc: Suravee Suthikulpanit Signed-off-by: Murali Karicheri --- drive

[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 Cc: Grant Likely Cc: Rob Herring Cc: Bjorn Helgaas Cc: Will Deacon Cc: Russell King Cc

[PATCH v5 0/8] PCI: get DMA configuration from parent device

2015-01-27 Thread Murali Karicheri
PCI devices on Keystone doesn't have correct dma_pfn_offset set. This patch add capability to set the dma configuration such as dma-mask, dma_pfn_offset, and dma ops etc using the information from DT. The prior RFCs and discussions are available at [1] and [2] below. [2] : https://www.mail-archive

[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

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 Karicheri wrote: On 01/26/2015 06:59 PM, Bjorn Helgaas wrote: On Mon, Jan 26, 2015 at 5:25 PM, Murali Karicheri wrote: On 01/23/2015 06:41 PM, Bjorn Helgaas wrote: On Fri, Jan 23, 2015 at 05:32:37PM -05

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 wrote: > On 01/26/2015 06:59 PM, Bjorn Helgaas wrote: >> >> On Mon, Jan 26, 2015 at 5:25 PM, Murali Karicheri >> wrote: >>> >>> On 01/23/2015 06:41 PM, Bjorn Helgaas wrote: On Fri, Jan 23, 2015 at 05:32:37PM -0500, Murali Karicheri

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 Karicheri 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 configuration of the pci

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

[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 --- .../devicetree/bindings/iommu/xgene,ahbc-iommu.txt | 31 ++ 1 file changed, 31 insertions(+) create mode 100644 Documentation/devicetree/bindings/iommu/xgene,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 --- arch/arm64/boot/dts/apm-storm.dtsi | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/boot/dts/apm-storm.dtsi b/arch/arm64/boot/dts/apm-storm.dtsi index

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

[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 --- Suman Tripathi (3): xgene-ahbc-iommu: Add support for APM X-Gene SoC AHBC IOMMU driver. arm64: dts: Add the APM X-Gene AHBC IOM

[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

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

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 ha

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

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 ma

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: M

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 > > > > Fix two compile warnings. > > > > Signed-off-by: Joerg Roedel > > --- > > drivers/iommu/fsl_pamu.c | 4 ++-- > > 1 file changed, 2 inser

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 > > Fix two compile warnings. > > Signed-off-by: Joerg Roedel > --- > drivers/iommu/fsl_pamu.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/