RE: [RESEND PATCH V6 0/6] Add support for privileged mappings

2016-12-03 Thread Sricharan
Hi Robin, >Hi Sricharan, > >On 02/12/16 14:55, Sricharan R wrote: >> This series is a resend of the V5 that Mitch sent sometime back [2] >> All the patches are the same and i have just rebased. Not sure why this >> finally did not make it last time. The last patch in

RE: [PATCH v9 07/16] drivers: acpi: implement acpi_dma_configure

2016-12-05 Thread Sricharan
ss_ of what they really are, though >> arguably acpi_bind_one() touches ways more devices. >> >> I really think that removing the default dma masks settings from >> acpi_dma_configure() is the safer thing to do for the time being (or >> moving acpi_dma_configure() to acpi_create_platform_device(), where the >> DMA masks are set-up by default by core ACPI. Mark, Suravee, what was >> the rationale behind calling arch_setup_dma_ops() in acpi_bind_one() ?) > >Alternatively, you can add one more arch wrapper that will be a no-op >on x86 and that will set up the default masks and call >arch_setup_dma_ops() on ARM. Then, you can invoke that from >acpi_dma_configure(). > >Or make the definition of acpi_dma_configure() itself depend on the >architecture. > So is it better that either removing the masks from acpi_dma_configure (or) creating the wrapper as Rafael mentioned, than moving acpi_dma_configure itself , because with something like iommu probe deferral that is tried, acpi_dma_configure is getting invoked from a device's really_probe, a different path again ? Regards, Sricharan ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

RE: [RESEND PATCH V6 0/6] Add support for privileged mappings

2016-12-07 Thread Sricharan
Hi Robin, >>> Hi Sricharan, >>> >>> On 02/12/16 14:55, Sricharan R wrote: >>>> This series is a resend of the V5 that Mitch sent sometime back [2] >>>> All the patches are the same and i have just rebased. Not sure why this >>>> fi

RE: [PATCH 3/4] iommu/arm-smmu: Disable stalling faults for all endpoints

2016-12-10 Thread Sricharan
s welcome.. >> in between debugging freedreno I'll try to put together some patches. > >From what I can tell we need SCTLR_CFCFG to make the stall happen otherwise >the operation just gets terminated immediately and *then* we get notification >but by then the system keeps going. > Yes thats right, SCTLR_CFCFG was removed as a part of this patch. >I think SCTLR_HUPCF helps control that behavior (i.e. we don't go off faulting >through eternity) but I don't know how it works. > >From my very unlearned understanding I think we do want to set CFCFG and then >stall and let the interrupt handler decide to retry/terminate. Yes, infact i was thinking of adding this as a new patch, but now that this was a reverted one. As you said, it would be good to know the hw which was having problem with this and probably having this has a quirk otherwise. Also i see that FSR_SS is implemented by the qcom and the downstream code uses it. Regards, Sricharan ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

RE: [RESEND PATCH V6 0/6] Add support for privileged mappings

2016-12-12 Thread Sricharan
Hi Robin, >Hi Robin, > >>>> Hi Sricharan, >>>> >>>> On 02/12/16 14:55, Sricharan R wrote: >>>>> This series is a resend of the V5 that Mitch sent sometime back [2] >>>>> All the patches are the same and i have just reba

RE: [PATCH V7 5/8] arm64/dma-mapping: Implement DMA_ATTR_PRIVILEGED

2016-12-13 Thread Sricharan
Hi Robin, >-Original Message- >From: linux-arm-kernel [mailto:linux-arm-kernel-boun...@lists.infradead.org] >On Behalf Of Robin Murphy >Sent: Tuesday, December 13, 2016 7:33 PM >To: Sricharan R ; jcro...@codeaurora.org; >pd...@codeaurora.org; jgeb...@codeaurora.org

RE: [PATCH V7 5/8] arm64/dma-mapping: Implement DMA_ATTR_PRIVILEGED

2016-12-13 Thread Sricharan
Hi, > >On 13/12/16 14:38, Sricharan wrote: >> Hi Robin, >> >>> -Original Message- >>> From: linux-arm-kernel >>> [mailto:linux-arm-kernel-boun...@lists.infradead.org] On Behalf Of Robin >>> Murphy >>> Sent: Tuesday, Decembe

RE: [PATCH V7 5/8] arm64/dma-mapping: Implement DMA_ATTR_PRIVILEGED

2016-12-13 Thread Sricharan
pis in arm as to be modified to pass the PRIVILIGED attributes as well. While my testing path was using the iommu_map directly i was not seeing this, but then i did a patch like below. I will just figure out another other codebase where the master uses the dma apis, test and add it in the V8 that i would

RE: [PATCH 3/4] iommu/arm-smmu: Disable stalling faults for all endpoints

2016-12-19 Thread Sricharan
hink that means we want both specific compatible strings to identify >the SS bit behaviour, but also a way to opt-in for the stall model as a >separate property to indicate that the SoC integration can support this >without e.g. deadlocking. > To understand the reason on the need for t

RE: [PATCH V7 5/8] arm64/dma-mapping: Implement DMA_ATTR_PRIVILEGED

2017-01-02 Thread Sricharan
ot missed anything else, realized that the >> dma-mapping apis in arm as to be modified to pass the PRIVILIGED attributes >> as well. While my testing path was using the iommu_map directly i was not >> seeing this, but then i did a patch like below. I will just figure out >> a

