Re: [PATCH v5 06/14] ARM: EXYNOS: add System MMU definition to DT

2013-01-17 Thread Will Deacon
Hi Hiroshi, On Wed, Jan 16, 2013 at 04:43:21PM +, Hiroshi Doyu wrote: Will Deacon will.dea...@arm.com wrote @ Wed, 16 Jan 2013 12:51:14 +0100: Given that this information is not discoverable, it needs to be encoded in the device tree, but where? I can see two approaches: 1

[PATCH] documentation: iommu: add description of ARM System MMU binding

2013-04-04 Thread Will Deacon
This patch adds a description of the device tree binding for the ARM System MMU architecture. Cc: Rob Herring robherri...@gmail.com Cc: Andreas Herrmann andreas.herrm...@calxeda.com Signed-off-by: Will Deacon will.dea...@arm.com --- Hello, The driver for this is still a WIP. Both Andreas

Re: [PATCH] documentation: iommu: add description of ARM System MMU binding

2013-04-05 Thread Will Deacon
Hi Rob, On Fri, Apr 05, 2013 at 05:43:06PM +0100, Rob Herring wrote: On 04/04/2013 11:50 AM, Will Deacon wrote: This patch adds a description of the device tree binding for the ARM System MMU architecture. Cc: Rob Herring robherri...@gmail.com Cc: Andreas Herrmann andreas.herrm

Re: [PATCH] documentation: iommu: add description of ARM System MMU binding

2013-04-08 Thread Will Deacon
On Fri, Apr 05, 2013 at 07:25:26PM +0100, Rob Herring wrote: On 04/05/2013 11:57 AM, Will Deacon wrote: Hi Rob, On Fri, Apr 05, 2013 at 05:43:06PM +0100, Rob Herring wrote: [...] +- compatible: Should be one of arm,smmu-v1 or arm,smmu-v2 + depending

Re: [PATCH] documentation: iommu: add description of ARM System MMU binding

2013-04-08 Thread Will Deacon
Hi Olav, On Fri, Apr 05, 2013 at 09:44:49PM +0100, Olav Haugan wrote: On 4/4/2013 9:50 AM, Will Deacon wrote: diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.txt b/Documentation/devicetree/bindings/iommu/arm,smmu.txt new file mode 100644 index 000..938325f --- /dev

Re: [PATCH] documentation: iommu: add description of ARM System MMU binding

2013-04-10 Thread Will Deacon
On Mon, Apr 08, 2013 at 06:03:54PM +0100, Olav Haugan wrote: Hi Will, Hello, Generally, the StreamIDs are fixed in hardware (as a function of various AXI bits -- see the SMMU integration guide) and cannot be set by software. Furthermore, when the StreamIDs have an implicit effect on IOMMU

[PATCH v2] documentation: iommu: add description of ARM System MMU binding

2013-04-12 Thread Will Deacon
This patch adds a description of the device tree binding for the ARM System MMU architecture. Cc: Rob Herring robherri...@gmail.com Cc: Andreas Herrmann andreas.herrm...@calxeda.com Signed-off-by: Will Deacon will.dea...@arm.com --- .../devicetree/bindings/iommu/arm,smmu.txt | 66

Re: [PATCH] documentation: iommu: add description of ARM System MMU binding

