Re: [PATCH v4 1/6] of: iommu: add ptr to OF node arg to of_iommu_configure()

2015-01-28 Thread Laurent Pinchart
Hi Will, On Wednesday 28 January 2015 11:33:00 Will Deacon wrote: On Mon, Jan 26, 2015 at 06:49:01PM +, Murali Karicheri wrote: On 01/25/2015 08:32 AM, Laurent Pinchart wrote: On Friday 23 January 2015 17:32:34 Murali Karicheri wrote: Function of_iommu_configure() is called from

Re: [PATCH v4 1/6] of: iommu: add ptr to OF node arg to of_iommu_configure()

2015-01-28 Thread Laurent Pinchart
On Wednesday 28 January 2015 12:29:42 Will Deacon wrote: On Wed, Jan 28, 2015 at 12:23:03PM +, Laurent Pinchart wrote: On Wednesday 28 January 2015 11:33:00 Will Deacon wrote: On Mon, Jan 26, 2015 at 06:49:01PM +, Murali Karicheri wrote: On 01/25/2015 08:32 AM, Laurent Pinchart

Re: [PATCH 02/15] iommu: Introduce iommu domain types

2015-01-28 Thread Will Deacon
Hi Joerg, Thanks for posting this! On Mon, Jan 26, 2015 at 11:51:32PM +, Joerg Roedel wrote: From: Joerg Roedel jroe...@suse.de This allows to handle domains differently based on their type in the future. An IOMMU driver can implement certain optimizations for DMA-API domains for

Re: [RFC PATCH 3/5] iommu: implement common IOMMU ops for DMA mapping

2015-01-28 Thread Will Deacon
On Tue, Jan 27, 2015 at 12:38:09PM +, Joerg Roedel wrote: On Tue, Jan 27, 2015 at 12:27:39PM +, Robin Murphy wrote: Laz^WPragmatism - I'm expecting quite a lot of changes to get this looking good, so keeping the series as lean as possible to aid reviewing/rebasing/etc. seemed

Re: [PATCH v4 1/6] of: iommu: add ptr to OF node arg to of_iommu_configure()

2015-01-28 Thread Will Deacon
On Wed, Jan 28, 2015 at 01:15:10PM +, Laurent Pinchart wrote: On Wednesday 28 January 2015 12:29:42 Will Deacon wrote: On Wed, Jan 28, 2015 at 12:23:03PM +, Laurent Pinchart wrote: On Wednesday 28 January 2015 11:33:00 Will Deacon wrote: On Mon, Jan 26, 2015 at 06:49:01PM +,

Re: [PATCH 4/5] iommu: Make sure a device is always attached to a domain

2015-01-28 Thread Will Deacon
On Tue, Jan 27, 2015 at 12:08:58AM +, Joerg Roedel wrote: From: Joerg Roedel jroe...@suse.de Make use of the default domain and re-attach a device to it when it is detached from another domain. Also enforce that a device has to be in the default domain before it can be attached to a

Re: [PATCH 2/5] iommu: Allocate a default domain for iommu groups

2015-01-28 Thread Will Deacon
On Tue, Jan 27, 2015 at 12:08:56AM +, Joerg Roedel wrote: From: Joerg Roedel jroe...@suse.de The default domain will be used (if supported by the iommu driver) when the devices in the iommu group are not attached to any other domain. Signed-off-by: Joerg Roedel jroe...@suse.de ---

Re: [PATCH 3/5] iommu: Limit iommu_attach/detach_device to devices with their own group

2015-01-28 Thread Will Deacon
On Tue, Jan 27, 2015 at 12:08:57AM +, Joerg Roedel wrote: From: Joerg Roedel jroe...@suse.de This patch changes the behavior of the iommu_attach_device and iommu_detach_device functions. With this change these functions only work on devices that have their own group. For all other

Re: [PATCH] iommu/ipmmu-vmsa: Fix IOMMU lookup when multiple IOMMUs are registered

2015-01-28 Thread Laurent Pinchart
Hi Joerg, Could you please pick this patch up for v3.20 ? On Saturday 24 January 2015 23:13:50 Laurent Pinchart wrote: When adding a new device the driver loops over all registered IOMMUs and calls the ipmmu_find_utlbs() function to parse the DT iommus attribute. The function returns an error