RE: [PATCH] iommu: Drop the of_iommu_{set/get}_ops() interface

2017-01-04 Thread Sricharan
y owing to lack of >test platforms, I would appreciate some help in testing this >patch on those platforms before merging it even if it is just >a simple interface conversion. > For msm, Tested-by: Sricharan R Regards, Sricharan ___ iommu

RE: [RFC 2/3] iommu/arm-smmu: Add qcom implementation

2017-01-04 Thread Sricharan
m-...@vger.kernel.org; Sricharan R > >Subject: Re: [RFC 2/3] iommu/arm-smmu: Add qcom implementation > >On Tue, Jan 03, 2017 at 04:30:55PM -0500, Rob Clark wrote: >> At least on the db820c I have, with the firmware I have, I'm not seeing >> the SS bit set, even thoug

RE: [PATCH 02/10] iommu/of: Prepare for deferred IOMMU configuration

2017-01-05 Thread Sricharan
Hi Robin/Lorenzo, >Hi Robin,Lorenzo, > >>On Wed, Nov 30, 2016 at 04:42:27PM +, Robin Murphy wrote: >>> On 30/11/16 16:17, Lorenzo Pieralisi wrote: >>> > Sricharan, Robin, >>> > >>> > I gave this series a go on ACPI and apart from an SMM

RE: [PATCH 02/10] iommu/of: Prepare for deferred IOMMU configuration

2017-01-05 Thread Sricharan
ock your series for this trivial niggle. > >Other than that, though, I like it :) IORT has a small, strictly >bounded, set of supported devices, so I really don't see the need to go >overboard putting it on parity with DT when something this neat and >simple will suffice. > Ok sure, looks correct for me as well in whole of the context here. Regards, Sricharan ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

RE: [PATCH V8 1/9] iommu: add IOMMU_PRIV attribute

2017-01-06 Thread Sricharan
Hi Joerg, >-Original Message- >From: linux-arm-kernel [mailto:linux-arm-kernel-boun...@lists.infradead.org] >On Behalf Of Joerg Roedel >Sent: Friday, January 06, 2017 4:36 PM >To: Sricharan R >Cc: mitch...@codeaurora.org; pd...@codeaurora.org; vinod.k...

RE: [PATCH v2 3/4] iommu/exynos: Ensure that SYSMMU is added only once to its master device

2017-01-09 Thread Sricharan
he check in xlate, which still can be called multiple times even without deferring, incase of say multiple sids as well. But i remember that sometime back Marek mentioned that the exynos iommu currently always has "#iommu-cells = <0>" , but this patch might be required if that change

RE: [PATCH 02/10] iommu/of: Prepare for deferred IOMMU configuration

2017-01-19 Thread Sricharan
Hi Lorenzo, >-Original Message- >From: linux-arm-kernel [mailto:linux-arm-kernel-boun...@lists.infradead.org] >On Behalf Of Lorenzo Pieralisi >Sent: Thursday, January 19, 2017 8:11 PM >To: Sricharan >Cc: linux-arm-...@vger.kernel.org; j...@8bytes.org; will.dea..

RE: [PATCH V5 10/12] drivers: acpi: Configure acpi devices dma operation at probe time

2017-01-19 Thread Sricharan
Hi Lorenzo, >On Thu, Jan 19, 2017 at 08:35:54PM +0530, Sricharan R wrote: >> With all the DT based devices getting their dma ops configured >> during probe time to have the right iommu setup, let us do the >> same for acpi based devices as well. >> >> Configuring

RE: [PATCH V5 05/12] drivers: platform: Configure dma operations at probe time

2017-01-19 Thread Sricharan
Hi Lorenzo, >-Original Message- >From: Lorenzo Pieralisi [mailto:lorenzo.pieral...@arm.com] >Sent: Thursday, January 19, 2017 10:18 PM >To: Sricharan R >Cc: robin.mur...@arm.com; will.dea...@arm.com; j...@8bytes.org; >iommu@lists.linux-foundation.or

RE: [PATCH V5 05/12] drivers: platform: Configure dma operations at probe time

2017-01-19 Thread Sricharan
Hi Robin, >On 19/01/17 15:05, 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 V5 05/12] drivers: platform: Configure dma operations at probe time

2017-01-19 Thread Sricharan
gt; >> > Similarly on the device/driver_unregister path __device_release_driver is >> > called which inturn calls dma_deconfigure. >> > >> > Signed-off-by: Sricharan R >> > --- >> > * Removed the dma configuration for the pci devic

RE: [PATCH V5 08/12] iommu/arm-smmu: Clean up early-probing workarounds

2017-01-19 Thread Sricharan
Hi Robin, >-Original Message- >From: linux-arm-msm-ow...@vger.kernel.org >[mailto:linux-arm-msm-ow...@vger.kernel.org] On Behalf Of Robin Murphy >Sent: Thursday, January 19, 2017 11:28 PM >To: Lorenzo Pieralisi ; Sricharan R > >Cc: will.dea...@arm.com; j...@8bytes.o

RE: [PATCH V5 08/12] iommu/arm-smmu: Clean up early-probing workarounds

