Re: [PATCH V10 00/12] IOMMU probe deferral support

2017-04-04 Thread Rob Herring
On Tue, Apr 4, 2017 at 5:18 AM, 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

Re: [PATCH V3 0/5] iommu/arm-smmu: Add runtime pm/sleep support

2017-04-04 Thread Stephen Boyd
On 04/03, Will Deacon wrote: > On Fri, Mar 31, 2017 at 10:58:16PM -0400, Rob Clark wrote: > > On Fri, Mar 31, 2017 at 1:54 PM, Will Deacon wrote: > > > On Thu, Mar 09, 2017 at 09:05:43PM +0530, Sricharan R wrote: > > >> This series provides the support for turning on the arm-smmu's > > >> clocks/p

Re: [RFC] PCI ACS Flags Clarification

2017-04-04 Thread Alex Williamson
On Tue, 4 Apr 2017 14:47:58 -0400 Sinan Kaya wrote: > I'm looking for a guideline on how Access Control Services (ACS) need to be > implemented in HW for cases where peer to peer is and isn't supported. > > I see conflicting information in the code. > > iommu.c calls pci_acs_enabled() from pci

[RFC] PCI ACS Flags Clarification

2017-04-04 Thread Sinan Kaya
I'm looking for a guideline on how Access Control Services (ACS) need to be implemented in HW for cases where peer to peer is and isn't supported. I see conflicting information in the code. iommu.c calls pci_acs_enabled() from pci_device_group() to determine if ACS path is enabled for the follow

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

2017-04-04 Thread Robin Murphy
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 Broadcom Vulcan earlier), the PCI >>> topology is slightly unusual. For a multi-node system, it looks like

Re: [PATCH V10 00/12] IOMMU probe deferral support

2017-04-04 Thread Robin Murphy
On 04/04/17 11:18, 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 07/12] of/acpi: Configure dma operations at probe time for platform/amba/pci bus devices

2017-04-04 Thread Sricharan R
Hi Robin, On 4/4/2017 5:47 PM, Robin Murphy wrote: On 04/04/17 11:18, Sricharan R wrote: 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

Re: [PATCH V10 07/12] of/acpi: Configure dma operations at probe time for platform/amba/pci bus devices

2017-04-04 Thread Robin Murphy
On 04/04/17 11:18, Sricharan R wrote: > 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, configur

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

2017-04-04 Thread Jayachandran C
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 Broadcom Vulcan earlier), the PCI > > topology is slightly unusual. For a multi-node system, it looks like: > > > > [node level PCI bridges - one per

Re: [PATCH V10 12/12] ACPI/IORT: Remove linker section for IORT entries probing

2017-04-04 Thread Robin Murphy
On 04/04/17 11:18, Sricharan R wrote: > 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 devi

Re: [PATCH V10 09/12] drivers: acpi: Handle IOMMU lookup failure with deferred probing or error

2017-04-04 Thread Robin Murphy
On 04/04/17 11:18, Sricharan R wrote: > 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 ha

Re: [PATCH V10 08/12] iommu: of: Handle IOMMU lookup failure with deferred probing or error

2017-04-04 Thread Robin Murphy
On 04/04/17 11:18, Sricharan R wrote: > 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 drive

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

2017-04-04 Thread Robin Murphy
On 04/04/17 11:18, Sricharan R wrote: > 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 > passs

Re: [PATCH V10 05/12] ACPI/IORT: Add function to check SMMUs drivers presence

2017-04-04 Thread Robin Murphy
On 04/04/17 11:18, Sricharan R wrote: > 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 p

Re: [PATCH V10 04/12] of: dma: Make of_dma_deconfigure() public

2017-04-04 Thread Robin Murphy
On 04/04/17 11:18, Sricharan R wrote: > 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 i

Re: [PATCH V10 03/12] of: dma: Move range size workaround to of_dma_get_range()

2017-04-04 Thread Robin Murphy
On 04/04/17 11:18, Sricharan R wrote: > From: Laurent Pinchart > > Invalid dma-ranges values should be worked around when retrieving the > DMA range in of_dma_get_range(), not by all callers of the function. > This isn't much of a problem now that we have a single caller, but that > situation wil

[PATCH V10 11/12] iommu/arm-smmu: Clean up early-probing workarounds

2017-04-04 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 V10 12/12] ACPI/IORT: Remove linker section for IORT entries probing

2017-04-04 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 V10 09/12] drivers: acpi: Handle IOMMU lookup failure with deferred probing or error

2017-04-04 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,

[PATCH V10 10/12] arm64: dma-mapping: Remove the notifier trick to handle early setting of dma_ops

2017-04-04 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 V10 08/12] iommu: of: Handle IOMMU lookup failure with deferred probing or error

2017-04-04 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 V10 02/12] iommu/of: Prepare for deferred IOMMU configuration

2017-04-04 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 V10 05/12] ACPI/IORT: Add function to check SMMUs drivers presence

2017-04-04 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 V10 03/12] of: dma: Move range size workaround to of_dma_get_range()

2017-04-04 Thread Sricharan R
From: Laurent Pinchart Invalid dma-ranges values should be worked around when retrieving the DMA range in of_dma_get_range(), not by all callers of the function. This isn't much of a problem now that we have a single caller, but that situation will change when moving DMA configuration to device p

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

2017-04-04 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 V10 04/12] of: dma: Make of_dma_deconfigure() public

2017-04-04 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 Signed-off-by: La

[PATCH V10 07/12] of/acpi: Configure dma operations at probe time for platform/amba/pci bus devices

2017-04-04 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 V10 01/12] iommu/of: Refactor of_iommu_configure() for error handling

2017-04-04 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 V10 00/12] IOMMU probe deferral support

2017-04-04 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