Re: [PATCH v5 3/8] of: fix size when dma-range is not used

2015-01-28 Thread Robin Murphy
Hi Murali, [sorry, missed replying to yesterday's version] On 27/01/15 21:00, Murali Karicheri wrote: Fix the dma-range size when the DT attribute is missing. i.e set size to dev-coherent_dma_mask + 1 instead of dev-coherent_dma_mask. Also add code to check invalid values of size configured

Re: [PATCH] iommu/arm-smmu: use a threaded handler for context interrupts

2015-01-28 Thread Will Deacon
On Fri, Jan 23, 2015 at 10:33:20PM +, Mitchel Humpherys wrote: On Fri, Jan 23 2015 at 03:24:15 AM, Will Deacon will.dea...@arm.com wrote: On Thu, Jan 22, 2015 at 11:48:02PM +, Mitchel Humpherys wrote: Context interrupts can call domain-specific handlers which might sleep. Currently

Re: [PATCH v4 1/6] of: iommu: add ptr to OF node arg to of_iommu_configure()

2015-01-28 Thread Will Deacon
On Wed, Jan 28, 2015 at 12:23:03PM +, Laurent Pinchart wrote: On Wednesday 28 January 2015 11:33:00 Will Deacon wrote: On Mon, Jan 26, 2015 at 06:49:01PM +, Murali Karicheri wrote: On 01/25/2015 08:32 AM, Laurent Pinchart wrote: On Friday 23 January 2015 17:32:34 Murali Karicheri

Re: [PATCH v4 3/6] of: fix size when dma-range is not used

2015-01-28 Thread Catalin Marinas
On Tue, Jan 27, 2015 at 06:55:15PM +, Murali Karicheri wrote: On 01/27/2015 06:27 AM, Robin Murphy wrote: On 23/01/15 22:32, Murali Karicheri wrote: Fix the dma-range size when the DT attribute is missing. i.e set size to dev-coherent_dma_mask + 1 instead of dev-coherent_dma_mask. To

Re: [PATCH v4 1/6] of: iommu: add ptr to OF node arg to of_iommu_configure()

2015-01-28 Thread Will Deacon
On Mon, Jan 26, 2015 at 06:49:01PM +, Murali Karicheri wrote: On 01/25/2015 08:32 AM, Laurent Pinchart wrote: Hi Murali, Thank you for the patch. On Friday 23 January 2015 17:32:34 Murali Karicheri wrote: Function of_iommu_configure() is called from of_dma_configure() to setup

Re: [v3 26/26] iommu/vt-d: Add a command line parameter for VT-d posted-interrupts

2015-01-28 Thread David Woodhouse
On Fri, 2014-12-12 at 23:15 +0800, Feng Wu wrote: Enable VT-d Posted-Interrtups and add a command line parameter for it. Signed-off-by: Feng Wu feng...@intel.com Acked-by: David Woodhouse david.woodho...@intel.com -- David WoodhouseOpen Source Technology Centre

Re: [PATCH v4 3/6] of: fix size when dma-range is not used

2015-01-28 Thread Catalin Marinas
On Wed, Jan 28, 2015 at 03:55:57PM +, Robin Murphy wrote: On 28/01/15 11:05, Catalin Marinas wrote: On Tue, Jan 27, 2015 at 06:55:15PM +, Murali Karicheri wrote: How about having the logic like this? ret = of_dma_get_range(np, dma_addr, paddr, size); if (ret 0) {

Re: [PATCH v4 3/6] of: fix size when dma-range is not used

2015-01-28 Thread Murali Karicheri
On 01/28/2015 10:45 AM, Rob Herring wrote: On Wed, Jan 28, 2015 at 5:05 AM, Catalin Marinas catalin.mari...@arm.com wrote: On Tue, Jan 27, 2015 at 06:55:15PM +, Murali Karicheri wrote: On 01/27/2015 06:27 AM, Robin Murphy wrote: On 23/01/15 22:32, Murali Karicheri wrote: Fix the

Re: [PATCH v4 1/6] of: iommu: add ptr to OF node arg to of_iommu_configure()

2015-01-28 Thread Laurent Pinchart
Hi Will, On Wednesday 28 January 2015 13:32:19 Will Deacon wrote: On Wed, Jan 28, 2015 at 01:15:10PM +, Laurent Pinchart wrote: On Wednesday 28 January 2015 12:29:42 Will Deacon wrote: On Wed, Jan 28, 2015 at 12:23:03PM +, Laurent Pinchart wrote: On Wednesday 28 January 2015

Re: [v3 06/26] iommu, x86: No need to migrating irq for VT-d Posted-Interrupts

2015-01-28 Thread David Woodhouse
On Fri, 2014-12-12 at 23:14 +0800, Feng Wu wrote: We don't need to migrate the irqs for VT-d Posted-Interrupts here. When 'pst' is set in IRTE, the associated irq will be posted to guests instead of interrupt remapping. The destination of the interrupt is set in Posted-Interrupts Descriptor,

Re: [PATCH v5 3/8] of: fix size when dma-range is not used

2015-01-28 Thread Murali Karicheri
On 01/28/2015 06:21 AM, Robin Murphy wrote: Hi Murali, [sorry, missed replying to yesterday's version] On 27/01/15 21:00, Murali Karicheri wrote: Fix the dma-range size when the DT attribute is missing. i.e set size to dev-coherent_dma_mask + 1 instead of dev-coherent_dma_mask. Also add code

Re: [v3 08/26] iommu, x86: Add intel_irq_remapping_capability() for Intel

2015-01-28 Thread David Woodhouse
On Fri, 2014-12-12 at 23:14 +0800, Feng Wu wrote: Add the Intel side implementation for capability in struct irq_remap_ops. Signed-off-by: Feng Wu feng...@intel.com Reviewed-by: Jiang Liu jiang@linux.intel.com +static bool intel_irq_remapping_capability(enum irq_remap_cap cap) +{ +

[PATCH 24/26] iommu/fsl: Remove unneeded semicolon

2015-01-28 Thread Emil Medve
drivers/iommu/fsl_pamu_domain.c:859:2-3: Unneeded semicolon drivers/iommu/fsl_pamu_domain.c:833:2-3: Unneeded semicolon Signed-off-by: Emil Medve emilian.me...@freescale.com --- drivers/iommu/fsl_pamu_domain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 20/26] iommu/fsl: Fix alignment of some stray lines

2015-01-28 Thread Emil Medve
Signed-off-by: Emil Medve emilian.me...@freescale.com --- drivers/iommu/fsl_pamu.h| 2 +- drivers/iommu/fsl_pamu_domain.c | 15 ++- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/iommu/fsl_pamu.h b/drivers/iommu/fsl_pamu.h index 04dcd25..342ac6d

[PATCH 19/26] iommu/fsl: Fix some comments alignment

2015-01-28 Thread Emil Medve
Signed-off-by: Emil Medve emilian.me...@freescale.com --- drivers/iommu/fsl_pamu.c| 24 drivers/iommu/fsl_pamu_domain.c | 6 +++--- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index

[PATCH 22/26] iommu/fsl: Make local symbols static

2015-01-28 Thread Emil Medve
drivers/iommu/fsl_pamu.c:78:17: warning: symbol 'spaace_pool' was not declared. Should it be static? drivers/iommu/fsl_pamu.c:762:13: warning: symbol 'pamu_av_isr' was not declared. Should it be static? Signed-off-by: Emil Medve emilian.me...@freescale.com --- drivers/iommu/fsl_pamu.c | 4 ++--

[PATCH 26/26] iommu/fsl: Remove extra paranthesis

2015-01-28 Thread Emil Medve
Signed-off-by: Emil Medve emilian.me...@freescale.com --- drivers/iommu/fsl_pamu.c| 4 ++-- drivers/iommu/fsl_pamu.h| 4 ++-- drivers/iommu/fsl_pamu_domain.c | 8 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/iommu/fsl_pamu.c

[PATCH 10/26] iommu/fsl: Fix checkpatch type ALLOC_WITH_MULTIPLY

2015-01-28 Thread Emil Medve
WARNING:ALLOC_WITH_MULTIPLY: Prefer kcalloc over kzalloc with multiply + dma_domain-win_arr = kzalloc(sizeof(*dma_domain-win_arr) * + w_count, GFP_ATOMIC); Signed-off-by: Emil Medve emilian.me...@freescale.com ---

Re: [PATCH v4 3/6] of: fix size when dma-range is not used

2015-01-28 Thread Robin Murphy
On 28/01/15 11:05, Catalin Marinas wrote: On Tue, Jan 27, 2015 at 06:55:15PM +, Murali Karicheri wrote: On 01/27/2015 06:27 AM, Robin Murphy wrote: On 23/01/15 22:32, Murali Karicheri wrote: Fix the dma-range size when the DT attribute is missing. i.e set size to dev-coherent_dma_mask + 1

[PATCH 05/26] iommu/fsl: Fix checkpatch type LINE_SPACING

2015-01-28 Thread Emil Medve
CHECK:LINE_SPACING: Please don't use multiple blank lines + + CHECK:LINE_SPACING: Please don't use multiple blank lines + + CHECK:LINE_SPACING: Please don't use multiple blank lines + + CHECK:LINE_SPACING: Please don't use multiple blank lines + + WARNING:LINE_SPACING: Missing a blank line

[PATCH 12/26] iommu/fsl: Fix checkpatch type TYPO_SPELLING

2015-01-28 Thread Emil Medve
CHECK:TYPO_SPELLING: 'accomodate' may be misspelled - perhaps 'accommodate'? + * Hard coded value for the PAACT size to accomodate Signed-off-by: Emil Medve emilian.me...@freescale.com --- drivers/iommu/fsl_pamu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 00/26] iommu/fsl: Various cleanup

2015-01-28 Thread Emil Medve
Currently a PAMU driver patch is very likely to receive some checkpatch complaints about the code in the context of the patch. This sequence is an attempt to fix most of that and make the dirver more readable Also fixed a subset of the sparse and coccinelle reported issues Emil Medve (26):

[PATCH 18/26] iommu/fsl: Fix checkpatch type PARENTHESIS_ALIGNMENT

2015-01-28 Thread Emil Medve
CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis + set_bf(paace-addr_bitfields, PAACE_AF_V, +PAACE_V_INVALID); CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis + set_bf(paace-addr_bitfields, PAACE_AF_AP, +

[PATCH 06/26] iommu/fsl: Fix checkpatch type LEADING_SPACE

2015-01-28 Thread Emil Medve
WARNING:LEADING_SPACE: please, no spaces at the start of a line + return __ffs(subwindow_cnt) - 1;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line +(PAACE_ATM_WINDOW_XLATE | PAACE_ATM_PAGE_XLATE)$ Signed-off-by: Emil Medve emilian.me...@freescale.com ---

[PATCH 02/26] iommu/fsl: Use SVR_* instead of magic numbers

2015-01-28 Thread Emil Medve
Signed-off-by: Emil Medve emilian.me...@freescale.com --- drivers/iommu/fsl_pamu.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index 652c34d..7d9f8a0 100644 --- a/drivers/iommu/fsl_pamu.c +++

[PATCH 23/26] iommu/fsl: Use NULL instead of zero

2015-01-28 Thread Emil Medve
drivers/iommu/fsl_pamu.c:532:72: warning: Using plain integer as NULL pointer drivers/iommu/fsl_pamu.c:559:72: warning: Using plain integer as NULL pointer drivers/iommu/fsl_pamu.c:570:66: warning: Using plain integer as NULL pointer Signed-off-by: Emil Medve emilian.me...@freescale.com ---

Re: [PATCH 2/5] iommu: Allocate a default domain for iommu groups

2015-01-28 Thread Robin Murphy
On 28/01/15 14:30, Will Deacon wrote: On Tue, Jan 27, 2015 at 12:08:56AM +, Joerg Roedel wrote: From: Joerg Roedel jroe...@suse.de The default domain will be used (if supported by the iommu driver) when the devices in the iommu group are not attached to any other domain. Signed-off-by:

Re: [PATCH v4 1/6] of: iommu: add ptr to OF node arg to of_iommu_configure()

2015-01-28 Thread Murali Karicheri
On 01/28/2015 08:32 AM, Will Deacon wrote: On Wed, Jan 28, 2015 at 01:15:10PM +, Laurent Pinchart wrote: On Wednesday 28 January 2015 12:29:42 Will Deacon wrote: On Wed, Jan 28, 2015 at 12:23:03PM +, Laurent Pinchart wrote: On Wednesday 28 January 2015 11:33:00 Will Deacon wrote: On

Re: [v3 02/26] iommu: Add new member capability to struct irq_remap_ops

2015-01-28 Thread David Woodhouse
On Fri, 2014-12-12 at 23:14 +0800, Feng Wu wrote: This patch adds a new member capability to struct irq_remap_ops, this new function ops can be used to check whether some features are supported, such as VT-d Posted-Interrupts. + /* Check some capability is supported */ + bool

Re: [v3 03/26] iommu, x86: Define new irte structure for VT-d Posted-Interrupts

2015-01-28 Thread David Woodhouse
On Fri, 2014-12-12 at 23:14 +0800, Feng Wu wrote: Add a new irte_pi structure for VT-d Posted-Interrupts. Signed-off-by: Feng Wu feng...@intel.com Reviewed-by: Jiang Liu jiang@linux.intel.com Acked-by: David.Woodhouse david.woodho...@intel.com I think it makes most sense for this to go

Re: [v3 07/26] iommu, x86: Add cap_pi_support() to detect VT-d PI capability

2015-01-28 Thread David Woodhouse
On Fri, 2014-12-12 at 23:14 +0800, Feng Wu wrote: Add helper function to detect VT-d Posted-Interrupts capability. Signed-off-by: Feng Wu feng...@intel.com Reviewed-by: Jiang Liu jiang@linux.intel.com Acked-by: David Woodhouse david.woodho...@intel.com -- David Woodhouse

Re: [v3 04/26] iommu, x86: Implement irq_set_vcpu_affinity for intel_ir_chip

2015-01-28 Thread David Woodhouse
On Fri, 2014-12-12 at 23:14 +0800, Feng Wu wrote: Implement irq_set_vcpu_affinity for intel_ir_chip. Signed-off-by: Feng Wu feng...@intel.com Reviewed-by: Jiang Liu jiang@linux.intel.com Acked-by: David.Woodhouse david.woodho...@intel.com assuming a suitable answer to... +

RE: [v3 04/26] iommu, x86: Implement irq_set_vcpu_affinity for intel_ir_chip

2015-01-28 Thread Wu, Feng
-Original Message- From: David Woodhouse [mailto:dw...@infradead.org] Sent: Wednesday, January 28, 2015 11:27 PM To: Wu, Feng Cc: t...@linutronix.de; mi...@redhat.com; h...@zytor.com; x...@kernel.org; g...@kernel.org; pbonz...@redhat.com; j...@8bytes.org;

[PATCH 09/26] iommu/fsl: Fix checkpatch type ALLOC_SIZEOF_STRUCT

2015-01-28 Thread Emil Medve
CHECK:ALLOC_SIZEOF_STRUCT: Prefer kzalloc(sizeof(*data)...) over kzalloc(sizeof(struct pamu_isr_data)...) + data = kzalloc(sizeof(struct pamu_isr_data), GFP_KERNEL); CHECK:ALLOC_SIZEOF_STRUCT: Prefer kzalloc(sizeof(*dma_domain-win_arr)...) over kzalloc(sizeof(struct dma_window)...) +

Re: [PATCH v4 3/6] of: fix size when dma-range is not used

2015-01-28 Thread Rob Herring
On Wed, Jan 28, 2015 at 5:05 AM, Catalin Marinas catalin.mari...@arm.com wrote: On Tue, Jan 27, 2015 at 06:55:15PM +, Murali Karicheri wrote: On 01/27/2015 06:27 AM, Robin Murphy wrote: On 23/01/15 22:32, Murali Karicheri wrote: Fix the dma-range size when the DT attribute is missing.

Re: [PATCH v4 3/6] of: fix size when dma-range is not used

2015-01-28 Thread Catalin Marinas
On Wed, Jan 28, 2015 at 03:45:19PM +, Rob Herring wrote: On Wed, Jan 28, 2015 at 5:05 AM, Catalin Marinas catalin.mari...@arm.com wrote: On Tue, Jan 27, 2015 at 06:55:15PM +, Murali Karicheri wrote: How about having the logic like this? ret = of_dma_get_range(np, dma_addr,