2017-01-20 Thread Sricharan
Hi Will, >-Original Message- >From: linux-arm-msm-ow...@vger.kernel.org >[mailto:linux-arm-msm-ow...@vger.kernel.org] On Behalf Of Will Deacon >Sent: Thursday, January 19, 2017 9:48 PM >To: Sricharan R >Cc: robin.mur...@arm.com; j...@8bytes.org; lorenzo.pieral..

RE: [PATCH V6 06/11] drivers: platform: Configure dma operations at probe time

2017-01-23 Thread Sricharan
Hi Lorenzo, >-Original Message- >From: Lorenzo Pieralisi [mailto:lorenzo.pieral...@arm.com] >Sent: Monday, January 23, 2017 5:37 PM >To: Sricharan R >Cc: robin.mur...@arm.com; will.dea...@arm.com; j...@8bytes.org; >iommu@lists.linux-foundation.org; linux-arm- >ker..

RE: [PATCH V6 06/11] drivers: platform: Configure dma operations at probe time

2017-01-23 Thread Sricharan
Hi Lorenzo, >>[+bjorn] >> >>On Sat, Jan 21, 2017 at 12:45:43AM +0530, 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 c

RE: [PATCH/RFC 1/2] arm64: mm: Silently allow devices lacking IOMMU group

2017-01-24 Thread Sricharan
evice. But also the error value from xlate/add_device is returned back and the probe of the device would fail for any error. So if there can be cases like above, where the xlate/add_device callbacks can return error for specific reasons, should only EPROBE_DEFER be considered and rest of the e

RE: [PATCH V7 00/11] IOMMU probe deferral support

2017-01-24 Thread Sricharan
Hi Marek, >On 2017-01-23 17: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 bef

RE: [PATCH 0/5] Implement SMMU passthrough using the default domain

2017-01-24 Thread Sricharan
there is an way out of that that can be tried. So should the default domain not be per device specific selectable ? Regards, Sricharan >Will > >--->8 > >Will Deacon (5): > iommu/arm-smmu: Restrict domain attributes to UNMANAGED domains > iommu/arm-smmu: Install bypass S2CRs f

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

2017-01-24 Thread Sricharan
Hi Lorenzo, >[+hanjun, tomasz, sinan] > >It is quite a key patchset, I would be glad if they can test on their >respective platforms with IORT. > >On Mon, Jan 23, 2017 at 09:48:10PM +0530, Sricharan R wrote: >> This is an equivalent to the DT's handling of the

RE: [PATCH V7 00/11] IOMMU probe deferral support

2017-01-24 Thread Sricharan
Hi Hanjun, >On 2017/1/24 0: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 bef

RE: [PATCH] iommu: Better document the IOMMU_PRIV flag

2017-01-27 Thread Sricharan
>level, >+ * and that unprivileged transactions should have as little access as >possible. >+ * This would usually imply the same permissions as kernel mappings on the >CPU, >+ * if the IOMMU page table format is equivalent. > */ Agree, gives much more insight. Regards, Sricharan ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

2017-01-27 Thread Sricharan
elated. Sorry that there is crash still. __of_match_node seems to checking for NULL arguments , feels like some invalid pointer was passed in. Is there any particular sequence to try for this ? Regards, Sricharan ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