2013-04-18 Thread Will Deacon
Hi Olav, On Tue, Apr 16, 2013 at 07:18:42PM +0100, Olav Haugan wrote: On 4/15/2013 6:13 AM, Will Deacon wrote: If so, doesn't that strongly tie your video driver to the SMMU? Isn't this more or less what you are doing in DT where you associate specific devices with an IOMMU (mmu-masters

Re: [PATCH] documentation: iommu: add description of ARM System MMU binding

2013-04-24 Thread Will Deacon
On Tue, Apr 23, 2013 at 11:54:53PM +0100, Olav Haugan wrote: Hi Will, Hello again, On 4/18/2013 12:01 PM, Will Deacon wrote: No. The device-tree describes the *hardware*, as per usual. The StreamIDs are fixed properties of the SoC and we can't change them from Linux, so we describe all

Re: [PATCH v2] documentation: iommu: add description of ARM System MMU binding

2013-05-13 Thread Will Deacon
On Mon, May 13, 2013 at 10:50:20AM +0100, Andreas Herrmann wrote: Hi Will, Hi Andreas, so far, I thought, that this proposal is fine. After I have tried to make use of the binding I have some points that might need further disucssion. Sure, although I've been using the binding without

Re: [PATCH] documentation: iommu: add description of ARM System MMU binding

2013-05-13 Thread Will Deacon
On Mon, May 13, 2013 at 10:07:24AM +0100, Andreas Herrmann wrote: On Tue, May 07, 2013 at 04:26:02PM -0400, Olav Haugan wrote: I think you misunderstood me. I am talking about having for example 1 master with two (2) context banks so that StreamID 1 goes to CB0 and StreamID 2 goes to CB1.

Re: [PATCH v2] documentation: iommu: add description of ARM System MMU binding

2013-05-21 Thread Will Deacon
On Tue, May 21, 2013 at 11:25:01AM +0100, Andreas Herrmann wrote: On Mon, May 20, 2013 at 06:18:41AM -0400, Will Deacon wrote: That also looks fine to me, although I'd like to write the parsing code in my driver before I commit to anything! Right, I hacked that up this afternoon and it seems

[PATCH 8/9] iommu: add support for ARM Ltd. System MMU architecture

2013-06-10 Thread Will Deacon
...@codeaurora.org Cc: Joerg Roedel j...@8bytes.org Signed-off-by: Will Deacon will.dea...@arm.com --- drivers/iommu/Kconfig| 13 + drivers/iommu/Makefile |1 + drivers/iommu/arm-smmu.c | 1965 ++ 3 files changed, 1979 insertions(+) create mode 100644

[PATCH v2 2/3] iommu: add support for ARM Ltd. System MMU architecture

2013-06-24 Thread Will Deacon
...@codeaurora.org Cc: Joerg Roedel j...@8bytes.org Signed-off-by: Will Deacon will.dea...@arm.com --- drivers/iommu/Kconfig| 13 + drivers/iommu/Makefile |1 + drivers/iommu/arm-smmu.c | 1969 ++ 3 files changed, 1983 insertions(+) create mode 100644

[PATCH 1/2] iommu/arm-smmu: use relaxed accessors where possible

2013-08-30 Thread Will Deacon
Apart from fault handling and page table manipulation, we don't care about memory ordering between SMMU control registers and normal, cacheable memory, so use the _relaxed I/O accessors wherever possible. Signed-off-by: Will Deacon will.dea...@arm.com --- drivers/iommu/arm-smmu.c | 6 +++--- 1

[GIT PULL] iommu/arm-smmu: fixes for 3.12

2013-09-17 Thread Will Deacon
probing has completed (2013-09-17 12:03:11 +0100) Dan Carpenter (2): iommu/arm-smmu: fix a signedness bug iommu/arm-smmu: fix iommu_present() test in init Will Deacon (1): iommu/arm-smmu: don't enable SMMU device until

Re: [PATCH 1/7] iommu/arm-smmu: Switch to arch_initcall for driver registration

2013-09-24 Thread Will Deacon
On Tue, Sep 24, 2013 at 04:14:30PM +0100, Andreas Herrmann wrote: iommu/arm-smmu: Remove bogus semicolon from if conditions Those prevented proper registration of arm_smmu_ops. Signed-off-by: Andreas Herrmann andreas.herrm...@calxeda.com --- drivers/iommu/arm-smmu.c |4 ++-- 1 file

Re: [PATCH 0/7]: iommu/arm-smmu: Misc fixes/adaptions

2013-09-24 Thread Will Deacon
On Tue, Sep 24, 2013 at 04:06:54PM +0100, Andreas Herrmann wrote: Hi, Hi Andreas, Following patches fix misc issues, that I've seen when using arm-smmu driver with MMU-400. Thanks for the patches! I'll respond to each one in turn. Will ___ iommu

Re: [PATCH 2/7] iommu/arm-smmu: Calculate SMMU_CB_BASE from smmu register values

2013-09-24 Thread Will Deacon
On Tue, Sep 24, 2013 at 04:06:56PM +0100, Andreas Herrmann wrote: Currently it is derived from smmu resource size. If the resource size is wrongly specified (e.g. too large) this leads to a miscalculation and can cause undefined behaviour when context bank registers are modified.

Re: [PATCH 4/7] iommu/arm-smmu: Check for num_context_irqs 0 to avoid divide by zero exception

2013-09-24 Thread Will Deacon
On Tue, Sep 24, 2013 at 04:06:58PM +0100, Andreas Herrmann wrote: With the right (or wrong;-) definition of v1 SMMU node in DTB it is possible to trigger a division by zero in arm_smmu_init_domain_context (if number of context irqs is 0): if (smmu-version == 1) {

Re: [PATCH 3/7] ARM: dma-mapping: Always pass proper prot flags to iommu_map()

2013-09-24 Thread Will Deacon
On Tue, Sep 24, 2013 at 04:06:57PM +0100, Andreas Herrmann wrote: ... otherwise it is impossible for the low level iommu driver to figure out which pte flags should be used. In __map_sg_chunk we can derive the flags from dma_data_direction. In __iommu_create_mapping we should treat the

Re: [PATCH 7/7] iommu/arm-smmu: Clear global and context bank fault status and syndrome registers

2013-09-24 Thread Will Deacon
On Tue, Sep 24, 2013 at 04:07:01PM +0100, Andreas Herrmann wrote: Signed-off-by: Andreas Herrmann andreas.herrm...@calxeda.com --- drivers/iommu/arm-smmu.c |9 + 1 file changed, 9 insertions(+) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index

Re: [PATCH 7/7] iommu/arm-smmu: Clear global and context bank fault status and syndrome registers

2013-09-25 Thread Will Deacon
On Tue, Sep 24, 2013 at 07:32:47PM +0100, Andreas Herrmann wrote: On Tue, Sep 24, 2013 at 11:42:52AM -0400, Will Deacon wrote: On Tue, Sep 24, 2013 at 04:07:01PM +0100, Andreas Herrmann wrote: Signed-off-by: Andreas Herrmann andreas.herrm...@calxeda.com --- drivers/iommu/arm-smmu.c

Re: [PATCH 2/7] iommu/arm-smmu: Calculate SMMU_CB_BASE from smmu register values

2013-09-25 Thread Will Deacon
On Tue, Sep 24, 2013 at 07:07:20PM +0100, Andreas Herrmann wrote: On Tue, Sep 24, 2013 at 11:34:57AM -0400, Will Deacon wrote: On Tue, Sep 24, 2013 at 04:06:56PM +0100, Andreas Herrmann wrote: Currently it is derived from smmu resource size. If the resource size is wrongly specified (e.g

Re: [PATCH 3/9] ARM: dma-mapping: Always pass proper prot flags to iommu_map()

2013-09-27 Thread Will Deacon
should be allowed. Cc: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Andreas Herrmann andreas.herrm...@calxeda.com Acked-by: Will Deacon will.dea...@arm.com This one should go via the dma-mapping tree. Will ___ iommu mailing list iommu

Re: [PATCH 4/9] iommu/arm-smmu: Check for num_context_irqs 0 to avoid divide by zero exception

2013-09-27 Thread Will Deacon
On Thu, Sep 26, 2013 at 11:36:16PM +0100, Andreas Herrmann wrote: With the right (or wrong;-) definition of v1 SMMU node in DTB it is possible to trigger a division by zero in arm_smmu_init_domain_context (if number of context irqs is 0): if (smmu-version == 1) {

Re: [PATCH 1/9] iommu/arm-smmu: Switch to arch_initcall for driver registration

2013-09-27 Thread Will Deacon
On Thu, Sep 26, 2013 at 11:36:13PM +0100, Andreas Herrmann wrote: This should ensure that arm-smmu is initialized before other drivers start handling devices that propably need smmu support. Also remove module_exit function as we most likely never want to unload this driver. Doesn't hurt to

Re: [PATCH 2/9] iommu/arm-smmu: Calculate SMMU_CB_BASE from smmu register values

2013-09-27 Thread Will Deacon
Hi Andreas, On Thu, Sep 26, 2013 at 11:36:14PM +0100, Andreas Herrmann wrote: Currently it is derived from smmu resource size. In case of a mismatchin between the two calculations trust DT more than register values and overwrite cb_base. I thought the driver already favoured the DT? @@

Re: [PATCH 4/9] iommu/arm-smmu: Check for num_context_irqs 0 to avoid divide by zero exception

2013-09-27 Thread Will Deacon
On Fri, Sep 27, 2013 at 11:39:49AM +0100, Andreas Herrmann wrote: On Fri, Sep 27, 2013 at 06:23:07AM -0400, Will Deacon wrote: What do you think? Yes, that should suffice. I know it's clear for us but what about a short comment to emphasize that we expect to find at least one context irq

Re: [PATCH 2/9] iommu/arm-smmu: Calculate SMMU_CB_BASE from smmu register values

2013-09-27 Thread Will Deacon
On Fri, Sep 27, 2013 at 11:23:59AM +0100, Andreas Herrmann wrote: On Fri, Sep 27, 2013 at 05:51:57AM -0400, Will Deacon wrote: Hi Andreas, On Thu, Sep 26, 2013 at 11:36:14PM +0100, Andreas Herrmann wrote: Currently it is derived from smmu resource size. In case of a mismatchin

Re: [PATCH 2/9] iommu/arm-smmu: Calculate SMMU_CB_BASE from smmu register values

2013-09-27 Thread Will Deacon
On Fri, Sep 27, 2013 at 12:05:21PM +0100, Andreas Herrmann wrote: On Fri, Sep 27, 2013 at 06:51:53AM -0400, Will Deacon wrote: Well, we should already print the device is 0x%lx bytes but only mapped 0x%lx! message, which I think is enough to go and figure out what happened. No, you can map

Re: [PATCH 7/9] iommu/arm-smmu: Add function that conditionally isolates all masters of all SMMUs

2013-09-27 Thread Will Deacon
Hi Andreas, On Thu, Sep 26, 2013 at 11:36:19PM +0100, Andreas Herrmann wrote: (Depending on DT information and module parameters) each device is put into its own protection domain (if possible). For configuration with one or just a few masters per SMMU that is easy to achieve. In case of

Re: [PATCH] iommu/arm-smmu: Clear global and context bank fault status registers

2013-09-30 Thread Will Deacon
On Mon, Sep 30, 2013 at 06:17:16PM +0100, Andreas Herrmann wrote: On Mon, Sep 30, 2013 at 12:06:15PM -0400, Will Deacon wrote: On Mon, Sep 30, 2013 at 02:56:21PM +0100, Andreas Herrmann wrote: After reset these registers have unknown values. This might cause problems when evaluating

Re: [PATCH 0/6] iommu/arm-smmu: Misc changes

2013-10-01 Thread Will Deacon
On Tue, Oct 01, 2013 at 01:39:04PM +0100, Andreas Herrmann wrote: Hi, here a reworked set of patches. Hopefully all comments addressed. Cheers Andreas! I've taken the first 5. Whilst I like the cleanup you've made to the final patch, I'll need an Ack from Rob until I can take anything

Re: [PATCH 6/6] iommu/arm-smmu: Support buggy implemenations where all config accesses are secure

2013-10-02 Thread Will Deacon
On Tue, Oct 01, 2013 at 07:17:09PM +0100, Andreas Herrmann wrote: On Tue, Oct 01, 2013 at 09:28:51AM -0400, Rob Herring wrote: On 10/01/2013 07:39 AM, Andreas Herrmann wrote: In such a case we have to use secure aliases of some non-secure registers. This behaviour is controlled via

Re: [PATCH 7/9] iommu/arm-smmu: Add function that conditionally isolates all masters of all SMMUs

2013-10-08 Thread Will Deacon
On Mon, Oct 07, 2013 at 04:42:27PM +0100, Andreas Herrmann wrote: On Fri, Sep 27, 2013 at 09:00:01AM -0400, Will Deacon wrote: On Thu, Sep 26, 2013 at 11:36:19PM +0100, Andreas Herrmann wrote: + list_for_each_entry(smmu, arm_smmu_devices, list) { + if (arm_smmu_disable_isolation

Re: [PATCH 1/1] iommu: arm-smmu: Use devm_ioremap_resource

2013-10-08 Thread Will Deacon
On Tue, Oct 08, 2013 at 11:42:35AM +0100, Sachin Kamat wrote: devm_request_and_ioremap is deprecated. Use devm_ioremap_resource instead. I already have an identical patch from Julia, queued for 3.13. Thanks, Will ___ iommu mailing list

Re: [PATCH 1/5] iommu/arm-smmu: Introduce driver option handling

2013-10-08 Thread Will Deacon
On Tue, Oct 08, 2013 at 10:27:20AM +0100, Andreas Herrmann wrote: Introduce handling of driver options. Options are set based on DT information when probing an SMMU device. The first option introduced is arm,smmu-isolate-devices. (It will be used in the bus notifier block.) Signed-off-by:

Re: [PATCH 3/5] iommu/arm-smmu: Introduce stream ID masking

2013-10-08 Thread Will Deacon
On Tue, Oct 08, 2013 at 10:27:22AM +0100, Andreas Herrmann wrote: Ie. use a mask based on smr_mask_bits to map all stream IDs of an SMMU to one context. This behaviour is controlled per SMMU node with DT property arm,smmu-mask-stream-ids and is only allowed if just a single master is

Re: [PATCH 3/5] iommu/arm-smmu: Introduce stream ID masking

2013-10-08 Thread Will Deacon
On Tue, Oct 08, 2013 at 05:40:21PM +0100, Andreas Herrmann wrote: On Tue, Oct 08, 2013 at 05:20:08PM +0200, Andreas Herrmann wrote: To be more specific: For SATA I'd need to specify 10 StreamIds. This would (1) exceed MAX_MASTER_STREAMIDS (currently it's 8) (Can easily be fixed by

[GIT PULL] iommu/arm-smmu: updates for 3.13

2013-10-09 Thread Will Deacon
iommu/arm-smmu: Print context fault information iommu/arm-smmu: Clear global and context bank fault status registers Julia Lawall (1): iommu/arm-smmu: replace devm_request_and_ioremap by devm_ioremap_resource Will Deacon (1): iommu/arm-smmu: use relaxed accessors where possible

Re: [PATCH 1/7] iommu/arm-smmu: Introduce driver option handling

2013-10-10 Thread Will Deacon
On Wed, Oct 09, 2013 at 11:38:00PM +0100, Andreas Herrmann wrote: Introduce handling of driver options. Options are set based on DT information when probing an SMMU device. The first option introduced is arm,smmu-isolate-devices. (It will be used in the bus notifier block.) Signed-off-by:

Re: [PATCH 4/7] iommu/arm-smmu: Support buggy implementations where all config accesses are secure

2013-10-10 Thread Will Deacon
On Wed, Oct 09, 2013 at 11:38:03PM +0100, Andreas Herrmann wrote: In such a case we have to use secure aliases of some non-secure registers. This handling is switched on by DT property arm,smmu-secure-config-access for an SMMU node. Signed-off-by: Andreas Herrmann

Re: [PATCH 2/7] iommu/arm-smmu: Introduce bus notifier block

2013-10-10 Thread Will Deacon
On Wed, Oct 09, 2013 at 11:38:01PM +0100, Andreas Herrmann wrote: drivers/iommu/arm-smmu.c | 53 ++ 1 file changed, 53 insertions(+) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 478c8ad..87239e8 100644 ---

Re: [PATCH 2/2] ARM: SMMU: return NULL on error in arm_smmu_iova_to_phys

2013-10-14 Thread Will Deacon
On Fri, Oct 11, 2013 at 02:24:47PM +0100, Antonios Motakis wrote: The return value of arm_smmu_iova_to_phys is directly passed to the user of the IOMMU API via iommu_iova_to_phys; however the ARM SMMU driver returns -EINVAL on error, which is not consistent with the rest of the drivers

Re: [PATCH 2/2] ARM: SMMU: return NULL on error in arm_smmu_iova_to_phys

2013-10-14 Thread Will Deacon
On Mon, Oct 14, 2013 at 04:17:51PM +0100, Antonios Motakis wrote: On Mon, Oct 14, 2013 at 2:48 PM, Will Deacon will.dea...@arm.com wrote: On Fri, Oct 11, 2013 at 02:24:47PM +0100, Antonios Motakis wrote: The return value of arm_smmu_iova_to_phys is directly passed to the user of the IOMMU

Re: [PATCH v2] ARM: SMMU: add devices attached to the SMMU to an IOMMU group

2013-10-28 Thread Will Deacon
On Mon, Oct 28, 2013 at 04:44:22PM +, Alex Williamson wrote: On Fri, 2013-10-18 at 17:08 +0200, Antonios Motakis wrote: IOMMU groups are expected by certain users of the IOMMU API, e.g. VFIO. Add new devices found by the SMMU driver to an IOMMU group to satisfy those users. Changes

Re: [PATCH 2/6] iommu/arm-smmu: Introduce bus notifier block

2013-10-30 Thread Will Deacon
On Fri, Oct 18, 2013 at 09:13:11PM +0100, Andreas Herrmann wrote: At the moment just handle BUS_NOTIFY_BIND_DRIVER to conditionally isolate all master devices for an SMMU. Depending on DT information each device is put into its own protection domain (if possible). For configuration with one

Re: [PATCH 3/6] iommu/arm-smmu: Support buggy implementations where all config accesses are secure

2013-10-30 Thread Will Deacon
On Fri, Oct 18, 2013 at 09:13:12PM +0100, Andreas Herrmann wrote: In such a case we have to use secure aliases of some non-secure registers. This handling is switched on by DT property arm,smmu-secure-config-access for an SMMU node. This looks fine, but won't apply without the device

Re: [GIT PULL] iommu/arm-smmu: updates for 3.13

2013-10-30 Thread Will Deacon
On Wed, Oct 09, 2013 at 06:02:38PM +0100, Will Deacon wrote: Hi Joerg, Please pull these ARM SMMU updates for 3.13. The bulk of the changes are from Andreas, who has been having fun running the driver on real hardware. I expect some additional patches from him in the future to add support

Re: [PATCH 5/6] ARM: dts: Add nodes for SMMUs on Calxeda ECX-2000

2013-10-30 Thread Will Deacon
On Fri, Oct 18, 2013 at 09:13:14PM +0100, Andreas Herrmann wrote: Signed-off-by: Andreas Herrmann andreas.herrm...@calxeda.com --- arch/arm/boot/dts/ecx-2000.dts| 44 +++-- arch/arm/boot/dts/ecx-common.dtsi |9 +--- drivers/iommu/arm-smmu.c

Re: [PATCH 6/6] documentation/iommu: Update description of ARM System MMU binding

2013-10-30 Thread Will Deacon
...@linaro.org Cc: Will Deacon will.dea...@arm.com Signed-off-by: Andreas Herrmann andreas.herrm...@calxeda.com --- .../devicetree/bindings/iommu/arm,smmu.txt | 12 1 file changed, 12 insertions(+) diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.txt b

Re: [PATCHv3 10/19] iommu/tegra: smmu: Get nvidia,swgroups from DT

2013-10-31 Thread Will Deacon
On Thu, Oct 31, 2013 at 05:31:33PM +, Mark Rutland wrote: On Wed, Oct 30, 2013 at 10:33:32PM +, Stephen Warren wrote: I'm afraid I still don't quite understand what a swgroup is. IIUC, the HW works like this based on comments in a previous patch: Each bus-master attached to

Re: [PATCHv3 14/19] iommu/tegra: smmu: Get nvidia,memory-clients from DT

2013-10-31 Thread Will Deacon
On Thu, Oct 31, 2013 at 05:40:29PM +, Mark Rutland wrote: For the ARM SMMU binding, each device has a #stream-id-cells property describing how many IDs it has, and then the SMMU node has a phandle+args linkage to each of the devices attached to it, describing their stream IDs. While this

Re: [PATCHv3 14/19] iommu/tegra: smmu: Get nvidia,memory-clients from DT

2013-10-31 Thread Will Deacon
On Thu, Oct 31, 2013 at 07:13:01PM +, Stephen Warren wrote: On 10/31/2013 12:02 PM, Will Deacon wrote: On Thu, Oct 31, 2013 at 05:40:29PM +, Mark Rutland wrote: For the ARM SMMU binding, each device has a #stream-id-cells property describing how many IDs it has, and then the SMMU

Re: [PATCHv3 14/19] iommu/tegra: smmu: Get nvidia,memory-clients from DT

2013-10-31 Thread Will Deacon
On Thu, Oct 31, 2013 at 07:25:25PM +, Stephen Warren wrote: On 10/31/2013 01:16 PM, Stephen Warren wrote: Hmm. That's interesting. I see that the ARM SMMU has a list of the clients it affects, whereas this Tegra series puts information into each client device about the SMMU(s) that

Re: [PATCHv3 14/19] iommu/tegra: smmu: Get nvidia,memory-clients from DT

2013-11-01 Thread Will Deacon
On Fri, Nov 01, 2013 at 04:08:52PM +, Stephen Warren wrote: On 10/31/2013 01:39 PM, Will Deacon wrote: On Thu, Oct 31, 2013 at 07:25:25PM +, Stephen Warren wrote: On 10/31/2013 01:16 PM, Stephen Warren wrote: Hmm. That's interesting. I see that the ARM SMMU has a list

Re: [PATCH 2/2] ARM: SMMU: return NULL on error in arm_smmu_iova_to_phys

2013-11-07 Thread Will Deacon
On Mon, Oct 14, 2013 at 06:09:48PM +0100, Will Deacon wrote: On Mon, Oct 14, 2013 at 04:17:51PM +0100, Antonios Motakis wrote: On Mon, Oct 14, 2013 at 2:48 PM, Will Deacon will.dea...@arm.com wrote: On Fri, Oct 11, 2013 at 02:24:47PM +0100, Antonios Motakis wrote: VFIO will exercise

Re: [PATCHv4 2/7] driver/core: Populate IOMMU'able devices in order

2013-11-11 Thread Will Deacon
On Mon, Nov 11, 2013 at 08:31:53AM +, Hiroshi Doyu wrote: An IOMMU device on the bus is poplulated first, IOMMU'able devices are done later. With CONFIG_OF_IOMMU, #stream-id-cells DT binding would be used to identify whether a device is IOMMU'able or not. If a device is IOMMU'able,

Re: [PATCHv4 2/7] driver/core: Populate IOMMU'able devices in order

2013-11-13 Thread Will Deacon
On Wed, Nov 13, 2013 at 04:06:10PM +, Hiroshi Doyu wrote: Will Deacon will.dea...@arm.com wrote @ Wed, 13 Nov 2013 15:38:04 +0100: On Tue, Nov 12, 2013 at 11:34:20PM +, Stephen Warren wrote: SMMU: smmu: smmu@xx { #smmu-cells = 1; } Affected

Re: [PATCHv4 2/7] driver/core: Populate IOMMU'able devices in order

2013-11-14 Thread Will Deacon
On Wed, Nov 13, 2013 at 05:53:36PM +, Stephen Warren wrote: On 11/13/2013 10:31 AM, Will Deacon wrote: On Wed, Nov 13, 2013 at 04:06:10PM +, Hiroshi Doyu wrote: This can be solved with introducing the fixed size of bitmap. The size of bitmap can be fixed even per SoC. In tegra we

Re: [PATCH -next] iommu/arm-smmu: fix error return code in arm_smmu_device_dt_probe()

2013-11-15 Thread Will Deacon
On Fri, Nov 15, 2013 at 09:42:30AM +, Wei Yongjun wrote: From: Wei Yongjun yongjun_...@trendmicro.com.cn Fix to return -ENODEV instead of 0 when context interrupt number does no match in arm_smmu_device_dt_probe(). Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn ---

Re: [PATCH -next] iommu/arm-smmu: fix potential NULL pointer dereference in arm_smmu_map()

2013-11-15 Thread Will Deacon
On Fri, Nov 15, 2013 at 09:45:03AM +, Wei Yongjun wrote: From: Wei Yongjun yongjun_...@trendmicro.com.cn The dereference should be moved below the NULL test. Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn --- drivers/iommu/arm-smmu.c | 3 +-- 1 file changed, 1

Re: Report from 2013 ARM kernel summit

2013-11-19 Thread Will Deacon
right now. It seems a little fragile to me too. I'd rather the IOMMU requirement be described more explicitly. I think that Will Deacon can do better than I. I already commented briefly here: http://www.spinics.net/lists/devicetree/msg11513.html basically deferring to DT people

Re: Report from 2013 ARM kernel summit

2013-11-20 Thread Will Deacon
On Tue, Nov 19, 2013 at 08:45:02PM +, Rob Herring wrote: On 11/19/2013 11:35 AM, Will Deacon wrote: Adding Andreas and Rob for input on potential binding additions to the SMMU. The above proposal would be an incompatible change. However, I think we could still deal with a change

Re: Report from 2013 ARM kernel summit

2013-11-21 Thread Will Deacon
On Wed, Nov 20, 2013 at 08:02:10PM +, Rob Herring wrote: On Wed, Nov 20, 2013 at 12:39 AM, Hiroshi Doyu hd...@nvidia.com wrote: smmu_a: iommu@ { #iommu-cells = 2; }; smmu_b: iommu@ { #iommu-cells = 3; };

Re: [PATCHv5 2/9] driver/core: populate devices in order for IOMMUs

2013-11-25 Thread Will Deacon
On Fri, Nov 22, 2013 at 05:35:58PM +, Stephen Warren wrote: On 11/22/2013 12:41 AM, Grant Likely wrote: It seems more that IOMMU attachment is closer to being a property of the bus rather than a property of the device itself. In that context it would make more sense for the bus device

Re: Report from 2013 ARM kernel summit

2013-11-25 Thread Will Deacon
Hi Stephen, On Thu, Nov 21, 2013 at 06:40:28PM +, Stephen Warren wrote: On 11/21/2013 04:00 AM, Will Deacon wrote: On Wed, Nov 20, 2013 at 08:02:10PM +, Rob Herring wrote: For the topology above where you are chaining iommu's, I think something like this is more accurately

[PATCH 1/3] iommu/arm-smmu: use mutex instead of spinlock for locking page tables

2013-11-29 Thread Will Deacon
is then reworked so that it only reads the page tables, and can run in a lockless fashion, leaving the mutex to guard against concurrent mapping threads. Signed-off-by: Will Deacon will.dea...@arm.com --- drivers/iommu/arm-smmu.c | 62 1 file changed, 26

[PATCH 2/3] iommu/arm-smmu: remove potential NULL dereference on mapping path

2013-11-29 Thread Will Deacon
-by: Will Deacon will.dea...@arm.com --- drivers/iommu/arm-smmu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 6dbcaa4433cd..ef77e3dd6dd2 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -1423,9 +1423,8

[PATCH 0/3] iommu: arm/smmu: fixes for 3.13

2013-11-29 Thread Will Deacon
() Will Deacon (2): iommu/arm-smmu: use mutex instead of spinlock for locking page tables iommu/arm-smmu: remove potential NULL dereference on mapping path drivers/iommu/arm-smmu.c | 66 1 file changed, 28 insertions(+), 38 deletions(-) -- 1.8.2.2

[PATCH 4/4] iommu/arm-smmu: add support for IOMMU_EXEC

2013-11-29 Thread Will Deacon
Previously, all of our mappings were marked as executable, which isn't usually required. Now that we have the IOMMU_EXEC flag, use that to determine whether or not a mapping should be marked as executable. Signed-off-by: Will Deacon will.dea...@arm.com --- drivers/iommu/arm-smmu.c | 9

[PATCH 2/4] iommu/arm-smmu: use VA_BITS to determine arm64 virtual address space

2013-11-29 Thread Will Deacon
With the introduction of the VA_BITS definition for arm64, make use of it in the driver, allowing up to 42-bits of VA space when configured with 64k pages. Signed-off-by: Will Deacon will.dea...@arm.com --- drivers/iommu/arm-smmu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff

[PATCH 3/4] iommu: add IOMMU_EXEC flag for safely allowing XN mappings

2013-11-29 Thread Will Deacon
Whilst most IOMMU mappings should probably be non-executable, there may be cases (HSA?) where executable mappings are required. This patch introduces a new mapping flag, IOMMU_EXEC, to indicate that the mapping should be mapped as executable. Signed-off-by: Will Deacon will.dea...@arm.com

[PATCH 1/4] iommu/arm-smmu: add devices attached to the SMMU to an IOMMU group

2013-11-29 Thread Will Deacon
a.mota...@virtualopensystems.com Signed-off-by: Will Deacon will.dea...@arm.com --- drivers/iommu/arm-smmu.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index e46a88700b68..879da20617fb 100644

Re: [PATCHv6 05/13] iommu/core: add ops-{bound,unbind}_driver()

2013-12-04 Thread Will Deacon
Hi Hiroshi, On Wed, Dec 04, 2013 at 07:40:27AM +, Hiroshi Doyu wrote: On Mon, 25 Nov 2013 14:49:37 +0100 Hiroshi Doyu hd...@nvidia.com wrote: Hi Joerg, Do you have some time to review this patch along with the following ones? [PATCHv6 02/13] iommu/of: introduce a global

[GIT PULL] iommu: arm/smmu: fixes for 3.13

2013-12-06 Thread Will Deacon
) Wei Yongjun (1): iommu/arm-smmu: fix error return code in arm_smmu_device_dt_probe() Will Deacon (2): iommu/arm-smmu: use mutex instead of spinlock for locking page tables iommu/arm-smmu: remove potential NULL dereference on mapping path drivers/iommu/arm-smmu.c

Re: [PATCH] iommu/arm-smmu: change pud/pmd entry fill sequence

2014-01-14 Thread Will Deacon
On Tue, Jan 14, 2014 at 09:02:49AM +, Yifan Zhang wrote: It seems this patch is still not merged yet, any concerns about it ? No, I was planning to send it at -rc1 with a CC stable. Will ___ iommu mailing list iommu@lists.linux-foundation.org

Re: [PATCH v3 02/11] iommu/arm-smmu: Introduce iommu_group notifier block

2014-01-22 Thread Will Deacon
Hi Varun, Andreas, On Tue, Jan 21, 2014 at 05:48:02PM +, Varun Sethi wrote: +static int arm_smmu_group_notifier(struct notifier_block *nb, + unsigned long action, void *data) +{ + struct device *dev = data; + struct dma_iommu_mapping *mapping; +

Re: [PATCH v3 02/11] iommu/arm-smmu: Introduce iommu_group notifier block

2014-01-22 Thread Will Deacon
On Wed, Jan 22, 2014 at 01:14:13PM +, Varun Sethi wrote: On Tue, Jan 21, 2014 at 05:48:02PM +, Varun Sethi wrote: +static int arm_smmu_group_notifier(struct notifier_block *nb, + unsigned long action, void *data) { + struct device *dev =

Re: [PATCH 04/11] iommu/arm-smmu: Introduce automatic stream-id-masking

2014-01-22 Thread Will Deacon
Hi Andreas, This patch always requires some extra brain cycles when reviewing! On Thu, Jan 16, 2014 at 12:44:16PM +, Andreas Herrmann wrote: Try to determine a mask that can be used for all StreamIDs of a master device. This allows to use just one SMR group instead of number-of-streamids

Re: [PATCH 05/11] iommu/arm-smmu: Check for duplicate stream IDs when registering master devices

2014-01-22 Thread Will Deacon
On Thu, Jan 16, 2014 at 12:44:17PM +, Andreas Herrmann wrote: Cc: Andreas Herrmann herrmann.der.u...@googlemail.com Signed-off-by: Andreas Herrmann andreas.herrm...@calxeda.com --- drivers/iommu/arm-smmu.c | 25 ++--- 1 file changed, 22 insertions(+), 3 deletions(-)

Re: [PATCH 10/11] arm: dma-mapping: Add additional parameters to arm_iommu_create_mapping

2014-01-22 Thread Will Deacon
On Thu, Jan 16, 2014 at 12:44:22PM +, Andreas Herrmann wrote: The new parameters are dma_addr_t grow_size Specifies the size by which the mapping will be extended in case that no sufficient space is left in the mapping to handle an iova allocation request.

Re: [PATCH v2 08/11] of: Increase MAX_PHANDLE_ARGS

2014-01-29 Thread Will Deacon
On Wed, Jan 29, 2014 at 05:26:35PM +, Suravee Suthikulanit wrote: On 1/29/2014 11:16 AM, Andreas Herrmann wrote: On Wed, Jan 29, 2014 at 11:59:12AM -0500, Suravee Suthikulanit wrote: Actually, we are using 32 on the AMD system. So, do you think we can set this to 32 instead? I think

Re: [PATCH v2 08/11] of: Increase MAX_PHANDLE_ARGS

2014-02-03 Thread Will Deacon
On Fri, Jan 31, 2014 at 04:24:09PM +, Rob Herring wrote: On Thu, Jan 30, 2014 at 11:45 AM, Andreas Herrmann andreas.herrm...@calxeda.com wrote: Do you agree on increasing MAX_PHANDLE_ARGS to 32? Yes, but more than that will require a closer look. Please get this into next early in the

Re: IOMMU DMA-mapping API for arm64 ?

2014-02-06 Thread Will Deacon
On Thu, Feb 06, 2014 at 05:05:45AM +, Ritesh Harjani wrote: Hi everyone, I tried looking for IOMMU support in ARM64 but what I was able to see is only swiotlb is currently supported. Based on my understanding for IOMMU support, we need DMA-MAPPING API to have IOMMU ops field, similar

[PATCH 1/5] iommu/arm-smmu: fix pud/pmd entry fill sequence

2014-02-06 Thread Will Deacon
-by: Yifan Zhang zhan...@marvell.com Signed-off-by: Will Deacon will.dea...@arm.com --- drivers/iommu/arm-smmu.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 8911850c9444..9f210de6537e 100644

[PATCH 2/5] iommu/arm-smmu: really fix page table locking

2014-02-06 Thread Will Deacon
instead of GFP_KERNEL. Cc: sta...@vger.kernel.org Reported-by: Andreas Herrmann andreas.herrm...@calxeda.com Signed-off-by: Will Deacon will.dea...@arm.com --- drivers/iommu/arm-smmu.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b

[PATCH 5/5] iommu/arm-smmu: fix compilation issue when !CONFIG_ARM_AMBA

2014-02-06 Thread Will Deacon
If !CONFIG_ARM_AMBA, we shouldn't try to register ourselves with the amba_bustype. Signed-off-by: Will Deacon will.dea...@arm.com --- drivers/iommu/arm-smmu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 0ae4dd39197f

[PATCH 3/5] iommu/arm-smmu: fix table flushing during initial allocations

2014-02-06 Thread Will Deacon
during initial table allocation, and moves the dsb required by coherent table walkers into the helper. Signed-off-by: Will Deacon will.dea...@arm.com --- drivers/iommu/arm-smmu.c | 51 +--- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git

[PATCH 4/5] iommu/arm-smmu: set CBARn.BPSHCFG to NSH for s1-s2-bypass contexts

2014-02-06 Thread Will Deacon
actually need to program CBARn.BPSHCFG for s1-s2-bypass contexts to act as non-shareable in order for the shareability configured in the corresponding TTBCR not to be overridden with an outer-shareable attribute. Signed-off-by: Will Deacon will.dea...@arm.com --- drivers/iommu/arm-smmu.c | 16

[PATCH 0/5] iommu/arm-smmu: fixes for 3.14

2014-02-06 Thread Will Deacon
, and noticed a shareability mismatch between the CPU and the SMMU These issues are all fixed here and have been tests on both arm and arm64 based systems. All feedback welcome, Will Will Deacon (4): iommu/arm-smmu: really fix page table locking iommu/arm-smmu: fix table flushing during initial

Re: [PATCH 5/5] iommu/arm-smmu: fix compilation issue when !CONFIG_ARM_AMBA

2014-02-13 Thread Will Deacon
On Thu, Feb 13, 2014 at 04:55:25PM +, Timur Tabi wrote: On Thu, Feb 6, 2014 at 12:09 PM, Will Deacon will.dea...@arm.com wrote: diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 0ae4dd39197f..6fe7922ecc1d 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu

Re: [GIT PULL] iommu/arm-smmu: fixes for 3.14

2014-02-18 Thread Will Deacon
Hi Joerg, On Tue, Feb 18, 2014 at 05:50:27PM +, Joerg Roedel wrote: On Mon, Feb 10, 2014 at 06:32:32PM +, Will Deacon wrote: - Andreas Herrmann took the driver for a run with a real SATA controller, which caused the new mutex-based locking to explode since we require

Re: [GIT PULL] iommu/arm-smmu: fixes for 3.14

2014-02-18 Thread Will Deacon
On Tue, Feb 18, 2014 at 06:36:26PM +, Will Deacon wrote: On Tue, Feb 18, 2014 at 05:50:27PM +, Joerg Roedel wrote: I just did quick review of the changes. Was the SATA controller using the IOMMU through the DMA-API? In this case you would need the IRQ-safe spinlocks to avoid dead

Re: [GIT PULL] iommu/arm-smmu: fixes for 3.14

2014-02-20 Thread Will Deacon
Hi Joerg, On Thu, Feb 20, 2014 at 11:29:19AM +, Joerg Roedel wrote: On Tue, Feb 18, 2014 at 07:21:37PM +, Will Deacon wrote: FWIW, here's a diff you could apply as a fixup (or I can send a new pull request if you prefer). It's slightly messy because I had to rename a parameter

[PATCH 4/5] iommu/arm-smmu: clean up use of `flags' in page table handling code

2014-02-21 Thread Will Deacon
`flags') and pte protection bits (now `prot'). Signed-off-by: Will Deacon will.dea...@arm.com --- drivers/iommu/arm-smmu.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index

[PATCH 1/5] iommu/arm-smmu: set MAX_MASTER_STREAMIDS to MAX_PHANDLE_ARGS

2014-02-21 Thread Will Deacon
From: Andreas Herrmann andreas.herrm...@calxeda.com The DT parsing code that determines stream IDs uses of_parse_phandle_with_args and thus MAX_MASTER_STREAMIDS is always bound by MAX_PHANDLE_ARGS. Signed-off-by: Andreas Herrmann andreas.herrm...@calxeda.com Signed-off-by: Will Deacon will.dea

[PATCH 2/5] iommu/arm-smmu: support buggy implementations with secure cfg accesses

2014-02-21 Thread Will Deacon
[will: merged with driver option handling patch] Signed-off-by: Will Deacon will.dea...@arm.com --- drivers/iommu/arm-smmu.c | 58 +++- 1 file changed, 48 insertions(+), 10 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index

[PATCH 0/5] iommu/arm-smmu: updates for 3.15

2014-02-21 Thread Will Deacon
Will Deacon (2): iommu/arm-smmu: clean up use of `flags' in page table handling code iommu/arm-smmu: provide option to dsb macro when publishing tables .../devicetree/bindings/iommu/arm,smmu.txt | 6 ++ drivers/iommu/arm-smmu.c | 100 ++--- 2

  1   2   3   4   5   6   7   8   9   10   >