Re: [RFC PATCH 01/30] iommu/arm-smmu-v3: Link groups and devices

2017-04-10 Thread Jean-Philippe Brucker
On 27/03/17 13:18, Robin Murphy wrote: > Hi Jean-Philippe, > > On 27/02/17 19:54, Jean-Philippe Brucker wrote: >> Reintroduce smmu_group. This structure was removed during the generic DT >> bindings rework, but will be needed when implementing PCIe ATS, to lookup >> devices attached to a given dom

[PATCH V11 01/11] iommu/of: Refactor of_iommu_configure() for error handling

2017-04-10 Thread Sricharan R
From: Robin Murphy In preparation for some upcoming cleverness, rework the control flow in of_iommu_configure() to minimise duplication and improve the propogation of errors. It's also as good a time as any to switch over from the now-just-a-compatibility-wrapper of_iommu_get_ops() to using the g

[PATCH V11 02/11] iommu/of: Prepare for deferred IOMMU configuration

2017-04-10 Thread Sricharan R
From: Robin Murphy IOMMU configuration represents unchanging properties of the hardware, and as such should only need happen once in a device's lifetime, but the necessary interaction with the IOMMU device and driver complicates exactly when that point should be. Since the only reasonable tool a

[PATCH V11 03/11] of: dma: Make of_dma_deconfigure() public

2017-04-10 Thread Sricharan R
From: Laurent Pinchart As part of moving DMA initializing to probe time the of_dma_deconfigure() function will need to be called from different source files. Make it public and move it to drivers/of/device.c where the of_dma_configure() function is. Tested-by: Marek Szyprowski Reviewed-by: Robi

[PATCH V11 00/11] IOMMU probe deferral support

2017-04-10 Thread Sricharan R
This series calls the dma ops configuration for the devices at a generic place so that it works for all busses. The dma_configure_ops for a device is now called during the device_attach callback just before the probe of the bus/driver is called. Similarly dma_deconfigure is called during device/dri

[PATCH V11 10/11] iommu/arm-smmu: Clean up early-probing workarounds

2017-04-10 Thread Sricharan R
From: Robin Murphy Now that the appropriate ordering is enforced via probe-deferral of masters in core code, rip it all out and bask in the simplicity. Tested-by: Hanjun Guo Acked-by: Will Deacon Signed-off-by: Robin Murphy [Sricharan: Rebased on top of ACPI IORT SMMU series] Signed-off-by: S

[PATCH V11 11/11] ACPI/IORT: Remove linker section for IORT entries probing

2017-04-10 Thread Sricharan R
From: Lorenzo Pieralisi The IORT linker section introduced by commit 34ceea275f62 ("ACPI/IORT: Introduce linker section for IORT entries probing") was needed to make sure SMMU drivers are registered (and therefore probed) in the kernel before devices using the SMMU have a chance to probe in turn.

[PATCH V11 05/11] of: device: Fix overflow of coherent_dma_mask

2017-04-10 Thread Sricharan R
Size of the dma-range is calculated as coherent_dma_mask + 1 and passed to arch_setup_dma_ops further. It overflows when the coherent_dma_mask is set for full 64 bits 0x, resulting in size getting passed as 0 wrongly. Fix this by passsing in max(mask, mask + 1). Note that in this ca

[PATCH V11 07/11] iommu: of: Handle IOMMU lookup failure with deferred probing or error

2017-04-10 Thread Sricharan R
From: Laurent Pinchart Failures to look up an IOMMU when parsing the DT iommus property need to be handled separately from the .of_xlate() failures to support deferred probing. The lack of a registered IOMMU can be caused by the lack of a driver for the IOMMU, the IOMMU device probe not having b

[PATCH V11 09/11] arm64: dma-mapping: Remove the notifier trick to handle early setting of dma_ops

2017-04-10 Thread Sricharan R
With arch_setup_dma_ops now being called late during device's probe after the device's iommu is probed, the notifier trick required to handle the early setup of dma_ops before the iommu group gets created is not required. So removing the notifier's here. Tested-by: Marek Szyprowski Tested-by: Han

[PATCH V11 06/11] of/acpi: Configure dma operations at probe time for platform/amba/pci bus devices