2017-01-29 Thread Sricharan
an unprobed IOMMU (in this case >disabled in DT), trips over trying to match the now-freed table. I'm >working on the fix - technically the bug's in my patch (#2) anyway ;) > Ok, thanks for bringing this out. There is also an issue that Sinan has mentioned while testi

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

2017-01-30 Thread Sricharan
Hi Bjorn, >-Original Message- >From: Bjorn Helgaas [mailto:helg...@kernel.org] >Sent: Sunday, January 29, 2017 2:34 AM >To: Sricharan R >Cc: robin.mur...@arm.com; will.dea...@arm.com; j...@8bytes.org; >lorenzo.pieral...@arm.com; iommu@lists.linux-foundation.o

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

2017-01-30 Thread Sricharan
>> Now that the appropriate ordering is enforced via profe-deferral of > >s/profe-deferral/probe-deferral/ > ha, will change it. Regards, Sricharan >> masters in core code, rip it all out and bask in the simplicity. >> >> Acked-by: Will Deacon >> Sig

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

2017-01-30 Thread Sricharan
s here. > >s/notifier's/notifiers/ > ok, will change. >Personally I'd capitalize "IOMMU" in the English text above, too. > ok, will change this too. Regards, Sricharan >> Acked-by: Will Deacon >> Signed-off-by: Sricharan R >> [rm: clea

RE: [PATCH V7 00/11] IOMMU probe deferral support

2017-01-30 Thread Sricharan
Hi Bjorn, >On Mon, Jan 23, 2017 at 09:48:02PM +0530, 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_atta

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

2017-01-30 Thread Sricharan
Hi, >-Original Message- >From: linux-arm-kernel [mailto:linux-arm-kernel-boun...@lists.infradead.org] >On Behalf Of Sinan Kaya >Sent: Sunday, January 29, 2017 10:06 PM >To: Sricharan R ; robin.mur...@arm.com; >will.dea...@arm.com; j...@8bytes.org; >lorenzo.pie

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

2017-01-31 Thread Sricharan
er, >but they can wait until we've got the baseline functionality sorted. >Updated full patch here: > >http://www.linux-arm.org/git?p=linux-rm.git;a=commitdiff;h=5616af885f7c5c24f7239d5c689583b2b583c407 Thanks, will use this. Yes, the magic iommu_of_table makes little use with probe

RE: [RFC 3/3] iommu/arm-smmu: detach DMA domain if driver is managing iommu

2017-02-01 Thread Sricharan
in this series as well [1] [1] https://www.spinics.net/lists/arm-kernel/msg556081.html >(Is there really any purpose for having the dummy-ops??) > To enforce setting arch_setup_dma_ops for device so that the devices can do cache coherent transactions, otherwise disabl

RE: [PATCH 0/5] Implement SMMU passthrough using the default domain

2017-02-02 Thread Sricharan
Hi Rob, >-Original Message- >From: linux-arm-kernel [mailto:linux-arm-kernel-boun...@lists.infradead.org] >On Behalf Of Rob Clark >Sent: Thursday, February 02, 2017 8:33 PM >To: Joerg Roedel >Cc: Will Deacon ; iommu@lists.linux-foundation.org; >Sricha

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

2017-02-02 Thread Sricharan
mapped. > >It started working once I applied the iort/dma-mapping patches I >sent out earlier this week that use the iort memory_address_limit >field to check if a dma_mask is sane. > >Sorry for the false alarm. Ok, thanks for closing on it. I will just post V8 with all acks picked

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

2017-02-03 Thread Sricharan
Hi Lorenzo, Robin, >-Original Message- >From: linux-arm-kernel [mailto:linux-arm-kernel-boun...@lists.infradead.org] >On Behalf Of Sricharan R >Sent: Friday, February 03, 2017 9:19 PM >To: robin.mur...@arm.com; will.dea...@arm.com; j...@8bytes.org; >lorenzo.pieral

RE: [PATCH 0/5] Implement SMMU passthrough using the default domain

2017-02-03 Thread Sricharan
Hi Will, Rob, >-Original Message- >From: linux-arm-kernel [mailto:linux-arm-kernel-boun...@lists.infradead.org] >On Behalf Of Will Deacon >Sent: Thursday, February 02, 2017 9:41 PM >To: Sricharan >Cc: linux-arm-ker...@lists.infradead.org; 'Rob Clark'

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

2017-02-04 Thread Sricharan
Hi Robin, >> >>> -Original Message- >>> From: linux-arm-kernel >>> [mailto:linux-arm-kernel-boun...@lists.infradead.org] On Behalf Of >>> Sricharan R >>> Sent: Friday, February 03, 2017 9:19 PM >>> To: robin.mur...@arm.co

RE: [PATCH V2 1/3] iommu/arm-smmu: Add pm_runtime/sleep ops

2017-02-08 Thread Sricharan
Hi Mark, > >On Thu, Feb 02, 2017 at 10:40:18PM +0530, Sricharan R wrote: >> +- clock-names:Should be a pair of "smmu_iface_clk" and "smmu_bus_clk" >> + required for smmu's register group access and interface >> +

RE: [PATCH V2 1/3] iommu/arm-smmu: Add pm_runtime/sleep ops

2017-02-08 Thread Sricharan
Hi Mark, >On Wed, Feb 08, 2017 at 04:23:17PM +0530, Sricharan wrote: >> >On Thu, Feb 02, 2017 at 10:40:18PM +0530, Sricharan R wrote: >> >> +- clock-names:Should be a pair of "smmu_iface_clk" and "smmu_bus_clk" >> >> +

RE: [PATCH V2 1/3] iommu/arm-smmu: Add pm_runtime/sleep ops

2017-02-08 Thread Sricharan
Hi Robin, >>>>> On Thu, Feb 02, 2017 at 10:40:18PM +0530, Sricharan R wrote: >>>>>> +- clock-names:Should be a pair of "smmu_iface_clk" and >>>>>> "smmu_bus_clk" >>>>>> + required for

RE: [PATCH V2 1/3] iommu/arm-smmu: Add pm_runtime/sleep ops

2017-02-09 Thread Sricharan
Hi Robin, >-Original Message- >From: linux-arm-kernel [mailto:linux-arm-kernel-boun...@lists.infradead.org] >On Behalf Of Robin Murphy >Sent: Wednesday, February 08, 2017 8:01 PM >To: Mark Rutland ; Sricharan >Cc: devicet...@vger.kernel.org; mathieu.poir...@linar

RE: [PATCH 2/2] iommu: add qcom_iommu

2017-02-22 Thread Sricharan
get(dev, "bus_clk"); >+ if (IS_ERR(qcom_iommu->bus_clk)) { >+ dev_err(dev, "failed to get bus_clk\n"); >+ return PTR_ERR(qcom_iommu->bus_clk); >+ } >+ >+ if (of_property_r

RE: [PATCH 2/2] iommu: add qcom_iommu

2017-02-22 Thread Sricharan
ommu. (But it was Robin's >suggestion to just model this as separate context-bank devices, since >we cannot touch the global space). > >Did I misunderstand the downstream driver code? It looked like >qcom_scm_restore_sec_cfg() was called once on first attach per >context

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

2017-03-09 Thread sricharan
iommu-map, and the caller should check if *target is still NULL? > >Ah yes, Tomasz had found breakages with the "mmu-masters" binding >before, and I'd already pushed out a fixup for this one[1], but I forgot that >that discussion was all off-list (out of diplomatic c

RE: [PATCH 5/9] iommu: add qcom_iommu

2017-03-09 Thread sricharan
might >have existed on early versions of chips for new SoC bring-up.. but I think from >upstream perspective we can ignore that). Right, I would think this is the only one which has the MMU-500 behind the *secure* access constraints to global registers. The next set of S

Re: [PATCH 5/9] iommu: add qcom_iommu

2017-03-13 Thread sricharan
gt;irq); + return ret; + } + + /* read the "reg" property directly to get the relative address +* of the context bank, and calculate the asid from that: +*/ + if (of_property_read_u32_index(dev->of_node, "reg", 0, ®)) { +

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

2017-05-15 Thread sricharan
Hi Laurent, On 2017-05-16 03:04, Laurent Pinchart wrote: Hi Sricharan, On Monday 15 May 2017 23:37:16 Laurent Pinchart wrote: On Wednesday 03 May 2017 15:54:59 Sricharan R wrote: > On 5/3/2017 3:24 PM, Robin Murphy wrote: >> On 02/05/17 19:35, Geert Uytterhoeven wrote: >>> O

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

2017-05-15 Thread sricharan
Hi Will, On 2017-05-15 19:52, Will Deacon wrote: Hi Sricharan, On Wed, May 03, 2017 at 03:54:59PM +0530, Sricharan R wrote: On 5/3/2017 3:24 PM, Robin Murphy wrote: > On 02/05/17 19:35, Geert Uytterhoeven wrote: >> On Fri, Feb 3, 2017 at 4:48 PM, Sricharan R wrote: >>> From

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

2017-05-16 Thread sricharan
Hi Laurent, On 2017-05-16 12:47, Laurent Pinchart wrote: Hi Sricharan, On Tuesday 16 May 2017 07:53:57 sricha...@codeaurora.org wrote: On 2017-05-16 03:04, Laurent Pinchart wrote: > On Monday 15 May 2017 23:37:16 Laurent Pinchart wrote: >> On Wednesday 03 May 2017 15:54:59 Srichara

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

2017-05-16 Thread sricharan
l >> be set to old value, which is not right. >> >> Signed-off-by: Sricharan R >> Reviewed-by: Robin Murphy >> --- >> >> arch/arm/mm/dma-mapping.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/arch/arm/mm/dma-mapping

Re: [PATCH] ARM: dma-mapping: Don't tear third-party mappings

2017-05-17 Thread sricharan
On 2017-05-17 10:45, Sricharan R wrote: Hi Laurent/Robin, On 5/16/2017 10:14 PM, Laurent Pinchart wrote: Hi Robin, On Tuesday 16 May 2017 16:47:36 Robin Murphy wrote: On 16/05/17 16:14, Laurent Pinchart wrote: arch_setup_dma_ops() is used in device probe code paths to create an IOMMU

RE: [PATCH V2 1/5] iommu/msm: Add DT adaptation

2016-04-12 Thread Sricharan
isabled together. I will add little more description here for this here. > Also, the second cell can't be a list of stream ids, as one cell stores one value. > A master device using multiple stream ids should use multiple entries in the > iommus property. >

RE: [PATCH V2 1/5] iommu/msm: Add DT adaptation

2016-04-12 Thread Sricharan
Hi Rob, > On Wed, Apr 06, 2016 at 07:59:31PM +0530, Sricharan R wrote: > > The driver currently works based on platform data. Remove this and add > > support for DT. A single master can have multiple ports connected to > > more than one iommu. > > &

RE: [PATCH V2 4/5] iommu/msm: use generic ARMV7S short descriptor pagetable ops

2016-04-26 Thread Sricharan
Hi will, > -Original Message- > From: Will Deacon [mailto:will.dea...@arm.com] > Sent: Tuesday, April 26, 2016 7:47 PM > To: Sricharan R > Cc: linux-arm-ker...@lists.infradead.org; iommu@lists.linux-foundation.org; > devicet...@vger.kernel.org; linux-arm-...@vger.kerne

RE: [PATCH V3 2/7] documentation: iommu: Add bindings for msm, iommu-v0 ip

2016-05-04 Thread Sricharan
g the DT bindings for the same. > > > > Signed-off-by: Sricharan R > > --- > > .../devicetree/bindings/iommu/msm,iommu-v0.txt | 62 > ++ > > 1 file changed, 62 insertions(+) > > create mode 100644 > > Documentation/devicetree/bindings/iommu/ms

RE: [RFC 0/9] IOMMU probe deferral support

2016-05-12 Thread Sricharan
Hi Marek, > -Original Message- > From: linux-arm-kernel [mailto:linux-arm-kernel- > boun...@lists.infradead.org] On Behalf Of Marek Szyprowski > Sent: Thursday, May 12, 2016 6:23 PM > To: Sricharan R ; will.dea...@arm.com; > robin.mur...@arm.com; j...@8bytes.org;

RE: [PATCH V4 6/7] iommu/msm: Use writel_relaxed and add a barrier

2016-05-18 Thread Sricharan
hift))) + (((v) & (mask)) << (shift)), >> addr);\ >> + writel_relaxed((t & ~((mask) << (shift))) + \ >> + (((v) & (mask)) << (shift)), addr);\ >> } while (0) > >No, please add a new macro for the relaxed accessors and then add comments >in the places where those are used, to document why you can take shortcuts >in those places. Ok, will add a new accessor for this and comment them. Regards, Sricharan ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

RE: [PATCH V4 2/7] documentation: iommu: Add bindings for msm, iommu-v0 ip

2016-05-18 Thread Sricharan
ngs for the same. >> >> Signed-off-by: Sricharan R >> --- >> .../devicetree/bindings/iommu/msm,iommu-v0.txt | 64 >> ++ >> 1 file changed, 64 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/iommu/msm,iommu-v0.

RE: [PATCH V4 6/7] iommu/msm: Use writel_relaxed and add a barrier

2016-05-18 Thread Sricharan
only reason for changing this was to optimise out the additonal barriers that were happening. I do not see any issue now as well, only that the writes would be faster. Regards, Sricharan ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

RE: [PATCH V4 6/7] iommu/msm: Use writel_relaxed and add a barrier

2016-05-20 Thread Sricharan
a patch here [1] with comments, i had to delete the old accessors though as it became unused now. http://www.spinics.net/lists/arm-kernel/msg505448.html Regards, Sricharan ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

RE: [RFC 0/9] IOMMU probe deferral support

2016-05-20 Thread Sricharan
Hi Robin/Laurent, >> -Original Message- >> From: linux-arm-kernel [mailto:linux-arm-kernel- >> boun...@lists.infradead.org] On Behalf Of Marek Szyprowski >> Sent: Thursday, May 12, 2016 6:23 PM >> To: Sricharan R ; will.dea...@arm.com; >> robin.mu