2017-04-10 Thread Sricharan R
Configuring DMA ops at probe time will allow deferring device probe when the IOMMU isn't available yet. The dma_configure for the device is now called from the generic device_attach callback just before the bus/driver probe is called. This way, configuring the DMA ops for the device would be called

[PATCH V11 04/11] ACPI/IORT: Add function to check SMMUs drivers presence

2017-04-10 Thread Sricharan R
From: Lorenzo Pieralisi The IOMMU probe deferral implementation requires a mechanism to detect if drivers for SMMU components are built-in in the kernel to detect whether IOMMU configuration for a given device should be deferred (ie SMMU drivers present but still not probed) or not (drivers not p

[PATCH V11 08/11] drivers: acpi: Handle IOMMU lookup failure with deferred probing or error

2017-04-10 Thread Sricharan R
This is an equivalent to the DT's handling of the iommu master's probe with deferred probing when the corrsponding iommu is not probed yet. The lack of a registered IOMMU can be caused by the lack of a driver for the IOMMU, the IOMMU device probe not having been performed yet, having been deferred,

Re: [PATCH v4 2/2] PCI: quirks: Fix ThunderX2 dma alias handling

2017-04-10 Thread Jayachandran C
[Moving Bjorn back to to: ] On Tue, Apr 04, 2017 at 03:28:26PM +0100, Robin Murphy wrote: > On 04/04/17 12:50, Jayachandran C wrote: > > On Mon, Apr 03, 2017 at 04:07:53PM +0100, Robin Murphy wrote: > >> On 03/04/17 14:15, Jayachandran C wrote: > >>> The Cavium ThunderX2 arm64 SoCs (called Broadco

Re: [PATCH V11 00/11] IOMMU probe deferral support

2017-04-10 Thread Frank Rowand
On 04/10/17 04:20, Sricharan R wrote: > This series calls the dma ops configuration for the devices > at a generic place so that it works for all busses. > The dma_configure_ops for a device is now called during > the device_attach callback just before the probe of the > bus/driver is called. Simil

Re: [PATCH V10 06/12] of: device: Fix overflow of coherent_dma_mask

2017-04-10 Thread Robin Murphy
On 08/04/17 00:13, Frank Rowand wrote: > On 04/07/17 07:46, Robin Murphy wrote: >> On 06/04/17 20:34, Frank Rowand wrote: >>> On 04/06/17 04:01, Sricharan R wrote: Hi Frank, On 4/6/2017 12:31 PM, Frank Rowand wrote: > On 04/04/17 03:18, Sricharan R wrote: >> Size of the dma-r

Re: [virtio-dev] Re: [RFC 0/3] virtio-iommu: a paravirtualized IOMMU

2017-04-10 Thread Jean-Philippe Brucker
On 07/04/17 22:19, Michael S. Tsirkin wrote: > On Fri, Apr 07, 2017 at 08:17:44PM +0100, Jean-Philippe Brucker wrote: >> There are a number of advantages in a paravirtualized IOMMU over a full >> emulation. It is portable and could be reused on different architectures. >> It is easier to implement

Re: [virtio-dev] Re: [RFC 0/3] virtio-iommu: a paravirtualized IOMMU

2017-04-10 Thread Michael S. Tsirkin
On Mon, Apr 10, 2017 at 07:39:24PM +0100, Jean-Philippe Brucker wrote: > On 07/04/17 22:19, Michael S. Tsirkin wrote: > > On Fri, Apr 07, 2017 at 08:17:44PM +0100, Jean-Philippe Brucker wrote: > >> There are a number of advantages in a paravirtualized IOMMU over a full > >> emulation. It is portabl

Re: [PATCH v4 2/2] PCI: quirks: Fix ThunderX2 dma alias handling

2017-04-10 Thread Bjorn Helgaas
Hi Jayachandran, On Mon, Apr 03, 2017 at 01:15:04PM +, Jayachandran C wrote: > The Cavium ThunderX2 arm64 SoCs (called Broadcom Vulcan earlier), the PCI > topology is slightly unusual. For a multi-node system, it looks like: > > [node level PCI bridges - one per node] > [SoC PCI devices w