RE: [PATCH V5 6/7] iommu/msm: Use writel_relaxed and add a barrier

2016-05-22 Thread Sricharan
e relaxed accessors first in a separate patch, and then >change over one user at a time before you remove the non-relaxed ones. > ok >It's hard to believe that all users are actually performance critical, >so start with the ones that gain the most performance. As commented above, >some of the conversions seem particularly fishy and it's likely that >a slow reset() function should not be fixed by making reset() faster >but by calling it less often. Ok. Will change this. So i will split this in to separate series, one patch to modify relevant the flush_iotlb_range function in this series and rest of all changes as a driver improvement in one more. >Can you just remove those macros, and open-code the function calls? > >This is an unnecessary obfuscation that now also hides the fact that you >are using relaxed accessors. Ok, will make this in to inline functions to make it obvious. Regards, Sricharan ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

RE: [RFC 8/9] drivers: of: call iommu_bus_add_dev after iommu_configure_ops

2016-05-23 Thread Sricharan
Hi Marek, >On 2016-04-25 17:58, Sricharan R wrote: >> Now that the device's iommu ops are configured at probe time, >> the device has to be added to the iommu late. >> >> Signed-off-by: Sricharan R >> --- >> drivers/of/device.c | 4 >>

RE: [PATCH V5 6/7] iommu/msm: Use writel_relaxed and add a barrier

2016-05-25 Thread Sricharan
ck on this to >> measure >> the latency difference. If thats true, then the iopgtable ops itself >> provides a >> function for iova_to_phys conversion, so that can be used. > >I hadn't realized that this is a lookup in the hardware, rather than >reading a static register. It's probably a good idea to check this >anyway. Ok, will measure the difference and have the better one. Regards, Sricharan ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

RE: [PATCH V5 6/7] iommu/msm: Use writel_relaxed and add a barrier

2016-05-25 Thread Sricharan
e walker in your IOMMU, you don't need to worry > about this. > To get my understanding correct here, is the barrier required here because of speculative fetch ? Regards, Sricharan ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

RE: [PATCH V5 6/7] iommu/msm: Use writel_relaxed and add a barrier

2016-05-25 Thread Sricharan
omes before the MMIO write to the >DMA master would ensure ordering of the DMA after both the IOPTE >update and the MMIO flush (unless there was the speculative fetch you >mentioned), but this is where I'm no longer confident enough in my

RE: [RFC 5/9] drivers: platform: Configure dma operations at probe time

2016-05-25 Thread Sricharan
Hi Robin, >On 25/04/16 16:58, Sricharan R wrote: >> From: Laurent Pinchart >> >> Configuring DMA ops at probe time will allow deferring device probe when >> the IOMMU isn't available yet. >> >> Signed-off-by: Laurent Pinchart >> --- >>

RE: [RFC 8/9] drivers: of: call iommu_bus_add_dev after iommu_configure_ops

2016-05-25 Thread Sricharan
Hi Robin, >On 25/04/16 16:58, Sricharan R wrote: >> Now that the device's iommu ops are configured at probe time, >> the device has to be added to the iommu late. >> >> Signed-off-by: Sricharan R >> --- >> drivers/of/device.c | 4 >>

RE: [PATCH V6 0/6] iommu/msm: Add DT adaptation and generic bindings support

2016-08-12 Thread Sricharan
0x) will trigger a fault. > So for the irq to be triggered, 'non-secure' irq line has to be populated in DT. There is a 'secure'and 'non-secure' irq lines for these iommus and non-secure irq number is

RE: [PATCH V6 0/6] iommu/msm: Add DT adaptation and generic bindings support

2016-08-12 Thread Sricharan
apping), and the faults were getting triggered. >> >> Can you share me your dts data ? >> > >I think this is what you want: > >https://github.com/freedreno/kernel-msm/blob/integration-linux-qcomlt/arch/arm/boot/dts/qcom-apq8064.dtsi#L200

RE: [PATCH V6 0/6] iommu/msm: Add DT adaptation and generic bindings support

2016-08-12 Thread Sricharan
>> >>>I haven't tested a display fault, so I suppose it is possible that >>>irq's are working for some iommu instances but not others? >> >> So in your DT, for gfx3d, the non-secure line is '70' and not '69' (This is >> secure) . >> Infact only '70' should be populated. The driver sets the irq line based on >> resource 0. >> This applies for all iommu nodes in your DT. (only the second irq line is >> needed). > >ahh, that would explain. > >Is it better to remove the extra entry, or should I just swap them >all? Ie. might there be some point in the future where the driver >would want both? I feel better to have one. Not sure why the secure irq was added in first place in the downstream data and it would setup/handled by the TZ Regards, Sricharan ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

RE: [PATCH V6 0/6] iommu/msm: Add DT adaptation and generic bindings support

2016-08-12 Thread Sricharan
. >>>> >>>>Is it better to remove the extra entry, or should I just swap them >>>>all? Ie. might there be some point in the future where the driver >>>>would want both? >>> I feel better to have one. Not sure why the secure irq was added in >>> first >>> place in the downstream data and it would setup/handled by the TZ >> >> Ok, getting further.. still seems like the gpu is not getting resumed, >> but at least we are getting a fault interrupt.. > > >ok, seems like we need: > >--- >diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c >index b09692b..f6f596f 100644 >--- a/drivers/iommu/msm_iommu.c >+++ b/drivers/iommu/msm_iommu.c >@@ -628,6 +628,7 @@ irqreturn_t msm_iommu_fault_handler(int irq, void *dev_id) > pr_err("Interesting registers:\n"); > print_ctx_regs(iommu->base, i); > SET_FSR(iommu->base, i, 0x400F); >+SET_RESUME(iommu->base, i, 1); > } ok, ya this is required for disabling the stall. I can send a patch to change this. > } > __disable_clocks(iommu); >--- > >with that it seems like it kinda/mostly recovers, although there is >still a bit of strangeness.. hmm ok, can test it and check something particular ? Regards, Sricharan ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

RE: [PATCH 7/8] iommu: of: Handle IOMMU lookup failure with deferred probing or error

2016-08-12 Thread Sricharan
>> device_node *np) >> coherent ? " " : " not "); >> >> iommu = of_iommu_configure(dev, np); >> + if (IS_ERR(iommu)) >> + return PTR_ERR(iommu); > >nit: Would be good to add a blank line here for improved readability. ok, will add. Regards, Sricharan ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

RE: [PATCH 6/8] drivers: platform: Remove call to of_dma_(con/decon)figure_ops

2016-08-12 Thread Sricharan
this patch need to be squashed with previous one to avoid >breaking things in between by having the of_dma_configure_ops() called >two times? > okay, i did it this way, for the sake of review. But ya will squash it for the next post. Regards, Sricharan

RE: [PATCH 4/8] of: dma: Split of_configure_dma() into mask and ops configuration

2016-08-12 Thread Sricharan
pped and to have masks also done along with ops, but thought of getting some feedback if its really needed before probe anywhere. Regards, Sricharan ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

RE: [PATCH 1/2] iommu/msm: resume device after fault

2016-08-12 Thread Sricharan
msm_iommu_fault_handler(int irq, void *dev_id) > pr_err("Interesting registers:\n"); > print_ctx_regs(iommu->base, i); > SET_FSR(iommu->base, i, 0x400F); >+ SET_RESUME(iommu-&

RE: [PATCH 2/2] iommu/msm: wire up fault handling

2016-08-12 Thread Sricharan
f its better to have only this as a ratelimited print, for global faults ?, otherwise Reviewed-by: sricha...@codeaurora.org Regards, Sricharan ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

RE: [PATCH 5/8] drivers: platform: Configure dma operations at probe time

2016-08-16 Thread Sricharan
Hi Laurent, >Hi Sricharan, > >Thank you for the patch. > >On Tuesday 09 Aug 2016 04:19:07 Sricharan R wrote: >> Configuring DMA ops at probe time will allow deferring device probe when >> the IOMMU isn't available yet. >> >> Signed-off-by: Sricharan R

RE: [PATCH 7/8] iommu: of: Handle IOMMU lookup failure with deferred probing or error

2016-09-06 Thread Sricharan
Hi Marek, >Hi Sricharan, > > >On 2016-08-12 17:40, Sricharan wrote: >> Hi Tomaz, >> >>>> + if (ops->add_device) >>>> + ops = ops->add_device(dev) ? ops : NULL; >>> Patch description fails to

RE: [PATCH 1/8] arm: dma-mapping: Don't override dma_ops in arch_setup_dma_ops()

2016-09-06 Thread Sricharan
Hi Marek, >Hi Sricharan and Laurent, > > >On 2016-08-09 00:49, Sricharan R wrote: >> From: Laurent Pinchart >> >> The arch_setup_dma_ops() function is in charge of setting dma_ops with a >> call to set_dma_ops(). set_dma_ops() is also called from >

RE: [PATCH 7/8] iommu: of: Handle IOMMU lookup failure with deferred probing or error

2016-09-06 Thread Sricharan
Hi Marek, >Hi Sricharan, > >On 2016-08-09 00:49, 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 &

RE: [PATCH 4/8] of: dma: Split of_configure_dma() into mask and ops configuration

2016-09-09 Thread Sricharan
Hi Magnus, >On Tue, Aug 9, 2016 at 7:49 AM, Sricharan R wrote: >> From: Laurent Pinchart >> >> The of_configure_dma() function configures both the DMA masks and ops. >> Moving DMA ops configuration to probe time would thus also delay >> configuration of the D

RE: [PATCH V3 8/8] arm64: dma-mapping: Remove the notifier trick to handle early setting of dma_ops

2016-10-07 Thread Sricharan
Hi, >-Original Message- >From: linux-arm-kernel [mailto:linux-arm-kernel-boun...@lists.infradead.org] >On Behalf Of Sricharan R >Sent: Tuesday, October 04, 2016 10:34 PM >To: will.dea...@arm.com; robin.mur...@arm.com; j...@8bytes.org; >iommu@lists.linux-foundation.or

RE: [PATCH V3 0/8] IOMMU probe deferral support

2016-10-11 Thread Sricharan
Hi Marek, >Hi Sricharan, > > >On 2016-10-04 19:03, Sricharan R wrote: >> Initial post from Laurent Pinchart[1]. This is >> series calls the dma ops configuration for the devices >> at a generic place so that it works for all busses. >> The dma_configure_o

RE: [PATCH V3 0/8] IOMMU probe deferral support

2016-10-16 Thread Sricharan
>-Original Message- >From: Sricharan [mailto:sricha...@codeaurora.org] >Sent: Wednesday, October 12, 2016 11:55 AM >To: 'Marek Szyprowski' ; 'will.dea...@arm.com' >; 'robin.mur...@arm.com' >; 'j...@8bytes.org' ; >'

RE: [PATCH V3 0/8] IOMMU probe deferral support

2016-10-17 Thread Sricharan
Resending, missed out on the link last time. >-Original Message- >From: linux-arm-msm-ow...@vger.kernel.org >[mailto:linux-arm-msm-ow...@vger.kernel.org] On Behalf Of Marek Szyprowski >Sent: Monday, October 10, 2016 6:07 PM >To: Sricharan R ; will.dea...@arm.com; >ro

RE: [PATCH 1/2] iommu/arm-smmu: Don't inadvertently reject multiple SMMUv3s

2016-10-17 Thread Sricharan
FIG_ARM_AMBA >- ret = bus_set_iommu(&amba_bustype, &arm_smmu_ops); >- if (ret) >- return ret; >+ bus_set_iommu(&amba_bustype, &arm_smmu_ops); > #endif >- return bus_set_iommu(&platform_bus_type, &arm_smmu_ops); >+ bu

RE: [PATCH v5 6/7] iommu/exynos: Add runtime pm support

2016-10-21 Thread Sricharan
->rpm_lock); > } > return 0; > } >-#endif > > static const struct dev_pm_ops sysmmu_pm_ops = { >- SET_LATE_SYSTEM_SLEEP_PM_OPS(exynos_sysmmu_suspend, >exynos_sysmmu_resume) >+ SET_RUNTIME_PM_OPS(exynos_sysmmu_suspend, exynos_sysmmu_resume, NULL) >+ SET_LATE_SYSTEM_SLEEP_P

RE: [PATCH v5 7/7] iommu/exynos: Use device dependency links to control runtime pm

2016-10-23 Thread Sricharan
(dependency) to its >+ * master device, so there are no direct calls to pm_runtime_get/put >+ * in this driver. >+ */ >+ device_link_add(dev, data->sysmmu, DL_FLAG_PM_RUNTIME); >+ So in the case of master with multiple sids, this would be called multiple times for the same master ? Regards, Sricharan ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

RE: [PATCH v5 6/7] iommu/exynos: Add runtime pm support

2016-10-24 Thread Sricharan
Hi Marek, >Hi Sricharan > > >On 2016-10-22 07:50, Sricharan wrote: >> >>> This patch adds runtime pm implementation, which is based on previous >>> suspend/resume code. SYSMMU controller is now being enabled/disabled mainly >> > from the runtime p

RE: [PATCH v5 7/7] iommu/exynos: Use device dependency links to control runtime pm

2016-10-24 Thread Sricharan
ontrollers (consumers), then links will be created >for each SYSMMU >controller. Please note that this code is based on vanilla v4.9-rc1, >which calls >of_xlate() callback only once for every iommu for given master device. >Your IOMMU >deferred probe patches change this, but I already posted a fix for >Exynos IOMMU driver >to handle such case. By multiple sids, i meant iommus = <&phandle sid1 sid2 .. sidn> case, so xlate would be called multiples for the same master without deferred probing also. But the fix that you showed on the other thread would work here as well or maybe if you dont have masters with multiple sids you wont have any issues as well. Regards, Sricharan ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

RE: [PATCH V3 0/8] IOMMU probe deferral support

2016-10-24 Thread Sricharan
feature! Your can add my: >>> >>> Tested-by: Marek Szyprowski >>> >>Thanks for testing this. So the for the below fix, the remove_device >> callback >>gets called on the dma_ops cleanup path, so would it be easy to remove the >>data

  1   2   3   4   5   >