All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/26] iommu/fsl: Various cleanup
@ 2015-01-28 14:34 Emil Medve
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  0 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: 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):
  iommu/fsl: Sprinkle some __init* annotations
  iommu/fsl: Use SVR_* instead of magic numbers
  iommu/fsl: Remove unused/extra includes
  iommu/fsl: Fix checkpatch type SPACE_BEFORE_TAB
  iommu/fsl: Fix checkpatch type LINE_SPACING
  iommu/fsl: Fix checkpatch type LEADING_SPACE
  iommu/fsl: Fix checkpath type BRACES
  iommu/fsl: Fix checkpatch type CODE_INDENT
  iommu/fsl: Fix checkpatch type ALLOC_SIZEOF_STRUCT
  iommu/fsl: Fix checkpatch type ALLOC_WITH_MULTIPLY
  iommu/fsl: Fix checkpatch type OOM_MESSAGE
  iommu/fsl: Fix checkpatch type TYPO_SPELLING
  iommu/fsl: Fix checkpatch type PREFER_PACKED
  iommu/fsl: Fix checkpatch type QUOTED_WHITESPACE_BEFORE_NEWLINE
  iommu/fsl: Fix checkpatch type SPACING
  iommu/fsl: Use a device pointer to make lines shorter
  iommu/fsl: Remove pr/dev_*() prefixes
  iommu/fsl: Fix checkpatch type PARENTHESIS_ALIGNMENT
  iommu/fsl: Fix some comments alignment
  iommu/fsl: Fix alignment of some stray lines
  iommu/fsl: Fix checkpatch type LONG_LINE
  iommu/fsl: Make local symbols static
  iommu/fsl: Use NULL instead of zero
  iommu/fsl: Remove unneeded semicolon
  iommu/fsl: Don't use integers values with bool type
  iommu/fsl: Remove extra paranthesis

 arch/powerpc/include/asm/fsl_pamu_stash.h |   4 +-
 drivers/iommu/fsl_pamu.c                  | 204 ++++++++++++++----------------
 drivers/iommu/fsl_pamu.h                  |  15 ++-
 drivers/iommu/fsl_pamu_domain.c           | 173 +++++++++++--------------
 4 files changed, 179 insertions(+), 217 deletions(-)

-- 
2.2.2

^ permalink raw reply	[flat|nested] 73+ messages in thread

* [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-2-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 02/26] iommu/fsl: Use SVR_* instead of magic numbers Emil Medve
                     ` (26 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: Emil Medve

Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 drivers/iommu/fsl_pamu.c        | 12 ++++++------
 drivers/iommu/fsl_pamu_domain.c |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index d958e65..652c34d 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -50,7 +50,7 @@ struct pamu_isr_data {
 
 static struct paace *ppaact;
 static struct paace *spaact;
-static struct ome *omt;
+static struct ome *omt __initdata;
 
 /*
  * Table for matching compatible strings, for device tree
@@ -59,7 +59,7 @@ static struct ome *omt;
  * SOCs. For the older SOCs "fsl,qoriq-device-config-1.0"
  * string would be used.
 */
-static const struct of_device_id guts_device_ids[] = {
+static const struct of_device_id guts_device_ids[] __initconst = {
 	{ .compatible = "fsl,qoriq-device-config-1.0", },
 	{ .compatible = "fsl,qoriq-device-config-2.0", },
 	{}
@@ -612,7 +612,7 @@ found_cpu_node:
  * Memory accesses to QMAN and BMAN private memory need not be coherent, so
  * clear the PAACE entry coherency attribute for them.
  */
-static void setup_qbman_paace(struct paace *ppaace, int  paace_type)
+static void __init setup_qbman_paace(struct paace *ppaace, int  paace_type)
 {
 	switch (paace_type) {
 	case QMAN_PAACE:
@@ -679,7 +679,7 @@ static void __init setup_omt(struct ome *omt)
  * Get the maximum number of PAACT table entries
  * and subwindows supported by PAMU
  */
-static void get_pamu_cap_values(unsigned long pamu_reg_base)
+static void __init get_pamu_cap_values(unsigned long pamu_reg_base)
 {
 	u32 pc_val;
 
@@ -689,7 +689,7 @@ static void get_pamu_cap_values(unsigned long pamu_reg_base)
 }
 
 /* Setup PAMU registers pointing to PAACT, SPAACT and OMT */
-int setup_one_pamu(unsigned long pamu_reg_base, unsigned long pamu_reg_size,
+static int __init setup_one_pamu(unsigned long pamu_reg_base, unsigned long pamu_reg_size,
 	           phys_addr_t ppaact_phys, phys_addr_t spaact_phys,
 		   phys_addr_t omt_phys)
 {
@@ -998,7 +998,7 @@ error:
 static const struct {
 	u32 svr;
 	u32 port_id;
-} port_id_map[] = {
+} port_id_map[] __initconst = {
 	{0x82100010, 0xFF000000},	/* P2040 1.0 */
 	{0x82100011, 0xFF000000},	/* P2040 1.1 */
 	{0x82100110, 0xFF000000},	/* P2041 1.0 */
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index c828f80..48a72b3 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -1095,7 +1095,7 @@ static const struct iommu_ops fsl_pamu_ops = {
 	.remove_device	= fsl_pamu_remove_device,
 };
 
-int pamu_domain_init(void)
+int __init pamu_domain_init(void)
 {
 	int ret = 0;
 
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 02/26] iommu/fsl: Use SVR_* instead of magic numbers
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-3-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 03/26] iommu/fsl: Remove unused/extra includes Emil Medve
                     ` (25 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: Emil Medve

Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 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
+++ b/drivers/iommu/fsl_pamu.c
@@ -31,6 +31,7 @@
 #include <linux/genalloc.h>
 #include <asm/io.h>
 #include <asm/bitops.h>
+#include <asm/mpc85xx.h>
 #include <asm/fsl_guts.h>
 
 #include "fsl_pamu.h"
@@ -999,19 +1000,19 @@ static const struct {
 	u32 svr;
 	u32 port_id;
 } port_id_map[] __initconst = {
-	{0x82100010, 0xFF000000},	/* P2040 1.0 */
-	{0x82100011, 0xFF000000},	/* P2040 1.1 */
-	{0x82100110, 0xFF000000},	/* P2041 1.0 */
-	{0x82100111, 0xFF000000},	/* P2041 1.1 */
-	{0x82110310, 0xFF000000},	/* P3041 1.0 */
-	{0x82110311, 0xFF000000},	/* P3041 1.1 */
-	{0x82010020, 0xFFF80000},	/* P4040 2.0 */
-	{0x82000020, 0xFFF80000},	/* P4080 2.0 */
-	{0x82210010, 0xFC000000},       /* P5010 1.0 */
-	{0x82210020, 0xFC000000},       /* P5010 2.0 */
-	{0x82200010, 0xFC000000},	/* P5020 1.0 */
-	{0x82050010, 0xFF800000},	/* P5021 1.0 */
-	{0x82040010, 0xFF800000},	/* P5040 1.0 */
+	{(SVR_P2040 << 8) | 0x10, 0xFF000000},	/* P2040 1.0 */
+	{(SVR_P2040 << 8) | 0x11, 0xFF000000},	/* P2040 1.1 */
+	{(SVR_P2041 << 8) | 0x10, 0xFF000000},	/* P2041 1.0 */
+	{(SVR_P2041 << 8) | 0x11, 0xFF000000},	/* P2041 1.1 */
+	{(SVR_P3041 << 8) | 0x10, 0xFF000000},	/* P3041 1.0 */
+	{(SVR_P3041 << 8) | 0x11, 0xFF000000},	/* P3041 1.1 */
+	{(SVR_P4040 << 8) | 0x20, 0xFFF80000},	/* P4040 2.0 */
+	{(SVR_P4080 << 8) | 0x20, 0xFFF80000},	/* P4080 2.0 */
+	{(SVR_P5010 << 8) | 0x10, 0xFC000000},	/* P5010 1.0 */
+	{(SVR_P5010 << 8) | 0x20, 0xFC000000},	/* P5010 2.0 */
+	{(SVR_P5020 << 8) | 0x10, 0xFC000000},	/* P5020 1.0 */
+	{(SVR_P5021 << 8) | 0x10, 0xFF800000},	/* P5021 1.0 */
+	{(SVR_P5040 << 8) | 0x10, 0xFF800000},	/* P5040 1.0 */
 };
 
 #define SVR_SECURITY	0x80000	/* The Security (E) bit */
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 03/26] iommu/fsl: Remove unused/extra includes
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations Emil Medve
  2015-01-28 14:34   ` [PATCH 02/26] iommu/fsl: Use SVR_* instead of magic numbers Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-4-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 04/26] iommu/fsl: Fix checkpatch type SPACE_BEFORE_TAB Emil Medve
                     ` (24 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: Emil Medve

linux/modules.h		- drivers can't be a module
linux/bootmem.h		- no boot time memory allocator is used
linux/notifier.h	- not used
etc.

Factorize common includes into fsl_pamu.h

Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 drivers/iommu/fsl_pamu.c        | 16 +++-------------
 drivers/iommu/fsl_pamu.h        |  2 ++
 drivers/iommu/fsl_pamu_domain.c | 20 ++------------------
 3 files changed, 7 insertions(+), 31 deletions(-)

diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index 7d9f8a0..d3a9fff 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -18,24 +18,14 @@
 
 #define pr_fmt(fmt)    "fsl-pamu: %s: " fmt, __func__
 
-#include <linux/init.h>
-#include <linux/iommu.h>
-#include <linux/slab.h>
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/mm.h>
+#include "fsl_pamu.h"
+
 #include <linux/interrupt.h>
-#include <linux/device.h>
-#include <linux/of_platform.h>
-#include <linux/bootmem.h>
 #include <linux/genalloc.h>
-#include <asm/io.h>
-#include <asm/bitops.h>
+
 #include <asm/mpc85xx.h>
 #include <asm/fsl_guts.h>
 
-#include "fsl_pamu.h"
-
 /* define indexes for each operation mapping scenario */
 #define OMI_QMAN        0x00
 #define OMI_FMAN        0x01
diff --git a/drivers/iommu/fsl_pamu.h b/drivers/iommu/fsl_pamu.h
index 8fc1a12..a7794b5 100644
--- a/drivers/iommu/fsl_pamu.h
+++ b/drivers/iommu/fsl_pamu.h
@@ -19,6 +19,8 @@
 #ifndef __FSL_PAMU_H
 #define __FSL_PAMU_H
 
+#include <linux/iommu.h>
+
 #include <asm/fsl_pamu_stash.h>
 
 /* Bit Field macros
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index 48a72b3..7ea93ae 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -19,26 +19,10 @@
 
 #define pr_fmt(fmt)    "fsl-pamu-domain: %s: " fmt, __func__
 
-#include <linux/init.h>
-#include <linux/iommu.h>
-#include <linux/notifier.h>
-#include <linux/slab.h>
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/mm.h>
-#include <linux/interrupt.h>
-#include <linux/device.h>
-#include <linux/of_platform.h>
-#include <linux/bootmem.h>
-#include <linux/err.h>
-#include <asm/io.h>
-#include <asm/bitops.h>
-
-#include <asm/pci-bridge.h>
-#include <sysdev/fsl_pci.h>
-
 #include "fsl_pamu_domain.h"
 
+#include <sysdev/fsl_pci.h>
+
 /*
  * Global spinlock that needs to be held while
  * configuring PAMU.
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 04/26] iommu/fsl: Fix checkpatch type SPACE_BEFORE_TAB
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (2 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 03/26] iommu/fsl: Remove unused/extra includes Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-5-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 05/26] iommu/fsl: Fix checkpatch type LINE_SPACING Emil Medve
                     ` (23 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: Emil Medve

WARNING:SPACE_BEFORE_TAB: please, no space before tabs
+^Iu32 ^Icpu;^I/* cpu number */$

WARNING:SPACE_BEFORE_TAB: please, no space before tabs
+^Iu32 ^Icache;^I/* cache to stash to: L1,L2,L3 */$

Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 arch/powerpc/include/asm/fsl_pamu_stash.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/fsl_pamu_stash.h b/arch/powerpc/include/asm/fsl_pamu_stash.h
index caa1b21..38311c9 100644
--- a/arch/powerpc/include/asm/fsl_pamu_stash.h
+++ b/arch/powerpc/include/asm/fsl_pamu_stash.h
@@ -32,8 +32,8 @@ enum pamu_stash_target {
  */
 
 struct pamu_stash_attribute {
-	u32 	cpu;	/* cpu number */
-	u32 	cache;	/* cache to stash to: L1,L2,L3 */
+	u32	cpu;	/* cpu number */
+	u32	cache;	/* cache to stash to: L1,L2,L3 */
 };
 
 #endif  /* __FSL_PAMU_STASH_H */
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 05/26] iommu/fsl: Fix checkpatch type LINE_SPACING
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (3 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 04/26] iommu/fsl: Fix checkpatch type SPACE_BEFORE_TAB Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-6-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 06/26] iommu/fsl: Fix checkpatch type LEADING_SPACE Emil Medve
                     ` (22 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: 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 after declarations
+                       u32 win_cnt = dma_domain->win_cnt > 1 ?  dma_domain->win_cnt : 0;
+                       ret = pamu_set_liodn(liodn[i], dev, dma_domain,

CHECK:LINE_SPACING: Please don't use multiple blank lines
+
+

CHECK:LINE_SPACING: Please don't use multiple blank lines
+
+

Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 drivers/iommu/fsl_pamu.c        | 4 ----
 drivers/iommu/fsl_pamu_domain.c | 3 +--
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index d3a9fff..df6007c 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -56,7 +56,6 @@ static const struct of_device_id guts_device_ids[] __initconst = {
 	{}
 };
 
-
 /*
  * Table for matching compatible strings, for device tree
  * L3 cache controller node.
@@ -317,7 +316,6 @@ int pamu_disable_spaace(int liodn, u32 subwin)
 	return 0;
 }
 
-
 /**
  * pamu_config_paace() - Sets up PPAACE entry for specified liodn
  *
@@ -433,7 +431,6 @@ int pamu_config_spaace(int liodn, u32 subwin_cnt, u32 subwin,
 {
 	struct paace *paace;
 
-
 	/* setup sub-windows */
 	if (!subwin_cnt) {
 		pr_debug("Invalid subwindow count\n");
@@ -824,7 +821,6 @@ irqreturn_t pamu_av_isr(int irq, void *arg)
 		}
 	}
 
-
 	return IRQ_HANDLED;
 }
 
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index 7ea93ae..dc38db5 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -633,6 +633,7 @@ static int handle_attach_device(struct fsl_dma_domain *dma_domain,
 		 */
 		if (dma_domain->win_arr) {
 			u32 win_cnt = dma_domain->win_cnt > 1 ? dma_domain->win_cnt : 0;
+
 			ret = pamu_set_liodn(liodn[i], dev, dma_domain,
 					      &domain->geometry,
 					      win_cnt);
@@ -822,7 +823,6 @@ static int fsl_pamu_set_domain_attr(struct iommu_domain *domain,
 	struct fsl_dma_domain *dma_domain = domain->priv;
 	int ret = 0;
 
-
 	switch (attr_type) {
 	case DOMAIN_ATTR_GEOMETRY:
 		ret = configure_domain_geometry(domain, data);
@@ -848,7 +848,6 @@ static int fsl_pamu_get_domain_attr(struct iommu_domain *domain,
 	struct fsl_dma_domain *dma_domain = domain->priv;
 	int ret = 0;
 
-
 	switch (attr_type) {
 	case DOMAIN_ATTR_FSL_PAMU_STASH:
 		memcpy((struct pamu_stash_attribute *) data, &dma_domain->dma_stash,
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 06/26] iommu/fsl: Fix checkpatch type LEADING_SPACE
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (4 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 05/26] iommu/fsl: Fix checkpatch type LINE_SPACING Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-7-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 07/26] iommu/fsl: Fix checkpath type BRACES Emil Medve
                     ` (21 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: 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.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 drivers/iommu/fsl_pamu.c | 4 ++--
 drivers/iommu/fsl_pamu.h | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index df6007c..ccdc5e5 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -169,8 +169,8 @@ static unsigned int map_addrspace_size_to_wse(phys_addr_t addrspace_size)
 /* Derive the PAACE window count encoding for the subwindow count */
 static unsigned int map_subwindow_cnt_to_wce(u32 subwindow_cnt)
 {
-       /* window count is 2^(WCE+1) bytes */
-       return __ffs(subwindow_cnt) - 1;
+	/* window count is 2^(WCE+1) bytes */
+	return __ffs(subwindow_cnt) - 1;
 }
 
 /*
diff --git a/drivers/iommu/fsl_pamu.h b/drivers/iommu/fsl_pamu.h
index a7794b5..52a91af 100644
--- a/drivers/iommu/fsl_pamu.h
+++ b/drivers/iommu/fsl_pamu.h
@@ -200,8 +200,7 @@ struct pamu_mmap_regs {
 #define PAACE_ATM_NO_XLATE      0x00
 #define PAACE_ATM_WINDOW_XLATE  0x01
 #define PAACE_ATM_PAGE_XLATE    0x02
-#define PAACE_ATM_WIN_PG_XLATE  \
-                (PAACE_ATM_WINDOW_XLATE | PAACE_ATM_PAGE_XLATE)
+#define PAACE_ATM_WIN_PG_XLATE  (PAACE_ATM_WINDOW_XLATE | PAACE_ATM_PAGE_XLATE)
 #define PAACE_OTM_NO_XLATE      0x00
 #define PAACE_OTM_IMMEDIATE     0x01
 #define PAACE_OTM_INDEXED       0x02
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 07/26] iommu/fsl: Fix checkpath type BRACES
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (5 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 06/26] iommu/fsl: Fix checkpatch type LEADING_SPACE Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-8-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 08/26] iommu/fsl: Fix checkpatch type CODE_INDENT Emil Medve
                     ` (20 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: Emil Medve

WARNING:BRACES: braces {} are not necessary for single statement blocks
+               if (!paace) {
+                       return -ENOENT;
+               }

WARNING:BRACES: braces {} are not necessary for single statement blocks
+               if (!paace) {
+                       return -ENOENT;
+               }

WARNING:BRACES: braces {} are not necessary for single statement blocks
+       if (!ppaace) {
+               return -ENOENT;
+       }

CHECK:BRACES: Blank lines aren't necessary after an open brace '{'
+{
+

CHECK:BRACES: Blank lines aren't necessary before a close brace '}'
+
+}

CHECK:BRACES: Blank lines aren't necessary before a close brace '}'
+
+}

CHECK:BRACES: Blank lines aren't necessary before a close brace '}'
+
+}

CHECK:BRACES: Blank lines aren't necessary after an open brace '{'
+       for (i = 0; i < num; i++) {
+

CHECK:BRACES: braces {} should be used on all arms of this statement
+               if (pci_ctl->parent->iommu_group) {
[...]
+               } else
[...]

Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 drivers/iommu/fsl_pamu.c        | 9 +++------
 drivers/iommu/fsl_pamu_domain.c | 8 ++------
 2 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index ccdc5e5..6b28dd8 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -278,9 +278,8 @@ int  pamu_update_paace_stash(int liodn, u32 subwin, u32 value)
 	}
 	if (subwin) {
 		paace = pamu_get_spaace(paace, subwin - 1);
-		if (!paace) {
+		if (!paace)
 			return -ENOENT;
-		}
 	}
 	set_bf(paace->impl_attr, PAACE_IA_CID, value);
 
@@ -301,9 +300,8 @@ int pamu_disable_spaace(int liodn, u32 subwin)
 	}
 	if (subwin) {
 		paace = pamu_get_spaace(paace, subwin - 1);
-		if (!paace) {
+		if (!paace)
 			return -ENOENT;
-		}
 		set_bf(paace->addr_bitfields, PAACE_AF_V,
 			 PAACE_V_INVALID);
 	} else {
@@ -351,9 +349,8 @@ int pamu_config_ppaace(int liodn, phys_addr_t win_addr, phys_addr_t win_size,
 	}
 
 	ppaace = pamu_get_ppaace(liodn);
-	if (!ppaace) {
+	if (!ppaace)
 		return -ENOENT;
-	}
 
 	/* window size is 2^(WSE+1) bytes */
 	set_bf(ppaace->addr_bitfields, PPAACE_AF_WSE,
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index dc38db5..080ffa4 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -35,7 +35,6 @@ static DEFINE_SPINLOCK(device_domain_lock);
 
 static int __init iommu_init_mempool(void)
 {
-
 	fsl_pamu_domain_cache = kmem_cache_create("fsl_pamu_domain",
 					 sizeof(struct fsl_dma_domain),
 					 0,
@@ -153,7 +152,6 @@ static int map_liodn(int liodn, struct fsl_dma_domain *dma_domain)
 		return map_subwins(liodn, dma_domain);
 	else
 		return map_win(liodn, dma_domain);
-
 }
 
 /* Update window/subwindow mapping for the LIODN */
@@ -380,7 +378,6 @@ static void attach_device(struct fsl_dma_domain *dma_domain, int liodn, struct d
 	if (!dev->archdata.iommu_domain)
 		dev->archdata.iommu_domain = info;
 	spin_unlock_irqrestore(&device_domain_lock, flags);
-
 }
 
 static phys_addr_t fsl_pamu_iova_to_phys(struct iommu_domain *domain,
@@ -527,7 +524,6 @@ static void fsl_pamu_window_disable(struct iommu_domain *domain, u32 wnd_nr)
 	}
 
 	spin_unlock_irqrestore(&dma_domain->domain_lock, flags);
-
 }
 
 static int fsl_pamu_window_enable(struct iommu_domain *domain, u32 wnd_nr,
@@ -616,7 +612,6 @@ static int handle_attach_device(struct fsl_dma_domain *dma_domain,
 
 	spin_lock_irqsave(&dma_domain->domain_lock, flags);
 	for (i = 0; i < num; i++) {
-
 		/* Ensure that LIODN value is valid */
 		if (liodn[i] >= PAACE_NUMBER_ENTRIES) {
 			pr_debug("Invalid liodn %d, attach device failed for %s\n",
@@ -951,8 +946,9 @@ static struct iommu_group *get_pci_device_group(struct pci_dev *pdev)
 		if (pci_ctl->parent->iommu_group) {
 			group = get_device_iommu_group(pci_ctl->parent);
 			iommu_group_remove_device(pci_ctl->parent);
-		} else
+		} else {
 			group = get_shared_pci_device_group(pdev);
+		}
 	}
 
 	if (!group)
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 08/26] iommu/fsl: Fix checkpatch type CODE_INDENT
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (6 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 07/26] iommu/fsl: Fix checkpath type BRACES Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-9-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 09/26] iommu/fsl: Fix checkpatch type ALLOC_SIZEOF_STRUCT Emil Medve
                     ` (19 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: Emil Medve

ERROR:CODE_INDENT: code indent should use tabs where possible
+^I          stash_dest_hint, vcpu);$

ERROR:CODE_INDENT: code indent should use tabs where possible
+^I           phys_addr_t ppaact_phys, phys_addr_t spaact_phys,$

ERROR:CODE_INDENT: code indent should use tabs where possible
+^I^I          dev->of_node->full_name);$

ERROR:CODE_INDENT: code indent should use tabs where possible
+^I^I          dev->of_node->full_name);$

Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 drivers/iommu/fsl_pamu.c        | 6 +++---
 drivers/iommu/fsl_pamu_domain.c | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index 6b28dd8..7f0181c 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -583,7 +583,7 @@ found_cpu_node:
 	}
 
 	pr_debug("stash dest not found for %d on vcpu %d\n",
-	          stash_dest_hint, vcpu);
+		 stash_dest_hint, vcpu);
 	return ~(u32)0;
 }
 
@@ -675,8 +675,8 @@ static void __init get_pamu_cap_values(unsigned long pamu_reg_base)
 
 /* Setup PAMU registers pointing to PAACT, SPAACT and OMT */
 static int __init setup_one_pamu(unsigned long pamu_reg_base, unsigned long pamu_reg_size,
-	           phys_addr_t ppaact_phys, phys_addr_t spaact_phys,
-		   phys_addr_t omt_phys)
+				 phys_addr_t ppaact_phys, phys_addr_t spaact_phys,
+				 phys_addr_t omt_phys)
 {
 	u32 *pc;
 	struct pamu_mmap_regs *pamu_regs;
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index 080ffa4..d5137dd 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -682,7 +682,7 @@ static int fsl_pamu_attach_device(struct iommu_domain *domain,
 					 liodn, liodn_cnt);
 	} else {
 		pr_debug("missing fsl,liodn property at %s\n",
-		          dev->of_node->full_name);
+			 dev->of_node->full_name);
 			ret = -EINVAL;
 	}
 
@@ -718,7 +718,7 @@ static void fsl_pamu_detach_device(struct iommu_domain *domain,
 		detach_device(dev, dma_domain);
 	else
 		pr_debug("missing fsl,liodn property at %s\n",
-		          dev->of_node->full_name);
+			 dev->of_node->full_name);
 }
 
 static  int configure_domain_geometry(struct iommu_domain *domain, void *data)
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 09/26] iommu/fsl: Fix checkpatch type ALLOC_SIZEOF_STRUCT
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (7 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 08/26] iommu/fsl: Fix checkpatch type CODE_INDENT Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-10-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 10/26] iommu/fsl: Fix checkpatch type ALLOC_WITH_MULTIPLY Emil Medve
                     ` (18 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: 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)...)
+               dma_domain->win_arr = kzalloc(sizeof(struct dma_window)

Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 drivers/iommu/fsl_pamu.c        | 2 +-
 drivers/iommu/fsl_pamu_domain.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index 7f0181c..4f1926b 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -1039,7 +1039,7 @@ static int __init fsl_pamu_probe(struct platform_device *pdev)
 		goto error;
 	}
 
-	data = kzalloc(sizeof(struct pamu_isr_data), GFP_KERNEL);
+	data = kzalloc(sizeof(*data), GFP_KERNEL);
 	if (!data) {
 		dev_err(&pdev->dev, "PAMU isr data memory allocation failed\n");
 		ret = -ENOMEM;
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index d5137dd..9417207 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -1037,7 +1037,7 @@ static int fsl_pamu_set_windows(struct iommu_domain *domain, u32 w_count)
 				((w_count > 1) ? w_count : 0));
 	if (!ret) {
 		kfree(dma_domain->win_arr);
-		dma_domain->win_arr = kzalloc(sizeof(struct dma_window) *
+		dma_domain->win_arr = kzalloc(sizeof(*dma_domain->win_arr) *
 							  w_count, GFP_ATOMIC);
 		if (!dma_domain->win_arr) {
 			spin_unlock_irqrestore(&dma_domain->domain_lock, flags);
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 10/26] iommu/fsl: Fix checkpatch type ALLOC_WITH_MULTIPLY
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (8 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 09/26] iommu/fsl: Fix checkpatch type ALLOC_SIZEOF_STRUCT Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-11-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 11/26] iommu/fsl: Fix checkpatch type OOM_MESSAGE Emil Medve
                     ` (17 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: 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.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 drivers/iommu/fsl_pamu_domain.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index 9417207..dcb9bb4 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -1037,8 +1037,9 @@ static int fsl_pamu_set_windows(struct iommu_domain *domain, u32 w_count)
 				((w_count > 1) ? w_count : 0));
 	if (!ret) {
 		kfree(dma_domain->win_arr);
-		dma_domain->win_arr = kzalloc(sizeof(*dma_domain->win_arr) *
-							  w_count, GFP_ATOMIC);
+		dma_domain->win_arr = kcalloc(w_count,
+					      sizeof(*dma_domain->win_arr),
+					      GFP_ATOMIC);
 		if (!dma_domain->win_arr) {
 			spin_unlock_irqrestore(&dma_domain->domain_lock, flags);
 			return -ENOMEM;
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 11/26] iommu/fsl: Fix checkpatch type OOM_MESSAGE
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (9 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 10/26] iommu/fsl: Fix checkpatch type ALLOC_WITH_MULTIPLY Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-12-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 12/26] iommu/fsl: Fix checkpatch type TYPO_SPELLING Emil Medve
                     ` (16 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: Emil Medve

WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message
+       if (!data) {
+               dev_err(&pdev->dev, "PAMU isr data memory allocation failed\n");

Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 drivers/iommu/fsl_pamu.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index 4f1926b..6f9c976 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -1041,7 +1041,6 @@ static int __init fsl_pamu_probe(struct platform_device *pdev)
 
 	data = kzalloc(sizeof(*data), GFP_KERNEL);
 	if (!data) {
-		dev_err(&pdev->dev, "PAMU isr data memory allocation failed\n");
 		ret = -ENOMEM;
 		goto error;
 	}
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 12/26] iommu/fsl: Fix checkpatch type TYPO_SPELLING
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (10 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 11/26] iommu/fsl: Fix checkpatch type OOM_MESSAGE Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-13-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 13/26] iommu/fsl: Fix checkpatch type PREFER_PACKED Emil Medve
                     ` (15 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: 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.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 drivers/iommu/fsl_pamu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/fsl_pamu.h b/drivers/iommu/fsl_pamu.h
index 52a91af..86abc70 100644
--- a/drivers/iommu/fsl_pamu.h
+++ b/drivers/iommu/fsl_pamu.h
@@ -220,7 +220,7 @@ struct pamu_mmap_regs {
 #define PAACE_TCEF_FORMAT0_8B   0x00
 #define PAACE_TCEF_FORMAT1_RSVD 0x01
 /*
- * Hard coded value for the PAACT size to accomodate
+ * Hard coded value for the PAACT size to accommodate
  * maximum LIODN value generated by u-boot.
  */
 #define PAACE_NUMBER_ENTRIES    0x500
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 13/26] iommu/fsl: Fix checkpatch type PREFER_PACKED
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (11 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 12/26] iommu/fsl: Fix checkpatch type TYPO_SPELLING Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-14-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 14/26] iommu/fsl: Fix checkpatch type QUOTED_WHITESPACE_BEFORE_NEWLINE Emil Medve
                     ` (14 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: Emil Medve

WARNING:PREFER_PACKED: __packed is preferred over __attribute__((packed))
+} __attribute__((packed));

Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 drivers/iommu/fsl_pamu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/fsl_pamu.h b/drivers/iommu/fsl_pamu.h
index 86abc70..04dcd25 100644
--- a/drivers/iommu/fsl_pamu.h
+++ b/drivers/iommu/fsl_pamu.h
@@ -333,7 +333,7 @@ struct paace {
 #define NUM_MOE 128
 struct ome {
 	u8 moe[NUM_MOE];
-} __attribute__((packed));
+} __packed;
 
 #define PAACT_SIZE              (sizeof(struct paace) * PAACE_NUMBER_ENTRIES)
 #define SPAACT_SIZE              (sizeof(struct paace) * SPAACE_NUMBER_ENTRIES)
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 14/26] iommu/fsl: Fix checkpatch type QUOTED_WHITESPACE_BEFORE_NEWLINE
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (12 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 13/26] iommu/fsl: Fix checkpatch type PREFER_PACKED Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-15-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 15/26] iommu/fsl: Fix checkpatch type SPACING Emil Medve
                     ` (13 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: Emil Medve

WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
+               pr_debug("Invalid window size \n");

Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 drivers/iommu/fsl_pamu_domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index dcb9bb4..c9886ff 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -556,7 +556,7 @@ static int fsl_pamu_window_enable(struct iommu_domain *domain, u32 wnd_nr,
 
 	win_size = dma_domain->geom_size >> ilog2(dma_domain->win_cnt);
 	if (size > win_size) {
-		pr_debug("Invalid window size \n");
+		pr_debug("Invalid window size\n");
 		spin_unlock_irqrestore(&dma_domain->domain_lock, flags);
 		return -EINVAL;
 	}
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 15/26] iommu/fsl: Fix checkpatch type SPACING
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (13 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 14/26] iommu/fsl: Fix checkpatch type QUOTED_WHITESPACE_BEFORE_NEWLINE Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-16-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 16/26] iommu/fsl: Use a device pointer to make lines shorter Emil Medve
                     ` (12 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: Emil Medve

CHECK:SPACING: No space is necessary after a cast
+               pamu_reg_base = (unsigned long) pamu_regs + pamu_reg_off;

CHECK:SPACING: No space is necessary after a cast
+               memcpy((struct pamu_stash_attribute *) data, &dma_domain->dma_stash,

Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 drivers/iommu/fsl_pamu.c        | 2 +-
 drivers/iommu/fsl_pamu_domain.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index 6f9c976..18a604a 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -1151,7 +1151,7 @@ static int __init fsl_pamu_probe(struct platform_device *pdev)
 	for (pamu_reg_off = 0, pamu_counter = 0x80000000; pamu_reg_off < size;
 	     pamu_reg_off += PAMU_OFFSET, pamu_counter >>= 1) {
 
-		pamu_reg_base = (unsigned long) pamu_regs + pamu_reg_off;
+		pamu_reg_base = (unsigned long)pamu_regs + pamu_reg_off;
 		setup_one_pamu(pamu_reg_base, pamu_reg_off, ppaact_phys,
 				 spaact_phys, omt_phys);
 		/* Disable PAMU bypass for this PAMU */
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index c9886ff..c7af760 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -845,8 +845,8 @@ static int fsl_pamu_get_domain_attr(struct iommu_domain *domain,
 
 	switch (attr_type) {
 	case DOMAIN_ATTR_FSL_PAMU_STASH:
-		memcpy((struct pamu_stash_attribute *) data, &dma_domain->dma_stash,
-				 sizeof(struct pamu_stash_attribute));
+		memcpy(data, &dma_domain->dma_stash,
+		       sizeof(struct pamu_stash_attribute));
 		break;
 	case DOMAIN_ATTR_FSL_PAMU_ENABLE:
 		*(int *)data = dma_domain->enabled;
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 16/26] iommu/fsl: Use a device pointer to make lines shorter
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (14 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 15/26] iommu/fsl: Fix checkpatch type SPACING Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-17-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 17/26] iommu/fsl: Remove pr/dev_*() prefixes Emil Medve
                     ` (11 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: Emil Medve

Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 drivers/iommu/fsl_pamu.c | 39 ++++++++++++++++++---------------------
 1 file changed, 18 insertions(+), 21 deletions(-)

diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index 18a604a..22b72e2 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -1002,6 +1002,7 @@ static const struct {
 
 static int __init fsl_pamu_probe(struct platform_device *pdev)
 {
+	struct device *dev = &pdev->dev;
 	void __iomem *pamu_regs = NULL;
 	struct ccsr_guts __iomem *guts_regs = NULL;
 	u32 pamubypenr, pamu_counter;
@@ -1026,16 +1027,16 @@ static int __init fsl_pamu_probe(struct platform_device *pdev)
 	 * NOTE : All PAMUs share the same LIODN tables.
 	 */
 
-	pamu_regs = of_iomap(pdev->dev.of_node, 0);
+	pamu_regs = of_iomap(dev->of_node, 0);
 	if (!pamu_regs) {
-		dev_err(&pdev->dev, "ioremap of PAMU node failed\n");
+		dev_err(dev, "ioremap of PAMU node failed\n");
 		return -ENOMEM;
 	}
-	of_get_address(pdev->dev.of_node, 0, &size, NULL);
+	of_get_address(dev->of_node, 0, &size, NULL);
 
-	irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
+	irq = irq_of_parse_and_map(dev->of_node, 0);
 	if (irq == NO_IRQ) {
-		dev_warn(&pdev->dev, "no interrupts listed in PAMU node\n");
+		dev_warn(dev, "no interrupts listed in PAMU node\n");
 		goto error;
 	}
 
@@ -1050,15 +1051,14 @@ static int __init fsl_pamu_probe(struct platform_device *pdev)
 	/* The ISR needs access to the regs, so we won't iounmap them */
 	ret = request_irq(irq, pamu_av_isr, 0, "pamu", data);
 	if (ret < 0) {
-		dev_err(&pdev->dev, "error %i installing ISR for irq %i\n",
-			ret, irq);
+		dev_err(dev, "error %i installing ISR for irq %i\n", ret, irq);
 		goto error;
 	}
 
 	guts_node = of_find_matching_node(NULL, guts_device_ids);
 	if (!guts_node) {
-		dev_err(&pdev->dev, "could not find GUTS node %s\n",
-			pdev->dev.of_node->full_name);
+		dev_err(dev, "could not find GUTS node %s\n",
+			dev->of_node->full_name);
 		ret = -ENODEV;
 		goto error;
 	}
@@ -1066,7 +1066,7 @@ static int __init fsl_pamu_probe(struct platform_device *pdev)
 	guts_regs = of_iomap(guts_node, 0);
 	of_node_put(guts_node);
 	if (!guts_regs) {
-		dev_err(&pdev->dev, "ioremap of GUTS node failed\n");
+		dev_err(dev, "ioremap of GUTS node failed\n");
 		ret = -ENODEV;
 		goto error;
 	}
@@ -1086,7 +1086,7 @@ static int __init fsl_pamu_probe(struct platform_device *pdev)
 
 	p = alloc_pages(GFP_KERNEL | __GFP_ZERO, order);
 	if (!p) {
-		dev_err(&pdev->dev, "unable to allocate PAACT/SPAACT/OMT block\n");
+		dev_err(dev, "unable to allocate PAACT/SPAACT/OMT block\n");
 		ret = -ENOMEM;
 		goto error;
 	}
@@ -1096,7 +1096,7 @@ static int __init fsl_pamu_probe(struct platform_device *pdev)
 
 	/* Make sure the memory is naturally aligned */
 	if (ppaact_phys & ((PAGE_SIZE << order) - 1)) {
-		dev_err(&pdev->dev, "PAACT/OMT block is unaligned\n");
+		dev_err(dev, "PAACT/OMT block is unaligned\n");
 		ret = -ENOMEM;
 		goto error;
 	}
@@ -1104,8 +1104,7 @@ static int __init fsl_pamu_probe(struct platform_device *pdev)
 	spaact = (void *)ppaact + (PAGE_SIZE << get_order(PAACT_SIZE));
 	omt = (void *)spaact + (PAGE_SIZE << get_order(SPAACT_SIZE));
 
-	dev_dbg(&pdev->dev, "ppaact virt=%p phys=0x%pa\n", ppaact,
-		&ppaact_phys);
+	dev_dbg(dev, "ppaact virt=%p phys=0x%pa\n", ppaact, &ppaact_phys);
 
 	/* Check to see if we need to implement the work-around on this SOC */
 
@@ -1113,21 +1112,19 @@ static int __init fsl_pamu_probe(struct platform_device *pdev)
 	for (i = 0; i < ARRAY_SIZE(port_id_map); i++) {
 		if (port_id_map[i].svr == (mfspr(SPRN_SVR) & ~SVR_SECURITY)) {
 			csd_port_id = port_id_map[i].port_id;
-			dev_dbg(&pdev->dev, "found matching SVR %08x\n",
+			dev_dbg(dev, "found matching SVR %08x\n",
 				port_id_map[i].svr);
 			break;
 		}
 	}
 
 	if (csd_port_id) {
-		dev_dbg(&pdev->dev, "creating coherency subdomain at address "
-			"%pa, size %zu, port id 0x%08x", &ppaact_phys,
-			mem_size, csd_port_id);
+		dev_dbg(dev, "creating coherency subdomain at address %pa, size %zu, port id 0x%08x",
+			&ppaact_phys, mem_size, csd_port_id);
 
 		ret = create_csd(ppaact_phys, mem_size, csd_port_id);
 		if (ret) {
-			dev_err(&pdev->dev, "could not create coherence "
-				"subdomain\n");
+			dev_err(dev, "could not create coherence subdomain\n");
 			return ret;
 		}
 	}
@@ -1138,7 +1135,7 @@ static int __init fsl_pamu_probe(struct platform_device *pdev)
 	spaace_pool = gen_pool_create(ilog2(sizeof(struct paace)), -1);
 	if (!spaace_pool) {
 		ret = -ENOMEM;
-		dev_err(&pdev->dev, "PAMU : failed to allocate spaace gen pool\n");
+		dev_err(dev, "PAMU : failed to allocate spaace gen pool\n");
 		goto error;
 	}
 
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 17/26] iommu/fsl: Remove pr/dev_*() prefixes
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (15 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 16/26] iommu/fsl: Use a device pointer to make lines shorter Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-18-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 18/26] iommu/fsl: Fix checkpatch type PARENTHESIS_ALIGNMENT Emil Medve
                     ` (10 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: Emil Medve

pr_fmt() and dev_*() already take care of it

Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 drivers/iommu/fsl_pamu.c        |  2 +-
 drivers/iommu/fsl_pamu_domain.c | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index 22b72e2..e46c75f 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -1135,7 +1135,7 @@ static int __init fsl_pamu_probe(struct platform_device *pdev)
 	spaace_pool = gen_pool_create(ilog2(sizeof(struct paace)), -1);
 	if (!spaace_pool) {
 		ret = -ENOMEM;
-		dev_err(dev, "PAMU : failed to allocate spaace gen pool\n");
+		dev_err(dev, "Failed to allocate spaace gen pool\n");
 		goto error;
 	}
 
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index c7af760..3e7954a 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -113,7 +113,7 @@ static int map_subwins(int liodn, struct fsl_dma_domain *dma_domain)
 						 sub_win_ptr[i].prot);
 			spin_unlock_irqrestore(&iommu_lock, flags);
 			if (ret) {
-				pr_debug("PAMU SPAACE configuration failed for liodn %d\n",
+				pr_debug("SPAACE configuration failed for liodn %d\n",
 					 liodn);
 				return ret;
 			}
@@ -139,7 +139,7 @@ static int map_win(int liodn, struct fsl_dma_domain *dma_domain)
 				 0, wnd->prot);
 	spin_unlock_irqrestore(&iommu_lock, flags);
 	if (ret)
-		pr_debug("PAMU PAACE configuration failed for liodn %d\n",
+		pr_debug("PAACE configuration failed for liodn %d\n",
 			liodn);
 
 	return ret;
@@ -250,7 +250,7 @@ static int pamu_set_liodn(int liodn, struct device *dev,
 					 dma_domain->stash_id, win_cnt, 0);
 	spin_unlock_irqrestore(&iommu_lock, flags);
 	if (ret) {
-		pr_debug("PAMU PAACE configuration failed for liodn %d, win_cnt =%d\n", liodn, win_cnt);
+		pr_debug("PAACE configuration failed for liodn %d, win_cnt =%d\n", liodn, win_cnt);
 		return ret;
 	}
 
@@ -267,7 +267,7 @@ static int pamu_set_liodn(int liodn, struct device *dev,
 							 0, 0);
 			spin_unlock_irqrestore(&iommu_lock, flags);
 			if (ret) {
-				pr_debug("PAMU SPAACE configuration failed for liodn %d\n", liodn);
+				pr_debug("SPAACE configuration failed for liodn %d\n", liodn);
 				return ret;
 			}
 		}
@@ -283,13 +283,13 @@ static int check_size(u64 size, dma_addr_t iova)
 	 * to PAMU page size.
 	 */
 	if ((size & (size - 1)) || size < PAMU_PAGE_SIZE) {
-		pr_debug("%s: size too small or not a power of two\n", __func__);
+		pr_debug("Size too small or not a power of two\n");
 		return -EINVAL;
 	}
 
 	/* iova must be page size aligned*/
 	if (iova & (size - 1)) {
-		pr_debug("%s: address is not aligned with window size\n", __func__);
+		pr_debug("Address is not aligned with window size\n");
 		return -EINVAL;
 	}
 
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 18/26] iommu/fsl: Fix checkpatch type PARENTHESIS_ALIGNMENT
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (16 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 17/26] iommu/fsl: Remove pr/dev_*() prefixes Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-19-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 19/26] iommu/fsl: Fix some comments alignment Emil Medve
                     ` (9 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: 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,
+                        PAACE_AP_PERMS_DENIED);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+       set_bf(ppaace->addr_bitfields, PPAACE_AF_WSE,
+               map_addrspace_size_to_wse(win_size));

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+                       pr_debug("can't find next-level-cache at %s\n",
+                               node->full_name);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+       out_be32((u32 *)(pamu_reg_base + PAMU_PICS),
+                       PAMU_ACCESS_VIOLATION_ENABLE);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+                       set_bf(ppaace->impl_attr, PAACE_IA_ATM,
+                               PAACE_ATM_NO_XLATE);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+                       set_bf(ppaace->addr_bitfields, PAACE_AF_AP,
+                               PAACE_AP_PERMS_ALL);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+                       pr_emerg("AVA=%016llx\n", make64(in_be32(p + PAMU_AVAH),
+                               in_be32(p + PAMU_AVAL)));

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+                       pr_emerg("POEA=%016llx\n", make64(in_be32(p + PAMU_POEAH),
+                               in_be32(p + PAMU_POEAL)));

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+                       phys = make64(in_be32(p + PAMU_POEAH),
+                               in_be32(p + PAMU_POEAL));

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+               setup_one_pamu(pamu_reg_base, pamu_reg_off, ppaact_phys,
+                                spaact_phys, omt_phys);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+       fsl_pamu_domain_cache = kmem_cache_create("fsl_pamu_domain",
+                                        sizeof(struct fsl_dma_domain),

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+       iommu_devinfo_cache = kmem_cache_create("iommu_devinfo",
+                                        sizeof(struct device_domain_info),

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+               pr_debug("PAACE configuration failed for liodn %d\n",
+                       liodn);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+static int update_liodn_stash(int liodn, struct fsl_dma_domain *dma_domain,
+                                u32 val)

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+static int pamu_set_liodn(int liodn, struct device *dev,
+                          struct fsl_dma_domain *dma_domain,

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+static phys_addr_t fsl_pamu_iova_to_phys(struct iommu_domain *domain,
+                                           dma_addr_t iova)

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+       if ((iova < domain->geometry.aperture_start) ||
+               iova > (domain->geometry.aperture_end))

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+               ret = pamu_set_liodn(info->liodn, info->dev, dma_domain,
+                                     geom_attr, win_cnt);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+static int handle_attach_device(struct fsl_dma_domain *dma_domain,
+                                struct device *dev, const u32 *liodn,

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+                       pr_debug("Invalid liodn %d, attach device failed for %s\n",
+                               liodn[i], dev->of_node->full_name);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+                       ret = pamu_set_liodn(liodn[i], dev, dma_domain,
+                                             &domain->geometry,

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+               ret = handle_attach_device(dma_domain, dev,
+                                        liodn, liodn_cnt);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+static void fsl_pamu_detach_device(struct iommu_domain *domain,
+                                     struct device *dev)

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+       if (check_size(geom_size, geom_attr->aperture_start) ||
+               !geom_attr->force_aperture) {

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+       memcpy(&dma_domain->dma_stash, stash_attr,
+                sizeof(struct pamu_stash_attribute));

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+       list_for_each_entry(info, &dma_domain->devices,
+                                link) {

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+static int fsl_pamu_set_domain_attr(struct iommu_domain *domain,
+                                enum iommu_attr attr_type, void *data)

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+static int fsl_pamu_get_domain_attr(struct iommu_domain *domain,
+                                enum iommu_attr attr_type, void *data)

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+       ret = pamu_set_domain_geometry(dma_domain, &domain->geometry,
+                               ((w_count > 1) ? w_count : 0));

Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 drivers/iommu/fsl_pamu.c        | 29 +++++++++---------
 drivers/iommu/fsl_pamu_domain.c | 67 +++++++++++++++++++----------------------
 2 files changed, 46 insertions(+), 50 deletions(-)

diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index e46c75f..dc3955f 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -302,11 +302,10 @@ int pamu_disable_spaace(int liodn, u32 subwin)
 		paace = pamu_get_spaace(paace, subwin - 1);
 		if (!paace)
 			return -ENOENT;
-		set_bf(paace->addr_bitfields, PAACE_AF_V,
-			 PAACE_V_INVALID);
+		set_bf(paace->addr_bitfields, PAACE_AF_V, PAACE_V_INVALID);
 	} else {
 		set_bf(paace->addr_bitfields, PAACE_AF_AP,
-			 PAACE_AP_PERMS_DENIED);
+		       PAACE_AP_PERMS_DENIED);
 	}
 
 	mb();
@@ -354,7 +353,7 @@ int pamu_config_ppaace(int liodn, phys_addr_t win_addr, phys_addr_t win_size,
 
 	/* window size is 2^(WSE+1) bytes */
 	set_bf(ppaace->addr_bitfields, PPAACE_AF_WSE,
-		map_addrspace_size_to_wse(win_size));
+	       map_addrspace_size_to_wse(win_size));
 
 	pamu_init_ppaace(ppaace);
 
@@ -568,7 +567,7 @@ found_cpu_node:
 		prop = of_get_property(node, "next-level-cache", 0);
 		if (!prop) {
 			pr_debug("can't find next-level-cache at %s\n",
-				node->full_name);
+				 node->full_name);
 			of_node_put(node);
 			return ~(u32)0;  /* can't traverse any further */
 		}
@@ -712,7 +711,7 @@ static int __init setup_one_pamu(unsigned long pamu_reg_base, unsigned long pamu
 	 */
 
 	out_be32((u32 *)(pamu_reg_base + PAMU_PICS),
-			PAMU_ACCESS_VIOLATION_ENABLE);
+		 PAMU_ACCESS_VIOLATION_ENABLE);
 	out_be32(pc, PAMU_PC_PE | PAMU_PC_OCE | PAMU_PC_SPCC | PAMU_PC_PPCC);
 	return 0;
 }
@@ -742,9 +741,9 @@ static void __init setup_liodns(void)
 			ppaace->wbah = 0;
 			set_bf(ppaace->addr_bitfields, PPAACE_AF_WBAL, 0);
 			set_bf(ppaace->impl_attr, PAACE_IA_ATM,
-				PAACE_ATM_NO_XLATE);
+			       PAACE_ATM_NO_XLATE);
 			set_bf(ppaace->addr_bitfields, PAACE_AF_AP,
-				PAACE_AP_PERMS_ALL);
+			       PAACE_AP_PERMS_ALL);
 			if (of_device_is_compatible(node, "fsl,qman-portal"))
 				setup_qbman_paace(ppaace, QMAN_PORTAL_PAACE);
 			if (of_device_is_compatible(node, "fsl,qman"))
@@ -777,14 +776,16 @@ irqreturn_t pamu_av_isr(int irq, void *arg)
 			pr_emerg("POES2=%08x\n", in_be32(p + PAMU_POES2));
 			pr_emerg("AVS1=%08x\n", avs1);
 			pr_emerg("AVS2=%08x\n", in_be32(p + PAMU_AVS2));
-			pr_emerg("AVA=%016llx\n", make64(in_be32(p + PAMU_AVAH),
-				in_be32(p + PAMU_AVAL)));
+			pr_emerg("AVA=%016llx\n",
+				 make64(in_be32(p + PAMU_AVAH),
+					in_be32(p + PAMU_AVAL)));
 			pr_emerg("UDAD=%08x\n", in_be32(p + PAMU_UDAD));
-			pr_emerg("POEA=%016llx\n", make64(in_be32(p + PAMU_POEAH),
-				in_be32(p + PAMU_POEAL)));
+			pr_emerg("POEA=%016llx\n",
+				 make64(in_be32(p + PAMU_POEAH),
+					in_be32(p + PAMU_POEAL)));
 
 			phys = make64(in_be32(p + PAMU_POEAH),
-				in_be32(p + PAMU_POEAL));
+				      in_be32(p + PAMU_POEAL));
 
 			/* Assume that POEA points to a PAACE */
 			if (phys) {
@@ -1150,7 +1151,7 @@ static int __init fsl_pamu_probe(struct platform_device *pdev)
 
 		pamu_reg_base = (unsigned long)pamu_regs + pamu_reg_off;
 		setup_one_pamu(pamu_reg_base, pamu_reg_off, ppaact_phys,
-				 spaact_phys, omt_phys);
+			       spaact_phys, omt_phys);
 		/* Disable PAMU bypass for this PAMU */
 		pamubypenr &= ~pamu_counter;
 	}
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index 3e7954a..51a6750 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -36,21 +36,20 @@ static DEFINE_SPINLOCK(device_domain_lock);
 static int __init iommu_init_mempool(void)
 {
 	fsl_pamu_domain_cache = kmem_cache_create("fsl_pamu_domain",
-					 sizeof(struct fsl_dma_domain),
-					 0,
-					 SLAB_HWCACHE_ALIGN,
-
-					 NULL);
+						  sizeof(struct fsl_dma_domain),
+						  0,
+						  SLAB_HWCACHE_ALIGN,
+						  NULL);
 	if (!fsl_pamu_domain_cache) {
 		pr_debug("Couldn't create fsl iommu_domain cache\n");
 		return -ENOMEM;
 	}
 
 	iommu_devinfo_cache = kmem_cache_create("iommu_devinfo",
-					 sizeof(struct device_domain_info),
-					 0,
-					 SLAB_HWCACHE_ALIGN,
-					 NULL);
+						sizeof(struct device_domain_info),
+						0,
+						SLAB_HWCACHE_ALIGN,
+						NULL);
 	if (!iommu_devinfo_cache) {
 		pr_debug("Couldn't create devinfo cache\n");
 		kmem_cache_destroy(fsl_pamu_domain_cache);
@@ -139,8 +138,7 @@ static int map_win(int liodn, struct fsl_dma_domain *dma_domain)
 				 0, wnd->prot);
 	spin_unlock_irqrestore(&iommu_lock, flags);
 	if (ret)
-		pr_debug("PAACE configuration failed for liodn %d\n",
-			liodn);
+		pr_debug("PAACE configuration failed for liodn %d\n", liodn);
 
 	return ret;
 }
@@ -194,7 +192,7 @@ static int update_liodn(int liodn, struct fsl_dma_domain *dma_domain, u32 wnd_nr
 }
 
 static int update_liodn_stash(int liodn, struct fsl_dma_domain *dma_domain,
-				 u32 val)
+			      u32 val)
 {
 	int ret = 0, i;
 	unsigned long flags;
@@ -222,9 +220,9 @@ static int update_liodn_stash(int liodn, struct fsl_dma_domain *dma_domain,
 
 /* Set the geometry parameters for a LIODN */
 static int pamu_set_liodn(int liodn, struct device *dev,
-			   struct fsl_dma_domain *dma_domain,
-			   struct iommu_domain_geometry *geom_attr,
-			   u32 win_cnt)
+			  struct fsl_dma_domain *dma_domain,
+			  struct iommu_domain_geometry *geom_attr,
+			  u32 win_cnt)
 {
 	phys_addr_t window_addr, window_size;
 	phys_addr_t subwin_size;
@@ -381,12 +379,12 @@ static void attach_device(struct fsl_dma_domain *dma_domain, int liodn, struct d
 }
 
 static phys_addr_t fsl_pamu_iova_to_phys(struct iommu_domain *domain,
-					    dma_addr_t iova)
+					 dma_addr_t iova)
 {
 	struct fsl_dma_domain *dma_domain = domain->priv;
 
 	if ((iova < domain->geometry.aperture_start) ||
-		iova > (domain->geometry.aperture_end))
+	    iova > (domain->geometry.aperture_end))
 		return 0;
 
 	return get_phys_addr(dma_domain, iova);
@@ -441,7 +439,7 @@ static int pamu_set_domain_geometry(struct fsl_dma_domain *dma_domain,
 
 	list_for_each_entry(info, &dma_domain->devices, link) {
 		ret = pamu_set_liodn(info->liodn, info->dev, dma_domain,
-				      geom_attr, win_cnt);
+				     geom_attr, win_cnt);
 		if (ret)
 			break;
 	}
@@ -602,8 +600,8 @@ static int fsl_pamu_window_enable(struct iommu_domain *domain, u32 wnd_nr,
  * and window mappings.
  */
 static int handle_attach_device(struct fsl_dma_domain *dma_domain,
-				 struct device *dev, const u32 *liodn,
-				 int num)
+				struct device *dev, const u32 *liodn,
+				int num)
 {
 	unsigned long flags;
 	struct iommu_domain *domain = dma_domain->iommu_domain;
@@ -615,7 +613,7 @@ static int handle_attach_device(struct fsl_dma_domain *dma_domain,
 		/* Ensure that LIODN value is valid */
 		if (liodn[i] >= PAACE_NUMBER_ENTRIES) {
 			pr_debug("Invalid liodn %d, attach device failed for %s\n",
-				liodn[i], dev->of_node->full_name);
+				 liodn[i], dev->of_node->full_name);
 			ret = -EINVAL;
 			break;
 		}
@@ -630,8 +628,7 @@ static int handle_attach_device(struct fsl_dma_domain *dma_domain,
 			u32 win_cnt = dma_domain->win_cnt > 1 ? dma_domain->win_cnt : 0;
 
 			ret = pamu_set_liodn(liodn[i], dev, dma_domain,
-					      &domain->geometry,
-					      win_cnt);
+					     &domain->geometry, win_cnt);
 			if (ret)
 				break;
 			if (dma_domain->mapped) {
@@ -678,8 +675,7 @@ static int fsl_pamu_attach_device(struct iommu_domain *domain,
 	liodn = of_get_property(dev->of_node, "fsl,liodn", &len);
 	if (liodn) {
 		liodn_cnt = len / sizeof(u32);
-		ret = handle_attach_device(dma_domain, dev,
-					 liodn, liodn_cnt);
+		ret = handle_attach_device(dma_domain, dev, liodn, liodn_cnt);
 	} else {
 		pr_debug("missing fsl,liodn property at %s\n",
 			 dev->of_node->full_name);
@@ -690,7 +686,7 @@ static int fsl_pamu_attach_device(struct iommu_domain *domain,
 }
 
 static void fsl_pamu_detach_device(struct iommu_domain *domain,
-				      struct device *dev)
+				   struct device *dev)
 {
 	struct fsl_dma_domain *dma_domain = domain->priv;
 	const u32 *prop;
@@ -734,10 +730,10 @@ static  int configure_domain_geometry(struct iommu_domain *domain, void *data)
 	 * DMA outside of the geometry.
 	 */
 	if (check_size(geom_size, geom_attr->aperture_start) ||
-		!geom_attr->force_aperture) {
-			pr_debug("Invalid PAMU geometry attributes\n");
-			return -EINVAL;
-		}
+	    !geom_attr->force_aperture) {
+		pr_debug("Invalid PAMU geometry attributes\n");
+		return -EINVAL;
+	}
 
 	spin_lock_irqsave(&dma_domain->domain_lock, flags);
 	if (dma_domain->enabled) {
@@ -766,7 +762,7 @@ static int configure_domain_stash(struct fsl_dma_domain *dma_domain, void *data)
 	spin_lock_irqsave(&dma_domain->domain_lock, flags);
 
 	memcpy(&dma_domain->dma_stash, stash_attr,
-		 sizeof(struct pamu_stash_attribute));
+	       sizeof(struct pamu_stash_attribute));
 
 	dma_domain->stash_id = get_stash_id(stash_attr->cache,
 					    stash_attr->cpu);
@@ -799,8 +795,7 @@ static int configure_domain_dma_state(struct fsl_dma_domain *dma_domain, bool en
 	}
 
 	dma_domain->enabled = enable;
-	list_for_each_entry(info, &dma_domain->devices,
-				 link) {
+	list_for_each_entry(info, &dma_domain->devices, link) {
 		ret = (enable) ? pamu_enable_liodn(info->liodn) :
 			pamu_disable_liodn(info->liodn);
 		if (ret)
@@ -813,7 +808,7 @@ static int configure_domain_dma_state(struct fsl_dma_domain *dma_domain, bool en
 }
 
 static int fsl_pamu_set_domain_attr(struct iommu_domain *domain,
-				 enum iommu_attr attr_type, void *data)
+				    enum iommu_attr attr_type, void *data)
 {
 	struct fsl_dma_domain *dma_domain = domain->priv;
 	int ret = 0;
@@ -838,7 +833,7 @@ static int fsl_pamu_set_domain_attr(struct iommu_domain *domain,
 }
 
 static int fsl_pamu_get_domain_attr(struct iommu_domain *domain,
-				 enum iommu_attr attr_type, void *data)
+				    enum iommu_attr attr_type, void *data)
 {
 	struct fsl_dma_domain *dma_domain = domain->priv;
 	int ret = 0;
@@ -1034,7 +1029,7 @@ static int fsl_pamu_set_windows(struct iommu_domain *domain, u32 w_count)
 	}
 
 	ret = pamu_set_domain_geometry(dma_domain, &domain->geometry,
-				((w_count > 1) ? w_count : 0));
+				       ((w_count > 1) ? w_count : 0));
 	if (!ret) {
 		kfree(dma_domain->win_arr);
 		dma_domain->win_arr = kcalloc(w_count,
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 19/26] iommu/fsl: Fix some comments alignment
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (17 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 18/26] iommu/fsl: Fix checkpatch type PARENTHESIS_ALIGNMENT Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-20-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 20/26] iommu/fsl: Fix alignment of some stray lines Emil Medve
                     ` (8 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: Emil Medve

Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 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 dc3955f..ba5d1e0 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -35,7 +35,7 @@
 #define make64(high, low) (((u64)(high) << 32) | (low))
 
 struct pamu_isr_data {
-	void __iomem *pamu_reg_base;	/* Base address of PAMU regs*/
+	void __iomem *pamu_reg_base;	/* Base address of PAMU regs */
 	unsigned int count;		/* The number of PAMUs */
 };
 
@@ -49,7 +49,7 @@ static struct ome *omt __initdata;
  * "fsl,qoriq-device-config-2.0" corresponds to T4 & B4
  * SOCs. For the older SOCs "fsl,qoriq-device-config-1.0"
  * string would be used.
-*/
+ */
 static const struct of_device_id guts_device_ids[] __initconst = {
 	{ .compatible = "fsl,qoriq-device-config-1.0", },
 	{ .compatible = "fsl,qoriq-device-config-2.0", },
@@ -63,7 +63,7 @@ static const struct of_device_id guts_device_ids[] __initconst = {
  * "fsl,b4860-l3-cache-controller" corresponds to B4 &
  * "fsl,p4080-l3-cache-controller" corresponds to other,
  * SOCs.
-*/
+ */
 static const struct of_device_id l3_device_ids[] = {
 	{ .compatible = "fsl,t4240-l3-cache-controller", },
 	{ .compatible = "fsl,b4860-l3-cache-controller", },
@@ -231,7 +231,7 @@ static struct paace *pamu_get_spaace(struct paace *paace, u32 wnum)
  * If no SPAACE entry is available or the allocator can not reserve the required
  * number of contiguous entries function returns ULONG_MAX indicating a failure.
  *
-*/
+ */
 static unsigned long pamu_get_fspi_and_allocate(u32 subwin_cnt)
 {
 	unsigned long spaace_addr;
@@ -494,11 +494,11 @@ int pamu_config_spaace(int liodn, u32 subwin_cnt, u32 subwin,
 }
 
 /**
-* get_ome_index() - Returns the index in the operation mapping table
-*                   for device.
-* @*omi_index: pointer for storing the index value
-*
-*/
+ * get_ome_index() - Returns the index in the operation mapping table
+ *                   for device.
+ * @*omi_index: pointer for storing the index value
+ *
+ */
 void get_ome_index(u32 *omi_index, struct device *dev)
 {
 	if (of_device_is_compatible(dev->of_node, "fsl,qman-portal"))
@@ -610,7 +610,7 @@ static void __init setup_qbman_paace(struct paace *ppaace, int  paace_type)
 	case QMAN_PORTAL_PAACE:
 		set_bf(ppaace->impl_attr, PAACE_IA_OTM, PAACE_OTM_INDEXED);
 		ppaace->op_encode.index_ot.omi = OMI_QMAN;
-		/*Set DQRR and Frame stashing for the L3 cache */
+		/* Set DQRR and Frame stashing for the L3 cache */
 		set_bf(ppaace->impl_attr, PAACE_IA_CID, get_stash_id(PAMU_ATTR_CACHE_L3, 0));
 		break;
 	case BMAN_PAACE:
@@ -937,7 +937,7 @@ static int __init create_csd(phys_addr_t phys, size_t size, u32 csd_port_id)
 	}
 
 	if (i == 0 || i == num_laws) {
-		/* This should never happen*/
+		/* This should never happen */
 		ret = -ENOENT;
 		goto error;
 	}
@@ -1163,7 +1163,7 @@ static int __init fsl_pamu_probe(struct platform_device *pdev)
 
 	iounmap(guts_regs);
 
-	/* Enable DMA for the LIODNs in the device tree*/
+	/* Enable DMA for the LIODNs in the device tree */
 
 	setup_liodns();
 
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index 51a6750..eea2212 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -285,7 +285,7 @@ static int check_size(u64 size, dma_addr_t iova)
 		return -EINVAL;
 	}
 
-	/* iova must be page size aligned*/
+	/* iova must be page size aligned */
 	if (iova & (size - 1)) {
 		pr_debug("Address is not aligned with window size\n");
 		return -EINVAL;
@@ -779,7 +779,7 @@ static int configure_domain_stash(struct fsl_dma_domain *dma_domain, void *data)
 	return ret;
 }
 
-/* Configure domain dma state i.e. enable/disable DMA*/
+/* Configure domain dma state i.e. enable/disable DMA */
 static int configure_domain_dma_state(struct fsl_dma_domain *dma_domain, bool enable)
 {
 	struct device_domain_info *info;
@@ -876,7 +876,7 @@ static  bool check_pci_ctl_endpt_part(struct pci_controller *pci_ctl)
 	/* Check the PCI controller version number by readding BRR1 register */
 	version = in_be32(pci_ctl->cfg_addr + (PCI_FSL_BRR1 >> 2));
 	version &= PCI_FSL_BRR1_VER;
-	/* If PCI controller version is >= 0x204 we can partition endpoints*/
+	/* If PCI controller version is >= 0x204 we can partition endpoints */
 	if (version >= 0x204)
 		return 1;
 
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 20/26] iommu/fsl: Fix alignment of some stray lines
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (18 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 19/26] iommu/fsl: Fix some comments alignment Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-21-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 21/26] iommu/fsl: Fix checkpatch type LONG_LINE Emil Medve
                     ` (7 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: Emil Medve

Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 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 100644
--- a/drivers/iommu/fsl_pamu.h
+++ b/drivers/iommu/fsl_pamu.h
@@ -67,7 +67,7 @@ struct pamu_mmap_regs {
 #define PAMU_AVS1_GCV   0x2000
 #define PAMU_AVS1_PDV   0x4000
 #define PAMU_AV_MASK    (PAMU_AVS1_AV | PAMU_AVS1_OTV | PAMU_AVS1_APV | PAMU_AVS1_WAV \
-			| PAMU_AVS1_LAV | PAMU_AVS1_GCV | PAMU_AVS1_PDV)
+			 | PAMU_AVS1_LAV | PAMU_AVS1_GCV | PAMU_AVS1_PDV)
 #define PAMU_AVS1_LIODN_SHIFT 16
 #define PAMU_LAV_LIODN_NOT_IN_PPAACT 0x400
 
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index eea2212..ae21305 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -62,8 +62,7 @@ static int __init iommu_init_mempool(void)
 static phys_addr_t get_phys_addr(struct fsl_dma_domain *dma_domain, dma_addr_t iova)
 {
 	u32 win_cnt = dma_domain->win_cnt;
-	struct dma_window *win_ptr =
-				&dma_domain->win_arr[0];
+	struct dma_window *win_ptr = &dma_domain->win_arr[0];
 	struct iommu_domain_geometry *geom;
 
 	geom = &dma_domain->iommu_domain->geometry;
@@ -92,15 +91,13 @@ static phys_addr_t get_phys_addr(struct fsl_dma_domain *dma_domain, dma_addr_t i
 
 static int map_subwins(int liodn, struct fsl_dma_domain *dma_domain)
 {
-	struct dma_window *sub_win_ptr =
-				&dma_domain->win_arr[0];
+	struct dma_window *sub_win_ptr = &dma_domain->win_arr[0];
 	int i, ret;
 	unsigned long rpn, flags;
 
 	for (i = 0; i < dma_domain->win_cnt; i++) {
 		if (sub_win_ptr[i].valid) {
-			rpn = sub_win_ptr[i].paddr >>
-				 PAMU_PAGE_SHIFT;
+			rpn = sub_win_ptr[i].paddr >> PAMU_PAGE_SHIFT;
 			spin_lock_irqsave(&iommu_lock, flags);
 			ret = pamu_config_spaace(liodn, dma_domain->win_cnt, i,
 						 sub_win_ptr[i].size,
@@ -180,8 +177,8 @@ static int update_liodn(int liodn, struct fsl_dma_domain *dma_domain, u32 wnd_nr
 					 wnd->size,
 					 ~(u32)0,
 					 wnd->paddr >> PAMU_PAGE_SHIFT,
-					dma_domain->snoop_id, dma_domain->stash_id,
-					0, wnd->prot);
+					 dma_domain->snoop_id, dma_domain->stash_id,
+					 0, wnd->prot);
 		if (ret)
 			pr_debug("Window reconfiguration failed for liodn %d\n", liodn);
 	}
@@ -679,7 +676,7 @@ static int fsl_pamu_attach_device(struct iommu_domain *domain,
 	} else {
 		pr_debug("missing fsl,liodn property at %s\n",
 			 dev->of_node->full_name);
-			ret = -EINVAL;
+		ret = -EINVAL;
 	}
 
 	return ret;
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 21/26] iommu/fsl: Fix checkpatch type LONG_LINE
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (19 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 20/26] iommu/fsl: Fix alignment of some stray lines Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-22-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 22/26] iommu/fsl: Make local symbols static Emil Medve
                     ` (6 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: Emil Medve

Only pr_*() here

WARNING:LONG_LINE: line over 80 characters
+		pr_debug("window size too small or not a power of two %pa\n", &win_size);

WARNING:LONG_LINE: line over 80 characters
+				pr_debug("missing cache-stash-id at %s\n", node->full_name);

ARNING:LONG_LINE: line over 80 characters
+				pr_debug("missing cache-stash-id at %s\n", node->full_name);

WARNING:LONG_LINE: line over 80 characters
+					pr_emerg("PAACE[%u]=%08x\n", j, in_be32(paace + j));

WARNING:LONG_LINE: line over 80 characters
+				pr_emerg("Disabling liodn %x\n", avs1 >> PAMU_AVS1_LIODN_SHIFT);

WARNING:LONG_LINE: line over 80 characters
+			pr_debug("Subwindow reconfiguration failed for liodn %d\n", liodn);

WARNING:LONG_LINE: line over 80 characters
+			pr_debug("Window reconfiguration failed for liodn %d\n", liodn);

WARNING:LONG_LINE: line over 80 characters
+		pr_debug("Windows not configured, stash destination update failed for liodn %d\n", liodn);

WARNING:LONG_LINE: line over 80 characters
+			pr_debug("Failed to update SPAACE %d field for liodn %d\n ", i, liodn);

WARNING:LONG_LINE: line over 80 characters
+		pr_debug("PAACE configuration failed for liodn %d, win_cnt =%d\n", liodn, win_cnt);

WARNING:LONG_LINE: line over 80 characters
+				pr_debug("SPAACE configuration failed for liodn %d\n", liodn);

Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 drivers/iommu/fsl_pamu.c        | 15 ++++++++++-----
 drivers/iommu/fsl_pamu_domain.c | 18 ++++++++++++------
 2 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index ba5d1e0..3f83259 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -338,7 +338,8 @@ int pamu_config_ppaace(int liodn, phys_addr_t win_addr, phys_addr_t win_size,
 	unsigned long fspi;
 
 	if ((win_size & (win_size - 1)) || win_size < PAMU_PAGE_SIZE) {
-		pr_debug("window size too small or not a power of two %pa\n", &win_size);
+		pr_debug("window size too small or not a power of two %pa\n",
+			 &win_size);
 		return -EINVAL;
 	}
 
@@ -530,7 +531,8 @@ u32 get_stash_id(u32 stash_dest_hint, u32 vcpu)
 		if (node) {
 			prop = of_get_property(node, "cache-stash-id", 0);
 			if (!prop) {
-				pr_debug("missing cache-stash-id at %s\n", node->full_name);
+				pr_debug("missing cache-stash-id at %s\n",
+					 node->full_name);
 				of_node_put(node);
 				return ~(u32)0;
 			}
@@ -556,7 +558,8 @@ found_cpu_node:
 		if (stash_dest_hint == cache_level) {
 			prop = of_get_property(node, "cache-stash-id", 0);
 			if (!prop) {
-				pr_debug("missing cache-stash-id at %s\n", node->full_name);
+				pr_debug("missing cache-stash-id at %s\n",
+					 node->full_name);
 				of_node_put(node);
 				return ~(u32)0;
 			}
@@ -793,7 +796,8 @@ irqreturn_t pamu_av_isr(int irq, void *arg)
 
 				/* Only the first four words are relevant */
 				for (j = 0; j < 4; j++)
-					pr_emerg("PAACE[%u]=%08x\n", j, in_be32(paace + j));
+					pr_emerg("PAACE[%u]=%08x\n",
+						 j, in_be32(paace + j));
 			}
 
 			/* clear access violation condition */
@@ -813,7 +817,8 @@ irqreturn_t pamu_av_isr(int irq, void *arg)
 				/* Disable the LIODN */
 				ret = pamu_disable_liodn(avs1 >> PAMU_AVS1_LIODN_SHIFT);
 				BUG_ON(ret);
-				pr_emerg("Disabling liodn %x\n", avs1 >> PAMU_AVS1_LIODN_SHIFT);
+				pr_emerg("Disabling liodn %x\n",
+					 avs1 >> PAMU_AVS1_LIODN_SHIFT);
 			}
 			out_be32((p + PAMU_PICS), pics);
 		}
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index ae21305..38c26be 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -167,7 +167,8 @@ static int update_liodn(int liodn, struct fsl_dma_domain *dma_domain, u32 wnd_nr
 					 (wnd_nr > 0) ? 1 : 0,
 					 wnd->prot);
 		if (ret)
-			pr_debug("Subwindow reconfiguration failed for liodn %d\n", liodn);
+			pr_debug("Subwindow reconfiguration failed for liodn %d\n",
+				 liodn);
 	} else {
 		phys_addr_t wnd_addr;
 
@@ -180,7 +181,8 @@ static int update_liodn(int liodn, struct fsl_dma_domain *dma_domain, u32 wnd_nr
 					 dma_domain->snoop_id, dma_domain->stash_id,
 					 0, wnd->prot);
 		if (ret)
-			pr_debug("Window reconfiguration failed for liodn %d\n", liodn);
+			pr_debug("Window reconfiguration failed for liodn %d\n",
+				 liodn);
 	}
 
 	spin_unlock_irqrestore(&iommu_lock, flags);
@@ -196,7 +198,8 @@ static int update_liodn_stash(int liodn, struct fsl_dma_domain *dma_domain,
 
 	spin_lock_irqsave(&iommu_lock, flags);
 	if (!dma_domain->win_arr) {
-		pr_debug("Windows not configured, stash destination update failed for liodn %d\n", liodn);
+		pr_debug("Windows not configured, stash destination update failed for liodn %d\n",
+			 liodn);
 		spin_unlock_irqrestore(&iommu_lock, flags);
 		return -EINVAL;
 	}
@@ -204,7 +207,8 @@ static int update_liodn_stash(int liodn, struct fsl_dma_domain *dma_domain,
 	for (i = 0; i < dma_domain->win_cnt; i++) {
 		ret = pamu_update_paace_stash(liodn, i, val);
 		if (ret) {
-			pr_debug("Failed to update SPAACE %d field for liodn %d\n ", i, liodn);
+			pr_debug("Failed to update SPAACE %d field for liodn %d\n ",
+				 i, liodn);
 			spin_unlock_irqrestore(&iommu_lock, flags);
 			return ret;
 		}
@@ -245,7 +249,8 @@ static int pamu_set_liodn(int liodn, struct device *dev,
 					 dma_domain->stash_id, win_cnt, 0);
 	spin_unlock_irqrestore(&iommu_lock, flags);
 	if (ret) {
-		pr_debug("PAACE configuration failed for liodn %d, win_cnt =%d\n", liodn, win_cnt);
+		pr_debug("PAACE configuration failed for liodn %d, win_cnt =%d\n",
+			 liodn, win_cnt);
 		return ret;
 	}
 
@@ -262,7 +267,8 @@ static int pamu_set_liodn(int liodn, struct device *dev,
 							 0, 0);
 			spin_unlock_irqrestore(&iommu_lock, flags);
 			if (ret) {
-				pr_debug("SPAACE configuration failed for liodn %d\n", liodn);
+				pr_debug("SPAACE configuration failed for liodn %d\n",
+					 liodn);
 				return ret;
 			}
 		}
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 22/26] iommu/fsl: Make local symbols static
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (20 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 21/26] iommu/fsl: Fix checkpatch type LONG_LINE Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-23-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 23/26] iommu/fsl: Use NULL instead of zero Emil Medve
                     ` (5 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: 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.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 drivers/iommu/fsl_pamu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index 3f83259..1d9273a 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -75,7 +75,7 @@ static const struct of_device_id l3_device_ids[] = {
 static u32 max_subwindow_count;
 
 /* Pool for fspi allocation */
-struct gen_pool *spaace_pool;
+static struct gen_pool *spaace_pool;
 
 /**
  * pamu_get_max_subwin_cnt() - Return the maximum supported
@@ -759,7 +759,7 @@ static void __init setup_liodns(void)
 	}
 }
 
-irqreturn_t pamu_av_isr(int irq, void *arg)
+static irqreturn_t pamu_av_isr(int irq, void *arg)
 {
 	struct pamu_isr_data *data = arg;
 	phys_addr_t phys;
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 23/26] iommu/fsl: Use NULL instead of zero
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (21 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 22/26] iommu/fsl: Make local symbols static Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-24-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 24/26] iommu/fsl: Remove unneeded semicolon Emil Medve
                     ` (4 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: 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.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 drivers/iommu/fsl_pamu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index 1d9273a..7a4665d 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -529,7 +529,7 @@ u32 get_stash_id(u32 stash_dest_hint, u32 vcpu)
 	if (stash_dest_hint == PAMU_ATTR_CACHE_L3) {
 		node = of_find_matching_node(NULL, l3_device_ids);
 		if (node) {
-			prop = of_get_property(node, "cache-stash-id", 0);
+			prop = of_get_property(node, "cache-stash-id", NULL);
 			if (!prop) {
 				pr_debug("missing cache-stash-id at %s\n",
 					 node->full_name);
@@ -556,7 +556,7 @@ found_cpu_node:
 	/* find the hwnode that represents the cache */
 	for (cache_level = PAMU_ATTR_CACHE_L1; (cache_level < PAMU_ATTR_CACHE_L3) && found; cache_level++) {
 		if (stash_dest_hint == cache_level) {
-			prop = of_get_property(node, "cache-stash-id", 0);
+			prop = of_get_property(node, "cache-stash-id", NULL);
 			if (!prop) {
 				pr_debug("missing cache-stash-id at %s\n",
 					 node->full_name);
@@ -567,7 +567,7 @@ found_cpu_node:
 			return be32_to_cpup(prop);
 		}
 
-		prop = of_get_property(node, "next-level-cache", 0);
+		prop = of_get_property(node, "next-level-cache", NULL);
 		if (!prop) {
 			pr_debug("can't find next-level-cache at %s\n",
 				 node->full_name);
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 24/26] iommu/fsl: Remove unneeded semicolon
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (22 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 23/26] iommu/fsl: Use NULL instead of zero Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-25-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 25/26] iommu/fsl: Don't use integers values with bool type Emil Medve
                     ` (3 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: 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.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 drivers/iommu/fsl_pamu_domain.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index 38c26be..ebbc396 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -830,7 +830,7 @@ static int fsl_pamu_set_domain_attr(struct iommu_domain *domain,
 		pr_debug("Unsupported attribute type\n");
 		ret = -EINVAL;
 		break;
-	};
+	}
 
 	return ret;
 }
@@ -856,7 +856,7 @@ static int fsl_pamu_get_domain_attr(struct iommu_domain *domain,
 		pr_debug("Unsupported attribute type\n");
 		ret = -EINVAL;
 		break;
-	};
+	}
 
 	return ret;
 }
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 25/26] iommu/fsl: Don't use integers values with bool type
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (23 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 24/26] iommu/fsl: Remove unneeded semicolon Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-26-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-28 14:34   ` [PATCH 26/26] iommu/fsl: Remove extra paranthesis Emil Medve
                     ` (2 subsequent siblings)
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: Emil Medve

drivers/iommu/fsl_pamu_domain.c:884:9-10: WARNING: return of 0/1 in function 'check_pci_ctl_endpt_part' with return type bool

Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 drivers/iommu/fsl_pamu_domain.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index ebbc396..36622e2 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -880,10 +880,7 @@ static  bool check_pci_ctl_endpt_part(struct pci_controller *pci_ctl)
 	version = in_be32(pci_ctl->cfg_addr + (PCI_FSL_BRR1 >> 2));
 	version &= PCI_FSL_BRR1_VER;
 	/* If PCI controller version is >= 0x204 we can partition endpoints */
-	if (version >= 0x204)
-		return 1;
-
-	return 0;
+	return version >= 0x204;
 }
 
 /* Get iommu group information from peer devices or devices on the parent bus */
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* [PATCH 26/26] iommu/fsl: Remove extra paranthesis
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (24 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 25/26] iommu/fsl: Don't use integers values with bool type Emil Medve
@ 2015-01-28 14:34   ` Emil Medve
       [not found]     ` <1422455698-3074-27-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-30 12:30   ` [PATCH 00/26] iommu/fsl: Various cleanup Joerg Roedel
  2015-01-31 17:58   ` Timur Tabi
  27 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-28 14:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg
  Cc: Emil Medve

Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
---
 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 b/drivers/iommu/fsl_pamu.c
index 7a4665d..ea49d9f 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -160,7 +160,7 @@ int pamu_disable_liodn(int liodn)
 static unsigned int map_addrspace_size_to_wse(phys_addr_t addrspace_size)
 {
 	/* Bug if not a power of 2 */
-	BUG_ON((addrspace_size & (addrspace_size - 1)));
+	BUG_ON(addrspace_size & (addrspace_size - 1));
 
 	/* window size is 2^(WSE+1) bytes */
 	return fls64(addrspace_size) - 2;
@@ -801,7 +801,7 @@ static irqreturn_t pamu_av_isr(int irq, void *arg)
 			}
 
 			/* clear access violation condition */
-			out_be32((p + PAMU_AVS1), avs1 & PAMU_AV_MASK);
+			out_be32(p + PAMU_AVS1, avs1 & PAMU_AV_MASK);
 			paace = pamu_get_ppaace(avs1 >> PAMU_AVS1_LIODN_SHIFT);
 			BUG_ON(!paace);
 			/* check if we got a violation for a disabled LIODN */
diff --git a/drivers/iommu/fsl_pamu.h b/drivers/iommu/fsl_pamu.h
index 342ac6d..aab723f 100644
--- a/drivers/iommu/fsl_pamu.h
+++ b/drivers/iommu/fsl_pamu.h
@@ -26,8 +26,8 @@
 /* Bit Field macros
  *	v = bit field variable; m = mask, m##_SHIFT = shift, x = value to load
  */
-#define set_bf(v, m, x)		(v = ((v) & ~(m)) | (((x) << (m##_SHIFT)) & (m)))
-#define get_bf(v, m)		(((v) & (m)) >> (m##_SHIFT))
+#define set_bf(v, m, x)		(v = ((v) & ~(m)) | (((x) << m##_SHIFT) & (m)))
+#define get_bf(v, m)		(((v) & (m)) >> m##_SHIFT)
 
 /* PAMU CCSR space */
 #define PAMU_PGC 0x00000000     /* Allows all peripheral accesses */
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index 36622e2..ceebd28 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -84,7 +84,7 @@ static phys_addr_t get_phys_addr(struct fsl_dma_domain *dma_domain, dma_addr_t i
 	}
 
 	if (win_ptr->valid)
-		return (win_ptr->paddr + (iova & (win_ptr->size - 1)));
+		return win_ptr->paddr + (iova & (win_ptr->size - 1));
 
 	return 0;
 }
@@ -386,8 +386,8 @@ static phys_addr_t fsl_pamu_iova_to_phys(struct iommu_domain *domain,
 {
 	struct fsl_dma_domain *dma_domain = domain->priv;
 
-	if ((iova < domain->geometry.aperture_start) ||
-	    iova > (domain->geometry.aperture_end))
+	if (iova < domain->geometry.aperture_start ||
+	    iova > domain->geometry.aperture_end)
 		return 0;
 
 	return get_phys_addr(dma_domain, iova);
@@ -1029,7 +1029,7 @@ static int fsl_pamu_set_windows(struct iommu_domain *domain, u32 w_count)
 	}
 
 	ret = pamu_set_domain_geometry(dma_domain, &domain->geometry,
-				       ((w_count > 1) ? w_count : 0));
+				       w_count > 1 ? w_count : 0);
 	if (!ret) {
 		kfree(dma_domain->win_arr);
 		dma_domain->win_arr = kcalloc(w_count,
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 73+ messages in thread

* RE: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
       [not found]     ` <1422455698-3074-2-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  6:46       ` Varun Sethi
       [not found]         ` <BN3PR0301MB121998FEF4EE5C92DEEF7D61EA310-CEkquS/Gb81uuip9JPHoc5wN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
  2015-02-09 21:46       ` Emil Medve
  1 sibling, 1 reply; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  6:46 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve

Hi Emil,

> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
> 
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu.c        | 12 ++++++------
>  drivers/iommu/fsl_pamu_domain.c |  2 +-
>  2 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index
> d958e65..652c34d 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -50,7 +50,7 @@ struct pamu_isr_data {
> 
>  static struct paace *ppaact;
>  static struct paace *spaact;
> -static struct ome *omt;
> +static struct ome *omt __initdata;


[varun] omt shouldn't be initdata.

-Varun

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
       [not found]         ` <BN3PR0301MB121998FEF4EE5C92DEEF7D61EA310-CEkquS/Gb81uuip9JPHoc5wN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
@ 2015-01-30  6:55           ` Emil Medve
       [not found]             ` <54CB2AEC.9000800-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  0 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-30  6:55 UTC (permalink / raw)
  To: Sethi Varun-B16395,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM

Hello Varun,


On 01/30/2015 12:46 AM, Sethi Varun-B16395 wrote:
> Hi Emil,
> 
>> -----Original Message-----
>> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
>> Sent: Wednesday, January 28, 2015 8:05 PM
>> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
>> Sethi Varun-B16395
>> Cc: Medve Emilian-EMMEDVE1
>> Subject: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
>>
>> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
>> ---
>>  drivers/iommu/fsl_pamu.c        | 12 ++++++------
>>  drivers/iommu/fsl_pamu_domain.c |  2 +-
>>  2 files changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index
>> d958e65..652c34d 100644
>> --- a/drivers/iommu/fsl_pamu.c
>> +++ b/drivers/iommu/fsl_pamu.c
>> @@ -50,7 +50,7 @@ struct pamu_isr_data {
>>
>>  static struct paace *ppaact;
>>  static struct paace *spaact;
>> -static struct ome *omt;
>> +static struct ome *omt __initdata;
> 
> [varun] omt shouldn't be initdata.

It seems to be used only from probe()'s call tree: fsl_pamu_probe() and
setup_omt(); both __init functions. Am I missing something?


Cheers,

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 02/26] iommu/fsl: Use SVR_* instead of magic numbers
       [not found]     ` <1422455698-3074-3-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  6:57       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  6:57 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 02/26] iommu/fsl: Use SVR_* instead of magic numbers
> 
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  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
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -31,6 +31,7 @@
>  #include <linux/genalloc.h>
>  #include <asm/io.h>
>  #include <asm/bitops.h>
> +#include <asm/mpc85xx.h>
>  #include <asm/fsl_guts.h>
> 
>  #include "fsl_pamu.h"
> @@ -999,19 +1000,19 @@ static const struct {
>  	u32 svr;
>  	u32 port_id;
>  } port_id_map[] __initconst = {
> -	{0x82100010, 0xFF000000},	/* P2040 1.0 */
> -	{0x82100011, 0xFF000000},	/* P2040 1.1 */
> -	{0x82100110, 0xFF000000},	/* P2041 1.0 */
> -	{0x82100111, 0xFF000000},	/* P2041 1.1 */
> -	{0x82110310, 0xFF000000},	/* P3041 1.0 */
> -	{0x82110311, 0xFF000000},	/* P3041 1.1 */
> -	{0x82010020, 0xFFF80000},	/* P4040 2.0 */
> -	{0x82000020, 0xFFF80000},	/* P4080 2.0 */
> -	{0x82210010, 0xFC000000},       /* P5010 1.0 */
> -	{0x82210020, 0xFC000000},       /* P5010 2.0 */
> -	{0x82200010, 0xFC000000},	/* P5020 1.0 */
> -	{0x82050010, 0xFF800000},	/* P5021 1.0 */
> -	{0x82040010, 0xFF800000},	/* P5040 1.0 */
> +	{(SVR_P2040 << 8) | 0x10, 0xFF000000},	/* P2040 1.0 */
> +	{(SVR_P2040 << 8) | 0x11, 0xFF000000},	/* P2040 1.1 */
> +	{(SVR_P2041 << 8) | 0x10, 0xFF000000},	/* P2041 1.0 */
> +	{(SVR_P2041 << 8) | 0x11, 0xFF000000},	/* P2041 1.1 */
> +	{(SVR_P3041 << 8) | 0x10, 0xFF000000},	/* P3041 1.0 */
> +	{(SVR_P3041 << 8) | 0x11, 0xFF000000},	/* P3041 1.1 */
> +	{(SVR_P4040 << 8) | 0x20, 0xFFF80000},	/* P4040 2.0 */
> +	{(SVR_P4080 << 8) | 0x20, 0xFFF80000},	/* P4080 2.0 */
> +	{(SVR_P5010 << 8) | 0x10, 0xFC000000},	/* P5010 1.0 */
> +	{(SVR_P5010 << 8) | 0x20, 0xFC000000},	/* P5010 2.0 */
> +	{(SVR_P5020 << 8) | 0x10, 0xFC000000},	/* P5020 1.0 */
> +	{(SVR_P5021 << 8) | 0x10, 0xFF800000},	/* P5021 1.0 */
> +	{(SVR_P5040 << 8) | 0x10, 0xFF800000},	/* P5040 1.0 */
>  };
> 
>  #define SVR_SECURITY	0x80000	/* The Security (E) bit */
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 03/26] iommu/fsl: Remove unused/extra includes
       [not found]     ` <1422455698-3074-4-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  7:10       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  7:10 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 03/26] iommu/fsl: Remove unused/extra includes
> 
> linux/modules.h		- drivers can't be a module
> linux/bootmem.h		- no boot time memory allocator is used
> linux/notifier.h	- not used
> etc.
> 
> Factorize common includes into fsl_pamu.h
> 
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu.c        | 16 +++-------------
>  drivers/iommu/fsl_pamu.h        |  2 ++
>  drivers/iommu/fsl_pamu_domain.c | 20 ++------------------
>  3 files changed, 7 insertions(+), 31 deletions(-)
> 
> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index
> 7d9f8a0..d3a9fff 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -18,24 +18,14 @@
> 
>  #define pr_fmt(fmt)    "fsl-pamu: %s: " fmt, __func__
> 
> -#include <linux/init.h>
> -#include <linux/iommu.h>
> -#include <linux/slab.h>
> -#include <linux/module.h>
> -#include <linux/types.h>
> -#include <linux/mm.h>
> +#include "fsl_pamu.h"
> +
>  #include <linux/interrupt.h>
> -#include <linux/device.h>
> -#include <linux/of_platform.h>
> -#include <linux/bootmem.h>
>  #include <linux/genalloc.h>
> -#include <asm/io.h>
> -#include <asm/bitops.h>
> +
>  #include <asm/mpc85xx.h>
>  #include <asm/fsl_guts.h>
> 
> -#include "fsl_pamu.h"
> -
>  /* define indexes for each operation mapping scenario */
>  #define OMI_QMAN        0x00
>  #define OMI_FMAN        0x01
> diff --git a/drivers/iommu/fsl_pamu.h b/drivers/iommu/fsl_pamu.h index
> 8fc1a12..a7794b5 100644
> --- a/drivers/iommu/fsl_pamu.h
> +++ b/drivers/iommu/fsl_pamu.h
> @@ -19,6 +19,8 @@
>  #ifndef __FSL_PAMU_H
>  #define __FSL_PAMU_H
> 
> +#include <linux/iommu.h>
> +
>  #include <asm/fsl_pamu_stash.h>
> 
>  /* Bit Field macros
> diff --git a/drivers/iommu/fsl_pamu_domain.c
> b/drivers/iommu/fsl_pamu_domain.c index 48a72b3..7ea93ae 100644
> --- a/drivers/iommu/fsl_pamu_domain.c
> +++ b/drivers/iommu/fsl_pamu_domain.c
> @@ -19,26 +19,10 @@
> 
>  #define pr_fmt(fmt)    "fsl-pamu-domain: %s: " fmt, __func__
> 
> -#include <linux/init.h>
> -#include <linux/iommu.h>
> -#include <linux/notifier.h>
> -#include <linux/slab.h>
> -#include <linux/module.h>
> -#include <linux/types.h>
> -#include <linux/mm.h>
> -#include <linux/interrupt.h>
> -#include <linux/device.h>
> -#include <linux/of_platform.h>
> -#include <linux/bootmem.h>
> -#include <linux/err.h>
> -#include <asm/io.h>
> -#include <asm/bitops.h>
> -
> -#include <asm/pci-bridge.h>
> -#include <sysdev/fsl_pci.h>
> -
>  #include "fsl_pamu_domain.h"
> 
> +#include <sysdev/fsl_pci.h>
> +
>  /*
>   * Global spinlock that needs to be held while
>   * configuring PAMU.
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 04/26] iommu/fsl: Fix checkpatch type SPACE_BEFORE_TAB
       [not found]     ` <1422455698-3074-5-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  7:12       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  7:12 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 04/26] iommu/fsl: Fix checkpatch type SPACE_BEFORE_TAB
> 
> WARNING:SPACE_BEFORE_TAB: please, no space before tabs
> +^Iu32 ^Icpu;^I/* cpu number */$
> 
> WARNING:SPACE_BEFORE_TAB: please, no space before tabs
> +^Iu32 ^Icache;^I/* cache to stash to: L1,L2,L3 */$
> 
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  arch/powerpc/include/asm/fsl_pamu_stash.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/fsl_pamu_stash.h
> b/arch/powerpc/include/asm/fsl_pamu_stash.h
> index caa1b21..38311c9 100644
> --- a/arch/powerpc/include/asm/fsl_pamu_stash.h
> +++ b/arch/powerpc/include/asm/fsl_pamu_stash.h
> @@ -32,8 +32,8 @@ enum pamu_stash_target {
>   */
> 
>  struct pamu_stash_attribute {
> -	u32 	cpu;	/* cpu number */
> -	u32 	cache;	/* cache to stash to: L1,L2,L3 */
> +	u32	cpu;	/* cpu number */
> +	u32	cache;	/* cache to stash to: L1,L2,L3 */
>  };
> 
>  #endif  /* __FSL_PAMU_STASH_H */
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 05/26] iommu/fsl: Fix checkpatch type LINE_SPACING
       [not found]     ` <1422455698-3074-6-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  7:13       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  7:13 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 05/26] iommu/fsl: Fix checkpatch type LINE_SPACING
> 
> 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 after declarations
> +                       u32 win_cnt = dma_domain->win_cnt > 1 ?  dma_domain-
> >win_cnt : 0;
> +                       ret = pamu_set_liodn(liodn[i], dev, dma_domain,
> 
> CHECK:LINE_SPACING: Please don't use multiple blank lines
> +
> +
> 
> CHECK:LINE_SPACING: Please don't use multiple blank lines
> +
> +
> 
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu.c        | 4 ----
>  drivers/iommu/fsl_pamu_domain.c | 3 +--
>  2 files changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index
> d3a9fff..df6007c 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -56,7 +56,6 @@ static const struct of_device_id guts_device_ids[]
> __initconst = {
>  	{}
>  };
> 
> -
>  /*
>   * Table for matching compatible strings, for device tree
>   * L3 cache controller node.
> @@ -317,7 +316,6 @@ int pamu_disable_spaace(int liodn, u32 subwin)
>  	return 0;
>  }
> 
> -
>  /**
>   * pamu_config_paace() - Sets up PPAACE entry for specified liodn
>   *
> @@ -433,7 +431,6 @@ int pamu_config_spaace(int liodn, u32 subwin_cnt,
> u32 subwin,  {
>  	struct paace *paace;
> 
> -
>  	/* setup sub-windows */
>  	if (!subwin_cnt) {
>  		pr_debug("Invalid subwindow count\n"); @@ -824,7 +821,6
> @@ irqreturn_t pamu_av_isr(int irq, void *arg)
>  		}
>  	}
> 
> -
>  	return IRQ_HANDLED;
>  }
> 
> diff --git a/drivers/iommu/fsl_pamu_domain.c
> b/drivers/iommu/fsl_pamu_domain.c index 7ea93ae..dc38db5 100644
> --- a/drivers/iommu/fsl_pamu_domain.c
> +++ b/drivers/iommu/fsl_pamu_domain.c
> @@ -633,6 +633,7 @@ static int handle_attach_device(struct
> fsl_dma_domain *dma_domain,
>  		 */
>  		if (dma_domain->win_arr) {
>  			u32 win_cnt = dma_domain->win_cnt > 1 ?
> dma_domain->win_cnt : 0;
> +
>  			ret = pamu_set_liodn(liodn[i], dev, dma_domain,
>  					      &domain->geometry,
>  					      win_cnt);
> @@ -822,7 +823,6 @@ static int fsl_pamu_set_domain_attr(struct
> iommu_domain *domain,
>  	struct fsl_dma_domain *dma_domain = domain->priv;
>  	int ret = 0;
> 
> -
>  	switch (attr_type) {
>  	case DOMAIN_ATTR_GEOMETRY:
>  		ret = configure_domain_geometry(domain, data); @@ -
> 848,7 +848,6 @@ static int fsl_pamu_get_domain_attr(struct iommu_domain
> *domain,
>  	struct fsl_dma_domain *dma_domain = domain->priv;
>  	int ret = 0;
> 
> -
>  	switch (attr_type) {
>  	case DOMAIN_ATTR_FSL_PAMU_STASH:
>  		memcpy((struct pamu_stash_attribute *) data,
> &dma_domain->dma_stash,
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 06/26] iommu/fsl: Fix checkpatch type LEADING_SPACE
       [not found]     ` <1422455698-3074-7-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  7:15       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  7:15 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 06/26] iommu/fsl: Fix checkpatch type LEADING_SPACE
> 
> 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.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu.c | 4 ++--
>  drivers/iommu/fsl_pamu.h | 3 +--
>  2 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index
> df6007c..ccdc5e5 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -169,8 +169,8 @@ static unsigned int
> map_addrspace_size_to_wse(phys_addr_t addrspace_size)
>  /* Derive the PAACE window count encoding for the subwindow count */
> static unsigned int map_subwindow_cnt_to_wce(u32 subwindow_cnt)  {
> -       /* window count is 2^(WCE+1) bytes */
> -       return __ffs(subwindow_cnt) - 1;
> +	/* window count is 2^(WCE+1) bytes */
> +	return __ffs(subwindow_cnt) - 1;
>  }
> 
>  /*
> diff --git a/drivers/iommu/fsl_pamu.h b/drivers/iommu/fsl_pamu.h index
> a7794b5..52a91af 100644
> --- a/drivers/iommu/fsl_pamu.h
> +++ b/drivers/iommu/fsl_pamu.h
> @@ -200,8 +200,7 @@ struct pamu_mmap_regs {
>  #define PAACE_ATM_NO_XLATE      0x00
>  #define PAACE_ATM_WINDOW_XLATE  0x01
>  #define PAACE_ATM_PAGE_XLATE    0x02
> -#define PAACE_ATM_WIN_PG_XLATE  \
> -                (PAACE_ATM_WINDOW_XLATE | PAACE_ATM_PAGE_XLATE)
> +#define PAACE_ATM_WIN_PG_XLATE  (PAACE_ATM_WINDOW_XLATE |
> +PAACE_ATM_PAGE_XLATE)
>  #define PAACE_OTM_NO_XLATE      0x00
>  #define PAACE_OTM_IMMEDIATE     0x01
>  #define PAACE_OTM_INDEXED       0x02
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 07/26] iommu/fsl: Fix checkpath type BRACES
       [not found]     ` <1422455698-3074-8-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  7:17       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  7:17 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 07/26] iommu/fsl: Fix checkpath type BRACES
> 
> WARNING:BRACES: braces {} are not necessary for single statement blocks
> +               if (!paace) {
> +                       return -ENOENT;
> +               }
> 
> WARNING:BRACES: braces {} are not necessary for single statement blocks
> +               if (!paace) {
> +                       return -ENOENT;
> +               }
> 
> WARNING:BRACES: braces {} are not necessary for single statement blocks
> +       if (!ppaace) {
> +               return -ENOENT;
> +       }
> 
> CHECK:BRACES: Blank lines aren't necessary after an open brace '{'
> +{
> +
> 
> CHECK:BRACES: Blank lines aren't necessary before a close brace '}'
> +
> +}
> 
> CHECK:BRACES: Blank lines aren't necessary before a close brace '}'
> +
> +}
> 
> CHECK:BRACES: Blank lines aren't necessary before a close brace '}'
> +
> +}
> 
> CHECK:BRACES: Blank lines aren't necessary after an open brace '{'
> +       for (i = 0; i < num; i++) {
> +
> 
> CHECK:BRACES: braces {} should be used on all arms of this statement
> +               if (pci_ctl->parent->iommu_group) {
> [...]
> +               } else
> [...]
> 
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu.c        | 9 +++------
>  drivers/iommu/fsl_pamu_domain.c | 8 ++------
>  2 files changed, 5 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index
> ccdc5e5..6b28dd8 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -278,9 +278,8 @@ int  pamu_update_paace_stash(int liodn, u32 subwin,
> u32 value)
>  	}
>  	if (subwin) {
>  		paace = pamu_get_spaace(paace, subwin - 1);
> -		if (!paace) {
> +		if (!paace)
>  			return -ENOENT;
> -		}
>  	}
>  	set_bf(paace->impl_attr, PAACE_IA_CID, value);
> 
> @@ -301,9 +300,8 @@ int pamu_disable_spaace(int liodn, u32 subwin)
>  	}
>  	if (subwin) {
>  		paace = pamu_get_spaace(paace, subwin - 1);
> -		if (!paace) {
> +		if (!paace)
>  			return -ENOENT;
> -		}
>  		set_bf(paace->addr_bitfields, PAACE_AF_V,
>  			 PAACE_V_INVALID);
>  	} else {
> @@ -351,9 +349,8 @@ int pamu_config_ppaace(int liodn, phys_addr_t
> win_addr, phys_addr_t win_size,
>  	}
> 
>  	ppaace = pamu_get_ppaace(liodn);
> -	if (!ppaace) {
> +	if (!ppaace)
>  		return -ENOENT;
> -	}
> 
>  	/* window size is 2^(WSE+1) bytes */
>  	set_bf(ppaace->addr_bitfields, PPAACE_AF_WSE, diff --git
> a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
> index dc38db5..080ffa4 100644
> --- a/drivers/iommu/fsl_pamu_domain.c
> +++ b/drivers/iommu/fsl_pamu_domain.c
> @@ -35,7 +35,6 @@ static DEFINE_SPINLOCK(device_domain_lock);
> 
>  static int __init iommu_init_mempool(void)  {
> -
>  	fsl_pamu_domain_cache =
> kmem_cache_create("fsl_pamu_domain",
>  					 sizeof(struct fsl_dma_domain),
>  					 0,
> @@ -153,7 +152,6 @@ static int map_liodn(int liodn, struct fsl_dma_domain
> *dma_domain)
>  		return map_subwins(liodn, dma_domain);
>  	else
>  		return map_win(liodn, dma_domain);
> -
>  }
> 
>  /* Update window/subwindow mapping for the LIODN */ @@ -380,7 +378,6
> @@ static void attach_device(struct fsl_dma_domain *dma_domain, int
> liodn, struct d
>  	if (!dev->archdata.iommu_domain)
>  		dev->archdata.iommu_domain = info;
>  	spin_unlock_irqrestore(&device_domain_lock, flags);
> -
>  }
> 
>  static phys_addr_t fsl_pamu_iova_to_phys(struct iommu_domain *domain,
> @@ -527,7 +524,6 @@ static void fsl_pamu_window_disable(struct
> iommu_domain *domain, u32 wnd_nr)
>  	}
> 
>  	spin_unlock_irqrestore(&dma_domain->domain_lock, flags);
> -
>  }
> 
>  static int fsl_pamu_window_enable(struct iommu_domain *domain, u32
> wnd_nr, @@ -616,7 +612,6 @@ static int handle_attach_device(struct
> fsl_dma_domain *dma_domain,
> 
>  	spin_lock_irqsave(&dma_domain->domain_lock, flags);
>  	for (i = 0; i < num; i++) {
> -
>  		/* Ensure that LIODN value is valid */
>  		if (liodn[i] >= PAACE_NUMBER_ENTRIES) {
>  			pr_debug("Invalid liodn %d, attach device failed for
> %s\n", @@ -951,8 +946,9 @@ static struct iommu_group
> *get_pci_device_group(struct pci_dev *pdev)
>  		if (pci_ctl->parent->iommu_group) {
>  			group = get_device_iommu_group(pci_ctl->parent);
>  			iommu_group_remove_device(pci_ctl->parent);
> -		} else
> +		} else {
>  			group = get_shared_pci_device_group(pdev);
> +		}
>  	}
> 
>  	if (!group)
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 08/26] iommu/fsl: Fix checkpatch type CODE_INDENT
       [not found]     ` <1422455698-3074-9-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  7:19       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  7:19 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 08/26] iommu/fsl: Fix checkpatch type CODE_INDENT
> 
> ERROR:CODE_INDENT: code indent should use tabs where possible
> +^I          stash_dest_hint, vcpu);$
> 
> ERROR:CODE_INDENT: code indent should use tabs where possible
> +^I           phys_addr_t ppaact_phys, phys_addr_t spaact_phys,$
> 
> ERROR:CODE_INDENT: code indent should use tabs where possible
> +^I^I          dev->of_node->full_name);$
> 
> ERROR:CODE_INDENT: code indent should use tabs where possible
> +^I^I          dev->of_node->full_name);$
> 
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu.c        | 6 +++---
>  drivers/iommu/fsl_pamu_domain.c | 4 ++--
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index
> 6b28dd8..7f0181c 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -583,7 +583,7 @@ found_cpu_node:
>  	}
> 
>  	pr_debug("stash dest not found for %d on vcpu %d\n",
> -	          stash_dest_hint, vcpu);
> +		 stash_dest_hint, vcpu);
>  	return ~(u32)0;
>  }
> 
> @@ -675,8 +675,8 @@ static void __init get_pamu_cap_values(unsigned
> long pamu_reg_base)
> 
>  /* Setup PAMU registers pointing to PAACT, SPAACT and OMT */  static int
> __init setup_one_pamu(unsigned long pamu_reg_base, unsigned long
> pamu_reg_size,
> -	           phys_addr_t ppaact_phys, phys_addr_t spaact_phys,
> -		   phys_addr_t omt_phys)
> +				 phys_addr_t ppaact_phys, phys_addr_t
> spaact_phys,
> +				 phys_addr_t omt_phys)
>  {
>  	u32 *pc;
>  	struct pamu_mmap_regs *pamu_regs;
> diff --git a/drivers/iommu/fsl_pamu_domain.c
> b/drivers/iommu/fsl_pamu_domain.c index 080ffa4..d5137dd 100644
> --- a/drivers/iommu/fsl_pamu_domain.c
> +++ b/drivers/iommu/fsl_pamu_domain.c
> @@ -682,7 +682,7 @@ static int fsl_pamu_attach_device(struct
> iommu_domain *domain,
>  					 liodn, liodn_cnt);
>  	} else {
>  		pr_debug("missing fsl,liodn property at %s\n",
> -		          dev->of_node->full_name);
> +			 dev->of_node->full_name);
>  			ret = -EINVAL;
>  	}
> 
> @@ -718,7 +718,7 @@ static void fsl_pamu_detach_device(struct
> iommu_domain *domain,
>  		detach_device(dev, dma_domain);
>  	else
>  		pr_debug("missing fsl,liodn property at %s\n",
> -		          dev->of_node->full_name);
> +			 dev->of_node->full_name);
>  }
> 
>  static  int configure_domain_geometry(struct iommu_domain *domain, void
> *data)
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 09/26] iommu/fsl: Fix checkpatch type ALLOC_SIZEOF_STRUCT
       [not found]     ` <1422455698-3074-10-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  7:30       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  7:30 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 09/26] iommu/fsl: Fix checkpatch type
> ALLOC_SIZEOF_STRUCT
> 
> 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)...)
> +               dma_domain->win_arr = kzalloc(sizeof(struct dma_window)
> 
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu.c        | 2 +-
>  drivers/iommu/fsl_pamu_domain.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index
> 7f0181c..4f1926b 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -1039,7 +1039,7 @@ static int __init fsl_pamu_probe(struct
> platform_device *pdev)
>  		goto error;
>  	}
> 
> -	data = kzalloc(sizeof(struct pamu_isr_data), GFP_KERNEL);
> +	data = kzalloc(sizeof(*data), GFP_KERNEL);
>  	if (!data) {
>  		dev_err(&pdev->dev, "PAMU isr data memory allocation
> failed\n");
>  		ret = -ENOMEM;
> diff --git a/drivers/iommu/fsl_pamu_domain.c
> b/drivers/iommu/fsl_pamu_domain.c index d5137dd..9417207 100644
> --- a/drivers/iommu/fsl_pamu_domain.c
> +++ b/drivers/iommu/fsl_pamu_domain.c
> @@ -1037,7 +1037,7 @@ static int fsl_pamu_set_windows(struct
> iommu_domain *domain, u32 w_count)
>  				((w_count > 1) ? w_count : 0));
>  	if (!ret) {
>  		kfree(dma_domain->win_arr);
> -		dma_domain->win_arr = kzalloc(sizeof(struct dma_window)
> *
> +		dma_domain->win_arr = kzalloc(sizeof(*dma_domain-
> >win_arr) *
>  							  w_count,
> GFP_ATOMIC);
>  		if (!dma_domain->win_arr) {
>  			spin_unlock_irqrestore(&dma_domain-
> >domain_lock, flags);
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 10/26] iommu/fsl: Fix checkpatch type ALLOC_WITH_MULTIPLY
       [not found]     ` <1422455698-3074-11-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  7:33       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  7:33 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 10/26] iommu/fsl: Fix checkpatch type
> ALLOC_WITH_MULTIPLY
> 
> 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.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu_domain.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iommu/fsl_pamu_domain.c
> b/drivers/iommu/fsl_pamu_domain.c index 9417207..dcb9bb4 100644
> --- a/drivers/iommu/fsl_pamu_domain.c
> +++ b/drivers/iommu/fsl_pamu_domain.c
> @@ -1037,8 +1037,9 @@ static int fsl_pamu_set_windows(struct
> iommu_domain *domain, u32 w_count)
>  				((w_count > 1) ? w_count : 0));
>  	if (!ret) {
>  		kfree(dma_domain->win_arr);
> -		dma_domain->win_arr = kzalloc(sizeof(*dma_domain-
> >win_arr) *
> -							  w_count,
> GFP_ATOMIC);
> +		dma_domain->win_arr = kcalloc(w_count,
> +					      sizeof(*dma_domain->win_arr),
> +					      GFP_ATOMIC);
>  		if (!dma_domain->win_arr) {
>  			spin_unlock_irqrestore(&dma_domain-
> >domain_lock, flags);
>  			return -ENOMEM;
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 12/26] iommu/fsl: Fix checkpatch type TYPO_SPELLING
       [not found]     ` <1422455698-3074-13-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  7:40       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  7:40 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 12/26] iommu/fsl: Fix checkpatch type TYPO_SPELLING
> 
> CHECK:TYPO_SPELLING: 'accomodate' may be misspelled - perhaps
> 'accommodate'?
> + * Hard coded value for the PAACT size to accomodate
> 
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/fsl_pamu.h b/drivers/iommu/fsl_pamu.h index
> 52a91af..86abc70 100644
> --- a/drivers/iommu/fsl_pamu.h
> +++ b/drivers/iommu/fsl_pamu.h
> @@ -220,7 +220,7 @@ struct pamu_mmap_regs {
>  #define PAACE_TCEF_FORMAT0_8B   0x00
>  #define PAACE_TCEF_FORMAT1_RSVD 0x01
>  /*
> - * Hard coded value for the PAACT size to accomodate
> + * Hard coded value for the PAACT size to accommodate
>   * maximum LIODN value generated by u-boot.
>   */
>  #define PAACE_NUMBER_ENTRIES    0x500
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 13/26] iommu/fsl: Fix checkpatch type PREFER_PACKED
       [not found]     ` <1422455698-3074-14-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  7:40       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  7:40 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 13/26] iommu/fsl: Fix checkpatch type PREFER_PACKED
> 
> WARNING:PREFER_PACKED: __packed is preferred over
> __attribute__((packed))
> +} __attribute__((packed));
> 
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/fsl_pamu.h b/drivers/iommu/fsl_pamu.h index
> 86abc70..04dcd25 100644
> --- a/drivers/iommu/fsl_pamu.h
> +++ b/drivers/iommu/fsl_pamu.h
> @@ -333,7 +333,7 @@ struct paace {
>  #define NUM_MOE 128
>  struct ome {
>  	u8 moe[NUM_MOE];
> -} __attribute__((packed));
> +} __packed;
> 
>  #define PAACT_SIZE              (sizeof(struct paace) *
> PAACE_NUMBER_ENTRIES)
>  #define SPAACT_SIZE              (sizeof(struct paace) *
> SPAACE_NUMBER_ENTRIES)
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 14/26] iommu/fsl: Fix checkpatch type QUOTED_WHITESPACE_BEFORE_NEWLINE
       [not found]     ` <1422455698-3074-15-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  7:42       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  7:42 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 14/26] iommu/fsl: Fix checkpatch type
> QUOTED_WHITESPACE_BEFORE_NEWLINE
> 
> WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary
> whitespace before a quoted newline
> +               pr_debug("Invalid window size \n");
> 
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu_domain.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/fsl_pamu_domain.c
> b/drivers/iommu/fsl_pamu_domain.c index dcb9bb4..c9886ff 100644
> --- a/drivers/iommu/fsl_pamu_domain.c
> +++ b/drivers/iommu/fsl_pamu_domain.c
> @@ -556,7 +556,7 @@ static int fsl_pamu_window_enable(struct
> iommu_domain *domain, u32 wnd_nr,
> 
>  	win_size = dma_domain->geom_size >> ilog2(dma_domain-
> >win_cnt);
>  	if (size > win_size) {
> -		pr_debug("Invalid window size \n");
> +		pr_debug("Invalid window size\n");
>  		spin_unlock_irqrestore(&dma_domain->domain_lock, flags);
>  		return -EINVAL;
>  	}
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 15/26] iommu/fsl: Fix checkpatch type SPACING
       [not found]     ` <1422455698-3074-16-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  7:44       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  7:44 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 15/26] iommu/fsl: Fix checkpatch type SPACING
> 
> CHECK:SPACING: No space is necessary after a cast
> +               pamu_reg_base = (unsigned long) pamu_regs +
> + pamu_reg_off;
> 
> CHECK:SPACING: No space is necessary after a cast
> +               memcpy((struct pamu_stash_attribute *) data,
> + &dma_domain->dma_stash,
> 
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu.c        | 2 +-
>  drivers/iommu/fsl_pamu_domain.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index
> 6f9c976..18a604a 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -1151,7 +1151,7 @@ static int __init fsl_pamu_probe(struct
> platform_device *pdev)
>  	for (pamu_reg_off = 0, pamu_counter = 0x80000000; pamu_reg_off
> < size;
>  	     pamu_reg_off += PAMU_OFFSET, pamu_counter >>= 1) {
> 
> -		pamu_reg_base = (unsigned long) pamu_regs +
> pamu_reg_off;
> +		pamu_reg_base = (unsigned long)pamu_regs +
> pamu_reg_off;
>  		setup_one_pamu(pamu_reg_base, pamu_reg_off,
> ppaact_phys,
>  				 spaact_phys, omt_phys);
>  		/* Disable PAMU bypass for this PAMU */ diff --git
> a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
> index c9886ff..c7af760 100644
> --- a/drivers/iommu/fsl_pamu_domain.c
> +++ b/drivers/iommu/fsl_pamu_domain.c
> @@ -845,8 +845,8 @@ static int fsl_pamu_get_domain_attr(struct
> iommu_domain *domain,
> 
>  	switch (attr_type) {
>  	case DOMAIN_ATTR_FSL_PAMU_STASH:
> -		memcpy((struct pamu_stash_attribute *) data,
> &dma_domain->dma_stash,
> -				 sizeof(struct pamu_stash_attribute));
> +		memcpy(data, &dma_domain->dma_stash,
> +		       sizeof(struct pamu_stash_attribute));
>  		break;
>  	case DOMAIN_ATTR_FSL_PAMU_ENABLE:
>  		*(int *)data = dma_domain->enabled;
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 16/26] iommu/fsl: Use a device pointer to make lines shorter
       [not found]     ` <1422455698-3074-17-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  7:46       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  7:46 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 16/26] iommu/fsl: Use a device pointer to make lines
> shorter
> 
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu.c | 39 ++++++++++++++++++---------------------
>  1 file changed, 18 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index
> 18a604a..22b72e2 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -1002,6 +1002,7 @@ static const struct {
> 
>  static int __init fsl_pamu_probe(struct platform_device *pdev)  {
> +	struct device *dev = &pdev->dev;
>  	void __iomem *pamu_regs = NULL;
>  	struct ccsr_guts __iomem *guts_regs = NULL;
>  	u32 pamubypenr, pamu_counter;
> @@ -1026,16 +1027,16 @@ static int __init fsl_pamu_probe(struct
> platform_device *pdev)
>  	 * NOTE : All PAMUs share the same LIODN tables.
>  	 */
> 
> -	pamu_regs = of_iomap(pdev->dev.of_node, 0);
> +	pamu_regs = of_iomap(dev->of_node, 0);
>  	if (!pamu_regs) {
> -		dev_err(&pdev->dev, "ioremap of PAMU node failed\n");
> +		dev_err(dev, "ioremap of PAMU node failed\n");
>  		return -ENOMEM;
>  	}
> -	of_get_address(pdev->dev.of_node, 0, &size, NULL);
> +	of_get_address(dev->of_node, 0, &size, NULL);
> 
> -	irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
> +	irq = irq_of_parse_and_map(dev->of_node, 0);
>  	if (irq == NO_IRQ) {
> -		dev_warn(&pdev->dev, "no interrupts listed in PAMU
> node\n");
> +		dev_warn(dev, "no interrupts listed in PAMU node\n");
>  		goto error;
>  	}
> 
> @@ -1050,15 +1051,14 @@ static int __init fsl_pamu_probe(struct
> platform_device *pdev)
>  	/* The ISR needs access to the regs, so we won't iounmap them */
>  	ret = request_irq(irq, pamu_av_isr, 0, "pamu", data);
>  	if (ret < 0) {
> -		dev_err(&pdev->dev, "error %i installing ISR for irq %i\n",
> -			ret, irq);
> +		dev_err(dev, "error %i installing ISR for irq %i\n", ret, irq);
>  		goto error;
>  	}
> 
>  	guts_node = of_find_matching_node(NULL, guts_device_ids);
>  	if (!guts_node) {
> -		dev_err(&pdev->dev, "could not find GUTS node %s\n",
> -			pdev->dev.of_node->full_name);
> +		dev_err(dev, "could not find GUTS node %s\n",
> +			dev->of_node->full_name);
>  		ret = -ENODEV;
>  		goto error;
>  	}
> @@ -1066,7 +1066,7 @@ static int __init fsl_pamu_probe(struct
> platform_device *pdev)
>  	guts_regs = of_iomap(guts_node, 0);
>  	of_node_put(guts_node);
>  	if (!guts_regs) {
> -		dev_err(&pdev->dev, "ioremap of GUTS node failed\n");
> +		dev_err(dev, "ioremap of GUTS node failed\n");
>  		ret = -ENODEV;
>  		goto error;
>  	}
> @@ -1086,7 +1086,7 @@ static int __init fsl_pamu_probe(struct
> platform_device *pdev)
> 
>  	p = alloc_pages(GFP_KERNEL | __GFP_ZERO, order);
>  	if (!p) {
> -		dev_err(&pdev->dev, "unable to allocate
> PAACT/SPAACT/OMT block\n");
> +		dev_err(dev, "unable to allocate PAACT/SPAACT/OMT
> block\n");
>  		ret = -ENOMEM;
>  		goto error;
>  	}
> @@ -1096,7 +1096,7 @@ static int __init fsl_pamu_probe(struct
> platform_device *pdev)
> 
>  	/* Make sure the memory is naturally aligned */
>  	if (ppaact_phys & ((PAGE_SIZE << order) - 1)) {
> -		dev_err(&pdev->dev, "PAACT/OMT block is unaligned\n");
> +		dev_err(dev, "PAACT/OMT block is unaligned\n");
>  		ret = -ENOMEM;
>  		goto error;
>  	}
> @@ -1104,8 +1104,7 @@ static int __init fsl_pamu_probe(struct
> platform_device *pdev)
>  	spaact = (void *)ppaact + (PAGE_SIZE << get_order(PAACT_SIZE));
>  	omt = (void *)spaact + (PAGE_SIZE << get_order(SPAACT_SIZE));
> 
> -	dev_dbg(&pdev->dev, "ppaact virt=%p phys=0x%pa\n", ppaact,
> -		&ppaact_phys);
> +	dev_dbg(dev, "ppaact virt=%p phys=0x%pa\n", ppaact,
> &ppaact_phys);
> 
>  	/* Check to see if we need to implement the work-around on this
> SOC */
> 
> @@ -1113,21 +1112,19 @@ static int __init fsl_pamu_probe(struct
> platform_device *pdev)
>  	for (i = 0; i < ARRAY_SIZE(port_id_map); i++) {
>  		if (port_id_map[i].svr == (mfspr(SPRN_SVR) &
> ~SVR_SECURITY)) {
>  			csd_port_id = port_id_map[i].port_id;
> -			dev_dbg(&pdev->dev, "found matching SVR
> %08x\n",
> +			dev_dbg(dev, "found matching SVR %08x\n",
>  				port_id_map[i].svr);
>  			break;
>  		}
>  	}
> 
>  	if (csd_port_id) {
> -		dev_dbg(&pdev->dev, "creating coherency subdomain at
> address "
> -			"%pa, size %zu, port id 0x%08x", &ppaact_phys,
> -			mem_size, csd_port_id);
> +		dev_dbg(dev, "creating coherency subdomain at address
> %pa, size %zu, port id 0x%08x",
> +			&ppaact_phys, mem_size, csd_port_id);
> 
>  		ret = create_csd(ppaact_phys, mem_size, csd_port_id);
>  		if (ret) {
> -			dev_err(&pdev->dev, "could not create coherence "
> -				"subdomain\n");
> +			dev_err(dev, "could not create coherence
> subdomain\n");
>  			return ret;
>  		}
>  	}
> @@ -1138,7 +1135,7 @@ static int __init fsl_pamu_probe(struct
> platform_device *pdev)
>  	spaace_pool = gen_pool_create(ilog2(sizeof(struct paace)), -1);
>  	if (!spaace_pool) {
>  		ret = -ENOMEM;
> -		dev_err(&pdev->dev, "PAMU : failed to allocate spaace gen
> pool\n");
> +		dev_err(dev, "PAMU : failed to allocate spaace gen pool\n");
>  		goto error;
>  	}
> 
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 17/26] iommu/fsl: Remove pr/dev_*() prefixes
       [not found]     ` <1422455698-3074-18-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  7:47       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  7:47 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 17/26] iommu/fsl: Remove pr/dev_*() prefixes
> 
> pr_fmt() and dev_*() already take care of it
> 
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu.c        |  2 +-
>  drivers/iommu/fsl_pamu_domain.c | 12 ++++++------
>  2 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index
> 22b72e2..e46c75f 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -1135,7 +1135,7 @@ static int __init fsl_pamu_probe(struct
> platform_device *pdev)
>  	spaace_pool = gen_pool_create(ilog2(sizeof(struct paace)), -1);
>  	if (!spaace_pool) {
>  		ret = -ENOMEM;
> -		dev_err(dev, "PAMU : failed to allocate spaace gen pool\n");
> +		dev_err(dev, "Failed to allocate spaace gen pool\n");
>  		goto error;
>  	}
> 
> diff --git a/drivers/iommu/fsl_pamu_domain.c
> b/drivers/iommu/fsl_pamu_domain.c index c7af760..3e7954a 100644
> --- a/drivers/iommu/fsl_pamu_domain.c
> +++ b/drivers/iommu/fsl_pamu_domain.c
> @@ -113,7 +113,7 @@ static int map_subwins(int liodn, struct
> fsl_dma_domain *dma_domain)
>  						 sub_win_ptr[i].prot);
>  			spin_unlock_irqrestore(&iommu_lock, flags);
>  			if (ret) {
> -				pr_debug("PAMU SPAACE configuration
> failed for liodn %d\n",
> +				pr_debug("SPAACE configuration failed for
> liodn %d\n",
>  					 liodn);
>  				return ret;
>  			}
> @@ -139,7 +139,7 @@ static int map_win(int liodn, struct fsl_dma_domain
> *dma_domain)
>  				 0, wnd->prot);
>  	spin_unlock_irqrestore(&iommu_lock, flags);
>  	if (ret)
> -		pr_debug("PAMU PAACE configuration failed for liodn
> %d\n",
> +		pr_debug("PAACE configuration failed for liodn %d\n",
>  			liodn);
> 
>  	return ret;
> @@ -250,7 +250,7 @@ static int pamu_set_liodn(int liodn, struct device
> *dev,
>  					 dma_domain->stash_id, win_cnt, 0);
>  	spin_unlock_irqrestore(&iommu_lock, flags);
>  	if (ret) {
> -		pr_debug("PAMU PAACE configuration failed for liodn %d,
> win_cnt =%d\n", liodn, win_cnt);
> +		pr_debug("PAACE configuration failed for liodn %d, win_cnt
> =%d\n",
> +liodn, win_cnt);
>  		return ret;
>  	}
> 
> @@ -267,7 +267,7 @@ static int pamu_set_liodn(int liodn, struct device
> *dev,
>  							 0, 0);
>  			spin_unlock_irqrestore(&iommu_lock, flags);
>  			if (ret) {
> -				pr_debug("PAMU SPAACE configuration
> failed for liodn %d\n", liodn);
> +				pr_debug("SPAACE configuration failed for
> liodn %d\n", liodn);
>  				return ret;
>  			}
>  		}
> @@ -283,13 +283,13 @@ static int check_size(u64 size, dma_addr_t iova)
>  	 * to PAMU page size.
>  	 */
>  	if ((size & (size - 1)) || size < PAMU_PAGE_SIZE) {
> -		pr_debug("%s: size too small or not a power of two\n",
> __func__);
> +		pr_debug("Size too small or not a power of two\n");
>  		return -EINVAL;
>  	}
> 
>  	/* iova must be page size aligned*/
>  	if (iova & (size - 1)) {
> -		pr_debug("%s: address is not aligned with window size\n",
> __func__);
> +		pr_debug("Address is not aligned with window size\n");
>  		return -EINVAL;
>  	}
> 
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
       [not found]             ` <54CB2AEC.9000800-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  9:20               ` Varun Sethi
       [not found]                 ` <BN3PR0301MB1219965593D06F96A8A1ADB8EA310-CEkquS/Gb81uuip9JPHoc5wN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
  0 siblings, 1 reply; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  9:20 UTC (permalink / raw)
  To: Emilian Medve, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM

Hi Emil,

> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Friday, January 30, 2015 12:26 PM
> To: Sethi Varun-B16395; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org;
> joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org
> Subject: Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
> 
> Hello Varun,
> 
> 
> On 01/30/2015 12:46 AM, Sethi Varun-B16395 wrote:
> > Hi Emil,
> >
> >> -----Original Message-----
> >> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> >> Sent: Wednesday, January 28, 2015 8:05 PM
> >> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org;
> >> jroedel-l3A5Bk7waGM@public.gmane.org; Sethi Varun-B16395
> >> Cc: Medve Emilian-EMMEDVE1
> >> Subject: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init*
> >> annotations
> >>
> >> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> >> ---
> >>  drivers/iommu/fsl_pamu.c        | 12 ++++++------
> >>  drivers/iommu/fsl_pamu_domain.c |  2 +-
> >>  2 files changed, 7 insertions(+), 7 deletions(-)
> >>
> >> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
> >> index d958e65..652c34d 100644
> >> --- a/drivers/iommu/fsl_pamu.c
> >> +++ b/drivers/iommu/fsl_pamu.c
> >> @@ -50,7 +50,7 @@ struct pamu_isr_data {
> >>
> >>  static struct paace *ppaact;
> >>  static struct paace *spaact;
> >> -static struct ome *omt;
> >> +static struct ome *omt __initdata;
> >
> > [varun] omt shouldn't be initdata.
> 
> It seems to be used only from probe()'s call tree: fsl_pamu_probe() and
> setup_omt(); both __init functions. Am I missing something?
> 
> 
Omt corresponds to PAMU operation mapping table, which is pointed to by the PAMU OMT base registers. We are using operation mapping table for operation translation.

-Varun

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 18/26] iommu/fsl: Fix checkpatch type PARENTHESIS_ALIGNMENT
       [not found]     ` <1422455698-3074-19-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  9:29       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  9:29 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 18/26] iommu/fsl: Fix checkpatch type
> PARENTHESIS_ALIGNMENT
> 
> 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,
> +                        PAACE_AP_PERMS_DENIED);
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +       set_bf(ppaace->addr_bitfields, PPAACE_AF_WSE,
> +               map_addrspace_size_to_wse(win_size));
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +                       pr_debug("can't find next-level-cache at %s\n",
> +                               node->full_name);
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +       out_be32((u32 *)(pamu_reg_base + PAMU_PICS),
> +                       PAMU_ACCESS_VIOLATION_ENABLE);
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +                       set_bf(ppaace->impl_attr, PAACE_IA_ATM,
> +                               PAACE_ATM_NO_XLATE);
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +                       set_bf(ppaace->addr_bitfields, PAACE_AF_AP,
> +                               PAACE_AP_PERMS_ALL);
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +                       pr_emerg("AVA=%016llx\n", make64(in_be32(p +
> PAMU_AVAH),
> +                               in_be32(p + PAMU_AVAL)));
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +                       pr_emerg("POEA=%016llx\n", make64(in_be32(p +
> PAMU_POEAH),
> +                               in_be32(p + PAMU_POEAL)));
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +                       phys = make64(in_be32(p + PAMU_POEAH),
> +                               in_be32(p + PAMU_POEAL));
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +               setup_one_pamu(pamu_reg_base, pamu_reg_off, ppaact_phys,
> +                                spaact_phys, omt_phys);
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +       fsl_pamu_domain_cache = kmem_cache_create("fsl_pamu_domain",
> +                                        sizeof(struct fsl_dma_domain),
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +       iommu_devinfo_cache = kmem_cache_create("iommu_devinfo",
> +                                        sizeof(struct
> + device_domain_info),
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +               pr_debug("PAACE configuration failed for liodn %d\n",
> +                       liodn);
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +static int update_liodn_stash(int liodn, struct fsl_dma_domain
> *dma_domain,
> +                                u32 val)
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +static int pamu_set_liodn(int liodn, struct device *dev,
> +                          struct fsl_dma_domain *dma_domain,
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +static phys_addr_t fsl_pamu_iova_to_phys(struct iommu_domain
> *domain,
> +                                           dma_addr_t iova)
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +       if ((iova < domain->geometry.aperture_start) ||
> +               iova > (domain->geometry.aperture_end))
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +               ret = pamu_set_liodn(info->liodn, info->dev, dma_domain,
> +                                     geom_attr, win_cnt);
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +static int handle_attach_device(struct fsl_dma_domain *dma_domain,
> +                                struct device *dev, const u32 *liodn,
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +                       pr_debug("Invalid liodn %d, attach device failed for %s\n",
> +                               liodn[i], dev->of_node->full_name);
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +                       ret = pamu_set_liodn(liodn[i], dev, dma_domain,
> +                                             &domain->geometry,
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +               ret = handle_attach_device(dma_domain, dev,
> +                                        liodn, liodn_cnt);
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +static void fsl_pamu_detach_device(struct iommu_domain *domain,
> +                                     struct device *dev)
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +       if (check_size(geom_size, geom_attr->aperture_start) ||
> +               !geom_attr->force_aperture) {
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +       memcpy(&dma_domain->dma_stash, stash_attr,
> +                sizeof(struct pamu_stash_attribute));
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +       list_for_each_entry(info, &dma_domain->devices,
> +                                link) {
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +static int fsl_pamu_set_domain_attr(struct iommu_domain *domain,
> +                                enum iommu_attr attr_type, void *data)
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +static int fsl_pamu_get_domain_attr(struct iommu_domain *domain,
> +                                enum iommu_attr attr_type, void *data)
> 
> CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open
> parenthesis
> +       ret = pamu_set_domain_geometry(dma_domain, &domain-
> >geometry,
> +                               ((w_count > 1) ? w_count : 0));
> 
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu.c        | 29 +++++++++---------
>  drivers/iommu/fsl_pamu_domain.c | 67 +++++++++++++++++++-------------
> ---------
>  2 files changed, 46 insertions(+), 50 deletions(-)
> 
> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index
> e46c75f..dc3955f 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -302,11 +302,10 @@ int pamu_disable_spaace(int liodn, u32 subwin)
>  		paace = pamu_get_spaace(paace, subwin - 1);
>  		if (!paace)
>  			return -ENOENT;
> -		set_bf(paace->addr_bitfields, PAACE_AF_V,
> -			 PAACE_V_INVALID);
> +		set_bf(paace->addr_bitfields, PAACE_AF_V,
> PAACE_V_INVALID);
>  	} else {
>  		set_bf(paace->addr_bitfields, PAACE_AF_AP,
> -			 PAACE_AP_PERMS_DENIED);
> +		       PAACE_AP_PERMS_DENIED);
>  	}
> 
>  	mb();
> @@ -354,7 +353,7 @@ int pamu_config_ppaace(int liodn, phys_addr_t
> win_addr, phys_addr_t win_size,
> 
>  	/* window size is 2^(WSE+1) bytes */
>  	set_bf(ppaace->addr_bitfields, PPAACE_AF_WSE,
> -		map_addrspace_size_to_wse(win_size));
> +	       map_addrspace_size_to_wse(win_size));
> 
>  	pamu_init_ppaace(ppaace);
> 
> @@ -568,7 +567,7 @@ found_cpu_node:
>  		prop = of_get_property(node, "next-level-cache", 0);
>  		if (!prop) {
>  			pr_debug("can't find next-level-cache at %s\n",
> -				node->full_name);
> +				 node->full_name);
>  			of_node_put(node);
>  			return ~(u32)0;  /* can't traverse any further */
>  		}
> @@ -712,7 +711,7 @@ static int __init setup_one_pamu(unsigned long
> pamu_reg_base, unsigned long pamu
>  	 */
> 
>  	out_be32((u32 *)(pamu_reg_base + PAMU_PICS),
> -			PAMU_ACCESS_VIOLATION_ENABLE);
> +		 PAMU_ACCESS_VIOLATION_ENABLE);
>  	out_be32(pc, PAMU_PC_PE | PAMU_PC_OCE | PAMU_PC_SPCC |
> PAMU_PC_PPCC);
>  	return 0;
>  }
> @@ -742,9 +741,9 @@ static void __init setup_liodns(void)
>  			ppaace->wbah = 0;
>  			set_bf(ppaace->addr_bitfields, PPAACE_AF_WBAL,
> 0);
>  			set_bf(ppaace->impl_attr, PAACE_IA_ATM,
> -				PAACE_ATM_NO_XLATE);
> +			       PAACE_ATM_NO_XLATE);
>  			set_bf(ppaace->addr_bitfields, PAACE_AF_AP,
> -				PAACE_AP_PERMS_ALL);
> +			       PAACE_AP_PERMS_ALL);
>  			if (of_device_is_compatible(node, "fsl,qman-
> portal"))
>  				setup_qbman_paace(ppaace,
> QMAN_PORTAL_PAACE);
>  			if (of_device_is_compatible(node, "fsl,qman")) @@ -
> 777,14 +776,16 @@ irqreturn_t pamu_av_isr(int irq, void *arg)
>  			pr_emerg("POES2=%08x\n", in_be32(p +
> PAMU_POES2));
>  			pr_emerg("AVS1=%08x\n", avs1);
>  			pr_emerg("AVS2=%08x\n", in_be32(p +
> PAMU_AVS2));
> -			pr_emerg("AVA=%016llx\n", make64(in_be32(p +
> PAMU_AVAH),
> -				in_be32(p + PAMU_AVAL)));
> +			pr_emerg("AVA=%016llx\n",
> +				 make64(in_be32(p + PAMU_AVAH),
> +					in_be32(p + PAMU_AVAL)));
>  			pr_emerg("UDAD=%08x\n", in_be32(p +
> PAMU_UDAD));
> -			pr_emerg("POEA=%016llx\n", make64(in_be32(p +
> PAMU_POEAH),
> -				in_be32(p + PAMU_POEAL)));
> +			pr_emerg("POEA=%016llx\n",
> +				 make64(in_be32(p + PAMU_POEAH),
> +					in_be32(p + PAMU_POEAL)));
> 
>  			phys = make64(in_be32(p + PAMU_POEAH),
> -				in_be32(p + PAMU_POEAL));
> +				      in_be32(p + PAMU_POEAL));
> 
>  			/* Assume that POEA points to a PAACE */
>  			if (phys) {
> @@ -1150,7 +1151,7 @@ static int __init fsl_pamu_probe(struct
> platform_device *pdev)
> 
>  		pamu_reg_base = (unsigned long)pamu_regs +
> pamu_reg_off;
>  		setup_one_pamu(pamu_reg_base, pamu_reg_off,
> ppaact_phys,
> -				 spaact_phys, omt_phys);
> +			       spaact_phys, omt_phys);
>  		/* Disable PAMU bypass for this PAMU */
>  		pamubypenr &= ~pamu_counter;
>  	}
> diff --git a/drivers/iommu/fsl_pamu_domain.c
> b/drivers/iommu/fsl_pamu_domain.c index 3e7954a..51a6750 100644
> --- a/drivers/iommu/fsl_pamu_domain.c
> +++ b/drivers/iommu/fsl_pamu_domain.c
> @@ -36,21 +36,20 @@ static DEFINE_SPINLOCK(device_domain_lock);
>  static int __init iommu_init_mempool(void)  {
>  	fsl_pamu_domain_cache =
> kmem_cache_create("fsl_pamu_domain",
> -					 sizeof(struct fsl_dma_domain),
> -					 0,
> -					 SLAB_HWCACHE_ALIGN,
> -
> -					 NULL);
> +						  sizeof(struct
> fsl_dma_domain),
> +						  0,
> +						  SLAB_HWCACHE_ALIGN,
> +						  NULL);
>  	if (!fsl_pamu_domain_cache) {
>  		pr_debug("Couldn't create fsl iommu_domain cache\n");
>  		return -ENOMEM;
>  	}
> 
>  	iommu_devinfo_cache = kmem_cache_create("iommu_devinfo",
> -					 sizeof(struct device_domain_info),
> -					 0,
> -					 SLAB_HWCACHE_ALIGN,
> -					 NULL);
> +						sizeof(struct
> device_domain_info),
> +						0,
> +						SLAB_HWCACHE_ALIGN,
> +						NULL);
>  	if (!iommu_devinfo_cache) {
>  		pr_debug("Couldn't create devinfo cache\n");
>  		kmem_cache_destroy(fsl_pamu_domain_cache);
> @@ -139,8 +138,7 @@ static int map_win(int liodn, struct fsl_dma_domain
> *dma_domain)
>  				 0, wnd->prot);
>  	spin_unlock_irqrestore(&iommu_lock, flags);
>  	if (ret)
> -		pr_debug("PAACE configuration failed for liodn %d\n",
> -			liodn);
> +		pr_debug("PAACE configuration failed for liodn %d\n",
> liodn);
> 
>  	return ret;
>  }
> @@ -194,7 +192,7 @@ static int update_liodn(int liodn, struct
> fsl_dma_domain *dma_domain, u32 wnd_nr  }
> 
>  static int update_liodn_stash(int liodn, struct fsl_dma_domain
> *dma_domain,
> -				 u32 val)
> +			      u32 val)
>  {
>  	int ret = 0, i;
>  	unsigned long flags;
> @@ -222,9 +220,9 @@ static int update_liodn_stash(int liodn, struct
> fsl_dma_domain *dma_domain,
> 
>  /* Set the geometry parameters for a LIODN */  static int
> pamu_set_liodn(int liodn, struct device *dev,
> -			   struct fsl_dma_domain *dma_domain,
> -			   struct iommu_domain_geometry *geom_attr,
> -			   u32 win_cnt)
> +			  struct fsl_dma_domain *dma_domain,
> +			  struct iommu_domain_geometry *geom_attr,
> +			  u32 win_cnt)
>  {
>  	phys_addr_t window_addr, window_size;
>  	phys_addr_t subwin_size;
> @@ -381,12 +379,12 @@ static void attach_device(struct fsl_dma_domain
> *dma_domain, int liodn, struct d  }
> 
>  static phys_addr_t fsl_pamu_iova_to_phys(struct iommu_domain *domain,
> -					    dma_addr_t iova)
> +					 dma_addr_t iova)
>  {
>  	struct fsl_dma_domain *dma_domain = domain->priv;
> 
>  	if ((iova < domain->geometry.aperture_start) ||
> -		iova > (domain->geometry.aperture_end))
> +	    iova > (domain->geometry.aperture_end))
>  		return 0;
> 
>  	return get_phys_addr(dma_domain, iova); @@ -441,7 +439,7 @@
> static int pamu_set_domain_geometry(struct fsl_dma_domain
> *dma_domain,
> 
>  	list_for_each_entry(info, &dma_domain->devices, link) {
>  		ret = pamu_set_liodn(info->liodn, info->dev, dma_domain,
> -				      geom_attr, win_cnt);
> +				     geom_attr, win_cnt);
>  		if (ret)
>  			break;
>  	}
> @@ -602,8 +600,8 @@ static int fsl_pamu_window_enable(struct
> iommu_domain *domain, u32 wnd_nr,
>   * and window mappings.
>   */
>  static int handle_attach_device(struct fsl_dma_domain *dma_domain,
> -				 struct device *dev, const u32 *liodn,
> -				 int num)
> +				struct device *dev, const u32 *liodn,
> +				int num)
>  {
>  	unsigned long flags;
>  	struct iommu_domain *domain = dma_domain->iommu_domain;
> @@ -615,7 +613,7 @@ static int handle_attach_device(struct
> fsl_dma_domain *dma_domain,
>  		/* Ensure that LIODN value is valid */
>  		if (liodn[i] >= PAACE_NUMBER_ENTRIES) {
>  			pr_debug("Invalid liodn %d, attach device failed for
> %s\n",
> -				liodn[i], dev->of_node->full_name);
> +				 liodn[i], dev->of_node->full_name);
>  			ret = -EINVAL;
>  			break;
>  		}
> @@ -630,8 +628,7 @@ static int handle_attach_device(struct
> fsl_dma_domain *dma_domain,
>  			u32 win_cnt = dma_domain->win_cnt > 1 ?
> dma_domain->win_cnt : 0;
> 
>  			ret = pamu_set_liodn(liodn[i], dev, dma_domain,
> -					      &domain->geometry,
> -					      win_cnt);
> +					     &domain->geometry, win_cnt);
>  			if (ret)
>  				break;
>  			if (dma_domain->mapped) {
> @@ -678,8 +675,7 @@ static int fsl_pamu_attach_device(struct
> iommu_domain *domain,
>  	liodn = of_get_property(dev->of_node, "fsl,liodn", &len);
>  	if (liodn) {
>  		liodn_cnt = len / sizeof(u32);
> -		ret = handle_attach_device(dma_domain, dev,
> -					 liodn, liodn_cnt);
> +		ret = handle_attach_device(dma_domain, dev, liodn,
> liodn_cnt);
>  	} else {
>  		pr_debug("missing fsl,liodn property at %s\n",
>  			 dev->of_node->full_name);
> @@ -690,7 +686,7 @@ static int fsl_pamu_attach_device(struct
> iommu_domain *domain,  }
> 
>  static void fsl_pamu_detach_device(struct iommu_domain *domain,
> -				      struct device *dev)
> +				   struct device *dev)
>  {
>  	struct fsl_dma_domain *dma_domain = domain->priv;
>  	const u32 *prop;
> @@ -734,10 +730,10 @@ static  int configure_domain_geometry(struct
> iommu_domain *domain, void *data)
>  	 * DMA outside of the geometry.
>  	 */
>  	if (check_size(geom_size, geom_attr->aperture_start) ||
> -		!geom_attr->force_aperture) {
> -			pr_debug("Invalid PAMU geometry attributes\n");
> -			return -EINVAL;
> -		}
> +	    !geom_attr->force_aperture) {
> +		pr_debug("Invalid PAMU geometry attributes\n");
> +		return -EINVAL;
> +	}
> 
>  	spin_lock_irqsave(&dma_domain->domain_lock, flags);
>  	if (dma_domain->enabled) {
> @@ -766,7 +762,7 @@ static int configure_domain_stash(struct
> fsl_dma_domain *dma_domain, void *data)
>  	spin_lock_irqsave(&dma_domain->domain_lock, flags);
> 
>  	memcpy(&dma_domain->dma_stash, stash_attr,
> -		 sizeof(struct pamu_stash_attribute));
> +	       sizeof(struct pamu_stash_attribute));
> 
>  	dma_domain->stash_id = get_stash_id(stash_attr->cache,
>  					    stash_attr->cpu);
> @@ -799,8 +795,7 @@ static int configure_domain_dma_state(struct
> fsl_dma_domain *dma_domain, bool en
>  	}
> 
>  	dma_domain->enabled = enable;
> -	list_for_each_entry(info, &dma_domain->devices,
> -				 link) {
> +	list_for_each_entry(info, &dma_domain->devices, link) {
>  		ret = (enable) ? pamu_enable_liodn(info->liodn) :
>  			pamu_disable_liodn(info->liodn);
>  		if (ret)
> @@ -813,7 +808,7 @@ static int configure_domain_dma_state(struct
> fsl_dma_domain *dma_domain, bool en  }
> 
>  static int fsl_pamu_set_domain_attr(struct iommu_domain *domain,
> -				 enum iommu_attr attr_type, void *data)
> +				    enum iommu_attr attr_type, void *data)
>  {
>  	struct fsl_dma_domain *dma_domain = domain->priv;
>  	int ret = 0;
> @@ -838,7 +833,7 @@ static int fsl_pamu_set_domain_attr(struct
> iommu_domain *domain,  }
> 
>  static int fsl_pamu_get_domain_attr(struct iommu_domain *domain,
> -				 enum iommu_attr attr_type, void *data)
> +				    enum iommu_attr attr_type, void *data)
>  {
>  	struct fsl_dma_domain *dma_domain = domain->priv;
>  	int ret = 0;
> @@ -1034,7 +1029,7 @@ static int fsl_pamu_set_windows(struct
> iommu_domain *domain, u32 w_count)
>  	}
> 
>  	ret = pamu_set_domain_geometry(dma_domain, &domain-
> >geometry,
> -				((w_count > 1) ? w_count : 0));
> +				       ((w_count > 1) ? w_count : 0));
>  	if (!ret) {
>  		kfree(dma_domain->win_arr);
>  		dma_domain->win_arr = kcalloc(w_count,
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 19/26] iommu/fsl: Fix some comments alignment
       [not found]     ` <1422455698-3074-20-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  9:30       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  9:30 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 19/26] iommu/fsl: Fix some comments alignment
> 
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  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
> dc3955f..ba5d1e0 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -35,7 +35,7 @@
>  #define make64(high, low) (((u64)(high) << 32) | (low))
> 
>  struct pamu_isr_data {
> -	void __iomem *pamu_reg_base;	/* Base address of PAMU
> regs*/
> +	void __iomem *pamu_reg_base;	/* Base address of PAMU
> regs */
>  	unsigned int count;		/* The number of PAMUs */
>  };
> 
> @@ -49,7 +49,7 @@ static struct ome *omt __initdata;
>   * "fsl,qoriq-device-config-2.0" corresponds to T4 & B4
>   * SOCs. For the older SOCs "fsl,qoriq-device-config-1.0"
>   * string would be used.
> -*/
> + */
>  static const struct of_device_id guts_device_ids[] __initconst = {
>  	{ .compatible = "fsl,qoriq-device-config-1.0", },
>  	{ .compatible = "fsl,qoriq-device-config-2.0", }, @@ -63,7 +63,7 @@
> static const struct of_device_id guts_device_ids[] __initconst = {
>   * "fsl,b4860-l3-cache-controller" corresponds to B4 &
>   * "fsl,p4080-l3-cache-controller" corresponds to other,
>   * SOCs.
> -*/
> + */
>  static const struct of_device_id l3_device_ids[] = {
>  	{ .compatible = "fsl,t4240-l3-cache-controller", },
>  	{ .compatible = "fsl,b4860-l3-cache-controller", }, @@ -231,7 +231,7
> @@ static struct paace *pamu_get_spaace(struct paace *paace, u32 wnum)
>   * If no SPAACE entry is available or the allocator can not reserve the
> required
>   * number of contiguous entries function returns ULONG_MAX indicating a
> failure.
>   *
> -*/
> + */
>  static unsigned long pamu_get_fspi_and_allocate(u32 subwin_cnt)  {
>  	unsigned long spaace_addr;
> @@ -494,11 +494,11 @@ int pamu_config_spaace(int liodn, u32 subwin_cnt,
> u32 subwin,  }
> 
>  /**
> -* get_ome_index() - Returns the index in the operation mapping table
> -*                   for device.
> -* @*omi_index: pointer for storing the index value
> -*
> -*/
> + * get_ome_index() - Returns the index in the operation mapping table
> + *                   for device.
> + * @*omi_index: pointer for storing the index value
> + *
> + */
>  void get_ome_index(u32 *omi_index, struct device *dev)  {
>  	if (of_device_is_compatible(dev->of_node, "fsl,qman-portal")) @@
> -610,7 +610,7 @@ static void __init setup_qbman_paace(struct paace
> *ppaace, int  paace_type)
>  	case QMAN_PORTAL_PAACE:
>  		set_bf(ppaace->impl_attr, PAACE_IA_OTM,
> PAACE_OTM_INDEXED);
>  		ppaace->op_encode.index_ot.omi = OMI_QMAN;
> -		/*Set DQRR and Frame stashing for the L3 cache */
> +		/* Set DQRR and Frame stashing for the L3 cache */
>  		set_bf(ppaace->impl_attr, PAACE_IA_CID,
> get_stash_id(PAMU_ATTR_CACHE_L3, 0));
>  		break;
>  	case BMAN_PAACE:
> @@ -937,7 +937,7 @@ static int __init create_csd(phys_addr_t phys, size_t
> size, u32 csd_port_id)
>  	}
> 
>  	if (i == 0 || i == num_laws) {
> -		/* This should never happen*/
> +		/* This should never happen */
>  		ret = -ENOENT;
>  		goto error;
>  	}
> @@ -1163,7 +1163,7 @@ static int __init fsl_pamu_probe(struct
> platform_device *pdev)
> 
>  	iounmap(guts_regs);
> 
> -	/* Enable DMA for the LIODNs in the device tree*/
> +	/* Enable DMA for the LIODNs in the device tree */
> 
>  	setup_liodns();
> 
> diff --git a/drivers/iommu/fsl_pamu_domain.c
> b/drivers/iommu/fsl_pamu_domain.c index 51a6750..eea2212 100644
> --- a/drivers/iommu/fsl_pamu_domain.c
> +++ b/drivers/iommu/fsl_pamu_domain.c
> @@ -285,7 +285,7 @@ static int check_size(u64 size, dma_addr_t iova)
>  		return -EINVAL;
>  	}
> 
> -	/* iova must be page size aligned*/
> +	/* iova must be page size aligned */
>  	if (iova & (size - 1)) {
>  		pr_debug("Address is not aligned with window size\n");
>  		return -EINVAL;
> @@ -779,7 +779,7 @@ static int configure_domain_stash(struct
> fsl_dma_domain *dma_domain, void *data)
>  	return ret;
>  }
> 
> -/* Configure domain dma state i.e. enable/disable DMA*/
> +/* Configure domain dma state i.e. enable/disable DMA */
>  static int configure_domain_dma_state(struct fsl_dma_domain
> *dma_domain, bool enable)  {
>  	struct device_domain_info *info;
> @@ -876,7 +876,7 @@ static  bool check_pci_ctl_endpt_part(struct
> pci_controller *pci_ctl)
>  	/* Check the PCI controller version number by readding BRR1 register
> */
>  	version = in_be32(pci_ctl->cfg_addr + (PCI_FSL_BRR1 >> 2));
>  	version &= PCI_FSL_BRR1_VER;
> -	/* If PCI controller version is >= 0x204 we can partition endpoints*/
> +	/* If PCI controller version is >= 0x204 we can partition endpoints */
>  	if (version >= 0x204)
>  		return 1;
> 
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 20/26] iommu/fsl: Fix alignment of some stray lines
       [not found]     ` <1422455698-3074-21-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  9:31       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  9:31 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 20/26] iommu/fsl: Fix alignment of some stray lines
> 
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  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 100644
> --- a/drivers/iommu/fsl_pamu.h
> +++ b/drivers/iommu/fsl_pamu.h
> @@ -67,7 +67,7 @@ struct pamu_mmap_regs {
>  #define PAMU_AVS1_GCV   0x2000
>  #define PAMU_AVS1_PDV   0x4000
>  #define PAMU_AV_MASK    (PAMU_AVS1_AV | PAMU_AVS1_OTV |
> PAMU_AVS1_APV | PAMU_AVS1_WAV \
> -			| PAMU_AVS1_LAV | PAMU_AVS1_GCV |
> PAMU_AVS1_PDV)
> +			 | PAMU_AVS1_LAV | PAMU_AVS1_GCV |
> PAMU_AVS1_PDV)
>  #define PAMU_AVS1_LIODN_SHIFT 16
>  #define PAMU_LAV_LIODN_NOT_IN_PPAACT 0x400
> 
> diff --git a/drivers/iommu/fsl_pamu_domain.c
> b/drivers/iommu/fsl_pamu_domain.c index eea2212..ae21305 100644
> --- a/drivers/iommu/fsl_pamu_domain.c
> +++ b/drivers/iommu/fsl_pamu_domain.c
> @@ -62,8 +62,7 @@ static int __init iommu_init_mempool(void)  static
> phys_addr_t get_phys_addr(struct fsl_dma_domain *dma_domain,
> dma_addr_t iova)  {
>  	u32 win_cnt = dma_domain->win_cnt;
> -	struct dma_window *win_ptr =
> -				&dma_domain->win_arr[0];
> +	struct dma_window *win_ptr = &dma_domain->win_arr[0];
>  	struct iommu_domain_geometry *geom;
> 
>  	geom = &dma_domain->iommu_domain->geometry;
> @@ -92,15 +91,13 @@ static phys_addr_t get_phys_addr(struct
> fsl_dma_domain *dma_domain, dma_addr_t i
> 
>  static int map_subwins(int liodn, struct fsl_dma_domain *dma_domain)  {
> -	struct dma_window *sub_win_ptr =
> -				&dma_domain->win_arr[0];
> +	struct dma_window *sub_win_ptr = &dma_domain->win_arr[0];
>  	int i, ret;
>  	unsigned long rpn, flags;
> 
>  	for (i = 0; i < dma_domain->win_cnt; i++) {
>  		if (sub_win_ptr[i].valid) {
> -			rpn = sub_win_ptr[i].paddr >>
> -				 PAMU_PAGE_SHIFT;
> +			rpn = sub_win_ptr[i].paddr >> PAMU_PAGE_SHIFT;
>  			spin_lock_irqsave(&iommu_lock, flags);
>  			ret = pamu_config_spaace(liodn, dma_domain-
> >win_cnt, i,
>  						 sub_win_ptr[i].size,
> @@ -180,8 +177,8 @@ static int update_liodn(int liodn, struct
> fsl_dma_domain *dma_domain, u32 wnd_nr
>  					 wnd->size,
>  					 ~(u32)0,
>  					 wnd->paddr >> PAMU_PAGE_SHIFT,
> -					dma_domain->snoop_id,
> dma_domain->stash_id,
> -					0, wnd->prot);
> +					 dma_domain->snoop_id,
> dma_domain->stash_id,
> +					 0, wnd->prot);
>  		if (ret)
>  			pr_debug("Window reconfiguration failed for liodn
> %d\n", liodn);
>  	}
> @@ -679,7 +676,7 @@ static int fsl_pamu_attach_device(struct
> iommu_domain *domain,
>  	} else {
>  		pr_debug("missing fsl,liodn property at %s\n",
>  			 dev->of_node->full_name);
> -			ret = -EINVAL;
> +		ret = -EINVAL;
>  	}
> 
>  	return ret;
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 21/26] iommu/fsl: Fix checkpatch type LONG_LINE
       [not found]     ` <1422455698-3074-22-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  9:32       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  9:32 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 21/26] iommu/fsl: Fix checkpatch type LONG_LINE
> 
> Only pr_*() here
> 
> WARNING:LONG_LINE: line over 80 characters
> +		pr_debug("window size too small or not a power of two
> %pa\n",
> +&win_size);
> 
> WARNING:LONG_LINE: line over 80 characters
> +				pr_debug("missing cache-stash-id at %s\n",
> node->full_name);
> 
> ARNING:LONG_LINE: line over 80 characters
> +				pr_debug("missing cache-stash-id at %s\n",
> node->full_name);
> 
> WARNING:LONG_LINE: line over 80 characters
> +					pr_emerg("PAACE[%u]=%08x\n", j,
> in_be32(paace + j));
> 
> WARNING:LONG_LINE: line over 80 characters
> +				pr_emerg("Disabling liodn %x\n", avs1 >>
> PAMU_AVS1_LIODN_SHIFT);
> 
> WARNING:LONG_LINE: line over 80 characters
> +			pr_debug("Subwindow reconfiguration failed for
> liodn %d\n", liodn);
> 
> WARNING:LONG_LINE: line over 80 characters
> +			pr_debug("Window reconfiguration failed for liodn
> %d\n", liodn);
> 
> WARNING:LONG_LINE: line over 80 characters
> +		pr_debug("Windows not configured, stash destination
> update failed for
> +liodn %d\n", liodn);
> 
> WARNING:LONG_LINE: line over 80 characters
> +			pr_debug("Failed to update SPAACE %d field for
> liodn %d\n ", i,
> +liodn);
> 
> WARNING:LONG_LINE: line over 80 characters
> +		pr_debug("PAACE configuration failed for liodn %d, win_cnt
> =%d\n",
> +liodn, win_cnt);
> 
> WARNING:LONG_LINE: line over 80 characters
> +				pr_debug("SPAACE configuration failed for
> liodn %d\n", liodn);
> 
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu.c        | 15 ++++++++++-----
>  drivers/iommu/fsl_pamu_domain.c | 18 ++++++++++++------
>  2 files changed, 22 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index
> ba5d1e0..3f83259 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -338,7 +338,8 @@ int pamu_config_ppaace(int liodn, phys_addr_t
> win_addr, phys_addr_t win_size,
>  	unsigned long fspi;
> 
>  	if ((win_size & (win_size - 1)) || win_size < PAMU_PAGE_SIZE) {
> -		pr_debug("window size too small or not a power of two
> %pa\n", &win_size);
> +		pr_debug("window size too small or not a power of two
> %pa\n",
> +			 &win_size);
>  		return -EINVAL;
>  	}
> 
> @@ -530,7 +531,8 @@ u32 get_stash_id(u32 stash_dest_hint, u32 vcpu)
>  		if (node) {
>  			prop = of_get_property(node, "cache-stash-id", 0);
>  			if (!prop) {
> -				pr_debug("missing cache-stash-id at %s\n",
> node->full_name);
> +				pr_debug("missing cache-stash-id at %s\n",
> +					 node->full_name);
>  				of_node_put(node);
>  				return ~(u32)0;
>  			}
> @@ -556,7 +558,8 @@ found_cpu_node:
>  		if (stash_dest_hint == cache_level) {
>  			prop = of_get_property(node, "cache-stash-id", 0);
>  			if (!prop) {
> -				pr_debug("missing cache-stash-id at %s\n",
> node->full_name);
> +				pr_debug("missing cache-stash-id at %s\n",
> +					 node->full_name);
>  				of_node_put(node);
>  				return ~(u32)0;
>  			}
> @@ -793,7 +796,8 @@ irqreturn_t pamu_av_isr(int irq, void *arg)
> 
>  				/* Only the first four words are relevant */
>  				for (j = 0; j < 4; j++)
> -					pr_emerg("PAACE[%u]=%08x\n", j,
> in_be32(paace + j));
> +					pr_emerg("PAACE[%u]=%08x\n",
> +						 j, in_be32(paace + j));
>  			}
> 
>  			/* clear access violation condition */ @@ -813,7
> +817,8 @@ irqreturn_t pamu_av_isr(int irq, void *arg)
>  				/* Disable the LIODN */
>  				ret = pamu_disable_liodn(avs1 >>
> PAMU_AVS1_LIODN_SHIFT);
>  				BUG_ON(ret);
> -				pr_emerg("Disabling liodn %x\n", avs1 >>
> PAMU_AVS1_LIODN_SHIFT);
> +				pr_emerg("Disabling liodn %x\n",
> +					 avs1 >> PAMU_AVS1_LIODN_SHIFT);
>  			}
>  			out_be32((p + PAMU_PICS), pics);
>  		}
> diff --git a/drivers/iommu/fsl_pamu_domain.c
> b/drivers/iommu/fsl_pamu_domain.c index ae21305..38c26be 100644
> --- a/drivers/iommu/fsl_pamu_domain.c
> +++ b/drivers/iommu/fsl_pamu_domain.c
> @@ -167,7 +167,8 @@ static int update_liodn(int liodn, struct
> fsl_dma_domain *dma_domain, u32 wnd_nr
>  					 (wnd_nr > 0) ? 1 : 0,
>  					 wnd->prot);
>  		if (ret)
> -			pr_debug("Subwindow reconfiguration failed for
> liodn %d\n", liodn);
> +			pr_debug("Subwindow reconfiguration failed for
> liodn %d\n",
> +				 liodn);
>  	} else {
>  		phys_addr_t wnd_addr;
> 
> @@ -180,7 +181,8 @@ static int update_liodn(int liodn, struct
> fsl_dma_domain *dma_domain, u32 wnd_nr
>  					 dma_domain->snoop_id,
> dma_domain->stash_id,
>  					 0, wnd->prot);
>  		if (ret)
> -			pr_debug("Window reconfiguration failed for liodn
> %d\n", liodn);
> +			pr_debug("Window reconfiguration failed for liodn
> %d\n",
> +				 liodn);
>  	}
> 
>  	spin_unlock_irqrestore(&iommu_lock, flags); @@ -196,7 +198,8 @@
> static int update_liodn_stash(int liodn, struct fsl_dma_domain
> *dma_domain,
> 
>  	spin_lock_irqsave(&iommu_lock, flags);
>  	if (!dma_domain->win_arr) {
> -		pr_debug("Windows not configured, stash destination
> update failed for liodn %d\n", liodn);
> +		pr_debug("Windows not configured, stash destination
> update failed for liodn %d\n",
> +			 liodn);
>  		spin_unlock_irqrestore(&iommu_lock, flags);
>  		return -EINVAL;
>  	}
> @@ -204,7 +207,8 @@ static int update_liodn_stash(int liodn, struct
> fsl_dma_domain *dma_domain,
>  	for (i = 0; i < dma_domain->win_cnt; i++) {
>  		ret = pamu_update_paace_stash(liodn, i, val);
>  		if (ret) {
> -			pr_debug("Failed to update SPAACE %d field for
> liodn %d\n ", i, liodn);
> +			pr_debug("Failed to update SPAACE %d field for
> liodn %d\n ",
> +				 i, liodn);
>  			spin_unlock_irqrestore(&iommu_lock, flags);
>  			return ret;
>  		}
> @@ -245,7 +249,8 @@ static int pamu_set_liodn(int liodn, struct device
> *dev,
>  					 dma_domain->stash_id, win_cnt, 0);
>  	spin_unlock_irqrestore(&iommu_lock, flags);
>  	if (ret) {
> -		pr_debug("PAACE configuration failed for liodn %d, win_cnt
> =%d\n", liodn, win_cnt);
> +		pr_debug("PAACE configuration failed for liodn %d, win_cnt
> =%d\n",
> +			 liodn, win_cnt);
>  		return ret;
>  	}
> 
> @@ -262,7 +267,8 @@ static int pamu_set_liodn(int liodn, struct device
> *dev,
>  							 0, 0);
>  			spin_unlock_irqrestore(&iommu_lock, flags);
>  			if (ret) {
> -				pr_debug("SPAACE configuration failed for
> liodn %d\n", liodn);
> +				pr_debug("SPAACE configuration failed for
> liodn %d\n",
> +					 liodn);
>  				return ret;
>  			}
>  		}
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 22/26] iommu/fsl: Make local symbols static
       [not found]     ` <1422455698-3074-23-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  9:33       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  9:33 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 22/26] iommu/fsl: Make local symbols static
> 
> 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.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index
> 3f83259..1d9273a 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -75,7 +75,7 @@ static const struct of_device_id l3_device_ids[] = {  static
> u32 max_subwindow_count;
> 
>  /* Pool for fspi allocation */
> -struct gen_pool *spaace_pool;
> +static struct gen_pool *spaace_pool;
> 
>  /**
>   * pamu_get_max_subwin_cnt() - Return the maximum supported @@ -
> 759,7 +759,7 @@ static void __init setup_liodns(void)
>  	}
>  }
> 
> -irqreturn_t pamu_av_isr(int irq, void *arg)
> +static irqreturn_t pamu_av_isr(int irq, void *arg)
>  {
>  	struct pamu_isr_data *data = arg;
>  	phys_addr_t phys;
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 23/26] iommu/fsl: Use NULL instead of zero
       [not found]     ` <1422455698-3074-24-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  9:33       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  9:33 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 23/26] iommu/fsl: Use NULL instead of zero
> 
> 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.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index
> 1d9273a..7a4665d 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -529,7 +529,7 @@ u32 get_stash_id(u32 stash_dest_hint, u32 vcpu)
>  	if (stash_dest_hint == PAMU_ATTR_CACHE_L3) {
>  		node = of_find_matching_node(NULL, l3_device_ids);
>  		if (node) {
> -			prop = of_get_property(node, "cache-stash-id", 0);
> +			prop = of_get_property(node, "cache-stash-id",
> NULL);
>  			if (!prop) {
>  				pr_debug("missing cache-stash-id at %s\n",
>  					 node->full_name);
> @@ -556,7 +556,7 @@ found_cpu_node:
>  	/* find the hwnode that represents the cache */
>  	for (cache_level = PAMU_ATTR_CACHE_L1; (cache_level <
> PAMU_ATTR_CACHE_L3) && found; cache_level++) {
>  		if (stash_dest_hint == cache_level) {
> -			prop = of_get_property(node, "cache-stash-id", 0);
> +			prop = of_get_property(node, "cache-stash-id",
> NULL);
>  			if (!prop) {
>  				pr_debug("missing cache-stash-id at %s\n",
>  					 node->full_name);
> @@ -567,7 +567,7 @@ found_cpu_node:
>  			return be32_to_cpup(prop);
>  		}
> 
> -		prop = of_get_property(node, "next-level-cache", 0);
> +		prop = of_get_property(node, "next-level-cache", NULL);
>  		if (!prop) {
>  			pr_debug("can't find next-level-cache at %s\n",
>  				 node->full_name);
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 24/26] iommu/fsl: Remove unneeded semicolon
       [not found]     ` <1422455698-3074-25-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  9:34       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  9:34 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 24/26] iommu/fsl: Remove unneeded semicolon
> 
> 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.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu_domain.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iommu/fsl_pamu_domain.c
> b/drivers/iommu/fsl_pamu_domain.c index 38c26be..ebbc396 100644
> --- a/drivers/iommu/fsl_pamu_domain.c
> +++ b/drivers/iommu/fsl_pamu_domain.c
> @@ -830,7 +830,7 @@ static int fsl_pamu_set_domain_attr(struct
> iommu_domain *domain,
>  		pr_debug("Unsupported attribute type\n");
>  		ret = -EINVAL;
>  		break;
> -	};
> +	}
> 
>  	return ret;
>  }
> @@ -856,7 +856,7 @@ static int fsl_pamu_get_domain_attr(struct
> iommu_domain *domain,
>  		pr_debug("Unsupported attribute type\n");
>  		ret = -EINVAL;
>  		break;
> -	};
> +	}
> 
>  	return ret;
>  }
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 25/26] iommu/fsl: Don't use integers values with bool type
       [not found]     ` <1422455698-3074-26-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  9:35       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  9:35 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 25/26] iommu/fsl: Don't use integers values with bool type
> 
> drivers/iommu/fsl_pamu_domain.c:884:9-10: WARNING: return of 0/1 in
> function 'check_pci_ctl_endpt_part' with return type bool
> 
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu_domain.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/iommu/fsl_pamu_domain.c
> b/drivers/iommu/fsl_pamu_domain.c index ebbc396..36622e2 100644
> --- a/drivers/iommu/fsl_pamu_domain.c
> +++ b/drivers/iommu/fsl_pamu_domain.c
> @@ -880,10 +880,7 @@ static  bool check_pci_ctl_endpt_part(struct
> pci_controller *pci_ctl)
>  	version = in_be32(pci_ctl->cfg_addr + (PCI_FSL_BRR1 >> 2));
>  	version &= PCI_FSL_BRR1_VER;
>  	/* If PCI controller version is >= 0x204 we can partition endpoints */
> -	if (version >= 0x204)
> -		return 1;
> -
> -	return 0;
> +	return version >= 0x204;
>  }
> 
>  /* Get iommu group information from peer devices or devices on the parent
> bus */
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 26/26] iommu/fsl: Remove extra paranthesis
       [not found]     ` <1422455698-3074-27-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  9:40       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  9:40 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve



> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 26/26] iommu/fsl: Remove extra paranthesis
> 
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  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 b/drivers/iommu/fsl_pamu.c index
> 7a4665d..ea49d9f 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -160,7 +160,7 @@ int pamu_disable_liodn(int liodn)  static unsigned int
> map_addrspace_size_to_wse(phys_addr_t addrspace_size)  {
>  	/* Bug if not a power of 2 */
> -	BUG_ON((addrspace_size & (addrspace_size - 1)));
> +	BUG_ON(addrspace_size & (addrspace_size - 1));
> 
>  	/* window size is 2^(WSE+1) bytes */
>  	return fls64(addrspace_size) - 2;
> @@ -801,7 +801,7 @@ static irqreturn_t pamu_av_isr(int irq, void *arg)
>  			}
> 
>  			/* clear access violation condition */
> -			out_be32((p + PAMU_AVS1), avs1 &
> PAMU_AV_MASK);
> +			out_be32(p + PAMU_AVS1, avs1 &
> PAMU_AV_MASK);
>  			paace = pamu_get_ppaace(avs1 >>
> PAMU_AVS1_LIODN_SHIFT);
>  			BUG_ON(!paace);
>  			/* check if we got a violation for a disabled LIODN */
> diff --git a/drivers/iommu/fsl_pamu.h b/drivers/iommu/fsl_pamu.h index
> 342ac6d..aab723f 100644
> --- a/drivers/iommu/fsl_pamu.h
> +++ b/drivers/iommu/fsl_pamu.h
> @@ -26,8 +26,8 @@
>  /* Bit Field macros
>   *	v = bit field variable; m = mask, m##_SHIFT = shift, x = value to load
>   */
> -#define set_bf(v, m, x)		(v = ((v) & ~(m)) | (((x) <<
> (m##_SHIFT)) & (m)))
> -#define get_bf(v, m)		(((v) & (m)) >> (m##_SHIFT))
> +#define set_bf(v, m, x)		(v = ((v) & ~(m)) | (((x) <<
> m##_SHIFT) & (m)))
> +#define get_bf(v, m)		(((v) & (m)) >> m##_SHIFT)
> 
>  /* PAMU CCSR space */
>  #define PAMU_PGC 0x00000000     /* Allows all peripheral accesses */
> diff --git a/drivers/iommu/fsl_pamu_domain.c
> b/drivers/iommu/fsl_pamu_domain.c index 36622e2..ceebd28 100644
> --- a/drivers/iommu/fsl_pamu_domain.c
> +++ b/drivers/iommu/fsl_pamu_domain.c
> @@ -84,7 +84,7 @@ static phys_addr_t get_phys_addr(struct
> fsl_dma_domain *dma_domain, dma_addr_t i
>  	}
> 
>  	if (win_ptr->valid)
> -		return (win_ptr->paddr + (iova & (win_ptr->size - 1)));
> +		return win_ptr->paddr + (iova & (win_ptr->size - 1));
> 
>  	return 0;
>  }
> @@ -386,8 +386,8 @@ static phys_addr_t fsl_pamu_iova_to_phys(struct
> iommu_domain *domain,  {
>  	struct fsl_dma_domain *dma_domain = domain->priv;
> 
> -	if ((iova < domain->geometry.aperture_start) ||
> -	    iova > (domain->geometry.aperture_end))
> +	if (iova < domain->geometry.aperture_start ||
> +	    iova > domain->geometry.aperture_end)
>  		return 0;
> 
>  	return get_phys_addr(dma_domain, iova); @@ -1029,7 +1029,7 @@
> static int fsl_pamu_set_windows(struct iommu_domain *domain, u32
> w_count)
>  	}
> 
>  	ret = pamu_set_domain_geometry(dma_domain, &domain-
> >geometry,
> -				       ((w_count > 1) ? w_count : 0));
> +				       w_count > 1 ? w_count : 0);
>  	if (!ret) {
>  		kfree(dma_domain->win_arr);
>  		dma_domain->win_arr = kcalloc(w_count,
> --
> 2.2.2
Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 11/26] iommu/fsl: Fix checkpatch type OOM_MESSAGE
       [not found]     ` <1422455698-3074-12-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30  9:43       ` Varun Sethi
       [not found]         ` <BN3PR0301MB1219BCCB01E99D150D0753F6EA310-CEkquS/Gb81uuip9JPHoc5wN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
  0 siblings, 1 reply; 73+ messages in thread
From: Varun Sethi @ 2015-01-30  9:43 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM
  Cc: Emilian Medve

Hi Emil,

> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, January 28, 2015 8:05 PM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Cc: Medve Emilian-EMMEDVE1
> Subject: [PATCH 11/26] iommu/fsl: Fix checkpatch type OOM_MESSAGE
> 
> WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message
> +       if (!data) {
> +               dev_err(&pdev->dev, "PAMU isr data memory allocation
> + failed\n");
> 
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index
> 4f1926b..6f9c976 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -1041,7 +1041,6 @@ static int __init fsl_pamu_probe(struct
> platform_device *pdev)
> 
>  	data = kzalloc(sizeof(*data), GFP_KERNEL);
>  	if (!data) {
> -		dev_err(&pdev->dev, "PAMU isr data memory allocation
> failed\n");
>  		ret = -ENOMEM;
>  		goto error;
>  	}
I think this is fine, there are other places as well where we have error prints while setting the ENOMEM as the return code.

-Varun

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH 00/26] iommu/fsl: Various cleanup
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (25 preceding siblings ...)
  2015-01-28 14:34   ` [PATCH 26/26] iommu/fsl: Remove extra paranthesis Emil Medve
@ 2015-01-30 12:30   ` Joerg Roedel
       [not found]     ` <20150130123040.GE3702-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
  2015-01-31 17:58   ` Timur Tabi
  27 siblings, 1 reply; 73+ messages in thread
From: Joerg Roedel @ 2015-01-30 12:30 UTC (permalink / raw)
  To: Emil Medve
  Cc: Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	jroedel-l3A5Bk7waGM

Varun,

On Wed, Jan 28, 2015 at 08:34:32AM -0600, Emil Medve wrote:
> 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):
>   iommu/fsl: Sprinkle some __init* annotations
>   iommu/fsl: Use SVR_* instead of magic numbers
>   iommu/fsl: Remove unused/extra includes
>   iommu/fsl: Fix checkpatch type SPACE_BEFORE_TAB
>   iommu/fsl: Fix checkpatch type LINE_SPACING
>   iommu/fsl: Fix checkpatch type LEADING_SPACE
>   iommu/fsl: Fix checkpath type BRACES
>   iommu/fsl: Fix checkpatch type CODE_INDENT
>   iommu/fsl: Fix checkpatch type ALLOC_SIZEOF_STRUCT
>   iommu/fsl: Fix checkpatch type ALLOC_WITH_MULTIPLY
>   iommu/fsl: Fix checkpatch type OOM_MESSAGE
>   iommu/fsl: Fix checkpatch type TYPO_SPELLING
>   iommu/fsl: Fix checkpatch type PREFER_PACKED
>   iommu/fsl: Fix checkpatch type QUOTED_WHITESPACE_BEFORE_NEWLINE
>   iommu/fsl: Fix checkpatch type SPACING
>   iommu/fsl: Use a device pointer to make lines shorter
>   iommu/fsl: Remove pr/dev_*() prefixes
>   iommu/fsl: Fix checkpatch type PARENTHESIS_ALIGNMENT
>   iommu/fsl: Fix some comments alignment
>   iommu/fsl: Fix alignment of some stray lines
>   iommu/fsl: Fix checkpatch type LONG_LINE
>   iommu/fsl: Make local symbols static
>   iommu/fsl: Use NULL instead of zero
>   iommu/fsl: Remove unneeded semicolon
>   iommu/fsl: Don't use integers values with bool type
>   iommu/fsl: Remove extra paranthesis

Can you collect the patches you acked and send me a pull-req for them?


Thanks,

	Joerg

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH 11/26] iommu/fsl: Fix checkpatch type OOM_MESSAGE
       [not found]         ` <BN3PR0301MB1219BCCB01E99D150D0753F6EA310-CEkquS/Gb81uuip9JPHoc5wN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
@ 2015-01-30 14:18           ` Emil Medve
       [not found]             ` <54CB92C0.5000304-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  0 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-30 14:18 UTC (permalink / raw)
  To: Sethi Varun-B16395,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM

Hello Varun,


On 01/30/2015 03:43 AM, Sethi Varun-B16395 wrote:
> Hi Emil,
> 
>> -----Original Message-----
>> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
>> Sent: Wednesday, January 28, 2015 8:05 PM
>> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
>> Sethi Varun-B16395
>> Cc: Medve Emilian-EMMEDVE1
>> Subject: [PATCH 11/26] iommu/fsl: Fix checkpatch type OOM_MESSAGE
>>
>> WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message
>> +       if (!data) {
>> +               dev_err(&pdev->dev, "PAMU isr data memory allocation
>> + failed\n");
>>
>> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
>> ---
>>  drivers/iommu/fsl_pamu.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index
>> 4f1926b..6f9c976 100644
>> --- a/drivers/iommu/fsl_pamu.c
>> +++ b/drivers/iommu/fsl_pamu.c
>> @@ -1041,7 +1041,6 @@ static int __init fsl_pamu_probe(struct
>> platform_device *pdev)
>>
>>  	data = kzalloc(sizeof(*data), GFP_KERNEL);
>>  	if (!data) {
>> -		dev_err(&pdev->dev, "PAMU isr data memory allocation
>> failed\n");
>>  		ret = -ENOMEM;
>>  		goto error;
>>  	}
> I think this is fine, there are other places as well where we have
> error prints while setting the ENOMEM as the return code.

This is a checkpatch report and I quote from the log:

>     Logging messages that show some type of "out of memory" error are
>     generally unnecessary as there is a generic message and a stack dump
>     done by the memory subsystem.

I think this particular dev_err() doesn't add extra


Cheers,

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
       [not found]                 ` <BN3PR0301MB1219965593D06F96A8A1ADB8EA310-CEkquS/Gb81uuip9JPHoc5wN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
@ 2015-01-30 14:23                   ` Emil Medve
       [not found]                     ` <54CB93ED.80109-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  0 siblings, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-01-30 14:23 UTC (permalink / raw)
  To: Sethi Varun-B16395,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM

Hello Varun,


On 01/30/2015 03:20 AM, Sethi Varun-B16395 wrote:
> Hi Emil,
> 
>> -----Original Message-----
>> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
>> Sent: Friday, January 30, 2015 12:26 PM
>> To: Sethi Varun-B16395; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org;
>> joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org
>> Subject: Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
>>
>> Hello Varun,
>>
>>
>> On 01/30/2015 12:46 AM, Sethi Varun-B16395 wrote:
>>> Hi Emil,
>>>
>>>> -----Original Message-----
>>>> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
>>>> Sent: Wednesday, January 28, 2015 8:05 PM
>>>> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org;
>>>> jroedel-l3A5Bk7waGM@public.gmane.org; Sethi Varun-B16395
>>>> Cc: Medve Emilian-EMMEDVE1
>>>> Subject: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init*
>>>> annotations
>>>>
>>>> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
>>>> ---
>>>>  drivers/iommu/fsl_pamu.c        | 12 ++++++------
>>>>  drivers/iommu/fsl_pamu_domain.c |  2 +-
>>>>  2 files changed, 7 insertions(+), 7 deletions(-)
>>>>
>>>> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
>>>> index d958e65..652c34d 100644
>>>> --- a/drivers/iommu/fsl_pamu.c
>>>> +++ b/drivers/iommu/fsl_pamu.c
>>>> @@ -50,7 +50,7 @@ struct pamu_isr_data {
>>>>
>>>>  static struct paace *ppaact;
>>>>  static struct paace *spaact;
>>>> -static struct ome *omt;
>>>> +static struct ome *omt __initdata;
>>>
>>> [varun] omt shouldn't be initdata.
>>
>> It seems to be used only from probe()'s call tree: fsl_pamu_probe() and
>> setup_omt(); both __init functions. Am I missing something?
>>
>>
> Omt corresponds to PAMU operation mapping table, which is pointed to
> by the PAMU OMT base registers. We are using operation mapping table for
> operation translation.

Yes, but this 'omt' is just a pointer (should it be annotated as
__iomem?) to the table and not used past the call sequence
fsl_pamu_probe()->setup_omt(). For that matter 'omt' can be local to
fsl_pamu_probe(). The hardware table/storage is used by the PAMU past
the setup, but this pointer is not


Cheers,

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
       [not found]                     ` <54CB93ED.80109-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30 14:44                       ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30 14:44 UTC (permalink / raw)
  To: Emilian Medve, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM

Hi Emil,

> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Friday, January 30, 2015 7:54 PM
> To: Sethi Varun-B16395; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org;
> joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org
> Subject: Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
> 
> Hello Varun,
> 
> 
> On 01/30/2015 03:20 AM, Sethi Varun-B16395 wrote:
> > Hi Emil,
> >
> >> -----Original Message-----
> >> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> >> Sent: Friday, January 30, 2015 12:26 PM
> >> To: Sethi Varun-B16395; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org;
> >> joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org
> >> Subject: Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init*
> >> annotations
> >>
> >> Hello Varun,
> >>
> >>
> >> On 01/30/2015 12:46 AM, Sethi Varun-B16395 wrote:
> >>> Hi Emil,
> >>>
> >>>> -----Original Message-----
> >>>> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> >>>> Sent: Wednesday, January 28, 2015 8:05 PM
> >>>> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org;
> >>>> jroedel-l3A5Bk7waGM@public.gmane.org; Sethi Varun-B16395
> >>>> Cc: Medve Emilian-EMMEDVE1
> >>>> Subject: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init*
> >>>> annotations
> >>>>
> >>>> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> >>>> ---
> >>>>  drivers/iommu/fsl_pamu.c        | 12 ++++++------
> >>>>  drivers/iommu/fsl_pamu_domain.c |  2 +-
> >>>>  2 files changed, 7 insertions(+), 7 deletions(-)
> >>>>
> >>>> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
> >>>> index d958e65..652c34d 100644
> >>>> --- a/drivers/iommu/fsl_pamu.c
> >>>> +++ b/drivers/iommu/fsl_pamu.c
> >>>> @@ -50,7 +50,7 @@ struct pamu_isr_data {
> >>>>
> >>>>  static struct paace *ppaact;
> >>>>  static struct paace *spaact;
> >>>> -static struct ome *omt;
> >>>> +static struct ome *omt __initdata;
> >>>
> >>> [varun] omt shouldn't be initdata.
> >>
> >> It seems to be used only from probe()'s call tree: fsl_pamu_probe()
> >> and setup_omt(); both __init functions. Am I missing something?
> >>
> >>
> > Omt corresponds to PAMU operation mapping table, which is pointed to
> > by the PAMU OMT base registers. We are using operation mapping table
> > for operation translation.
> 
> Yes, but this 'omt' is just a pointer (should it be annotated as
> __iomem?) to the table and not used past the call sequence
> fsl_pamu_probe()->setup_omt(). For that matter 'omt' can be local to
> fsl_pamu_probe(). The hardware table/storage is used by the PAMU past
> the setup, but this pointer is not
Yes, you are right we won't use the pointer after the OMT table has been setup. We would just need the operation mapping entry index.

Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 11/26] iommu/fsl: Fix checkpatch type OOM_MESSAGE
       [not found]             ` <54CB92C0.5000304-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-01-30 14:47               ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-30 14:47 UTC (permalink / raw)
  To: Emilian Medve, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM

Hi Emil,

> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Friday, January 30, 2015 7:49 PM
> To: Sethi Varun-B16395; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org;
> joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org
> Subject: Re: [PATCH 11/26] iommu/fsl: Fix checkpatch type OOM_MESSAGE
> 
> Hello Varun,
> 
> 
> On 01/30/2015 03:43 AM, Sethi Varun-B16395 wrote:
> > Hi Emil,
> >
> >> -----Original Message-----
> >> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> >> Sent: Wednesday, January 28, 2015 8:05 PM
> >> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org;
> >> jroedel-l3A5Bk7waGM@public.gmane.org; Sethi Varun-B16395
> >> Cc: Medve Emilian-EMMEDVE1
> >> Subject: [PATCH 11/26] iommu/fsl: Fix checkpatch type OOM_MESSAGE
> >>
> >> WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory'
> message
> >> +       if (!data) {
> >> +               dev_err(&pdev->dev, "PAMU isr data memory allocation
> >> + failed\n");
> >>
> >> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> >> ---
> >>  drivers/iommu/fsl_pamu.c | 1 -
> >>  1 file changed, 1 deletion(-)
> >>
> >> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
> >> index
> >> 4f1926b..6f9c976 100644
> >> --- a/drivers/iommu/fsl_pamu.c
> >> +++ b/drivers/iommu/fsl_pamu.c
> >> @@ -1041,7 +1041,6 @@ static int __init fsl_pamu_probe(struct
> >> platform_device *pdev)
> >>
> >>  	data = kzalloc(sizeof(*data), GFP_KERNEL);
> >>  	if (!data) {
> >> -		dev_err(&pdev->dev, "PAMU isr data memory allocation
> >> failed\n");
> >>  		ret = -ENOMEM;
> >>  		goto error;
> >>  	}
> > I think this is fine, there are other places as well where we have
> > error prints while setting the ENOMEM as the return code.
> 
> This is a checkpatch report and I quote from the log:

Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
 

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 00/26] iommu/fsl: Various cleanup
       [not found]     ` <20150130123040.GE3702-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
@ 2015-01-30 14:50       ` Varun Sethi
       [not found]         ` <BN3PR0301MB12194ECBA7501AFE17F34F69EA310-CEkquS/Gb81uuip9JPHoc5wN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
  0 siblings, 1 reply; 73+ messages in thread
From: Varun Sethi @ 2015-01-30 14:50 UTC (permalink / raw)
  To: Joerg Roedel, Emilian Medve
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, jroedel-l3A5Bk7waGM

Hi Joerg,

> -----Original Message-----
> From: Joerg Roedel [mailto:joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org]
> Sent: Friday, January 30, 2015 6:01 PM
> To: Medve Emilian-EMMEDVE1
> Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org; Sethi Varun-B16395
> Subject: Re: [PATCH 00/26] iommu/fsl: Various cleanup
> 
> Varun,
> 
> On Wed, Jan 28, 2015 at 08:34:32AM -0600, Emil Medve wrote:
> > 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):
> >   iommu/fsl: Sprinkle some __init* annotations
> >   iommu/fsl: Use SVR_* instead of magic numbers
> >   iommu/fsl: Remove unused/extra includes
> >   iommu/fsl: Fix checkpatch type SPACE_BEFORE_TAB
> >   iommu/fsl: Fix checkpatch type LINE_SPACING
> >   iommu/fsl: Fix checkpatch type LEADING_SPACE
> >   iommu/fsl: Fix checkpath type BRACES
> >   iommu/fsl: Fix checkpatch type CODE_INDENT
> >   iommu/fsl: Fix checkpatch type ALLOC_SIZEOF_STRUCT
> >   iommu/fsl: Fix checkpatch type ALLOC_WITH_MULTIPLY
> >   iommu/fsl: Fix checkpatch type OOM_MESSAGE
> >   iommu/fsl: Fix checkpatch type TYPO_SPELLING
> >   iommu/fsl: Fix checkpatch type PREFER_PACKED
> >   iommu/fsl: Fix checkpatch type QUOTED_WHITESPACE_BEFORE_NEWLINE
> >   iommu/fsl: Fix checkpatch type SPACING
> >   iommu/fsl: Use a device pointer to make lines shorter
> >   iommu/fsl: Remove pr/dev_*() prefixes
> >   iommu/fsl: Fix checkpatch type PARENTHESIS_ALIGNMENT
> >   iommu/fsl: Fix some comments alignment
> >   iommu/fsl: Fix alignment of some stray lines
> >   iommu/fsl: Fix checkpatch type LONG_LINE
> >   iommu/fsl: Make local symbols static
> >   iommu/fsl: Use NULL instead of zero
> >   iommu/fsl: Remove unneeded semicolon
> >   iommu/fsl: Don't use integers values with bool type
> >   iommu/fsl: Remove extra paranthesis
> 
> Can you collect the patches you acked and send me a pull-req for them?
> 
Acked, all the patches in the series. Can you apply the series or would you prefer a pull request?

Acked-by: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH 00/26] iommu/fsl: Various cleanup
       [not found]         ` <BN3PR0301MB12194ECBA7501AFE17F34F69EA310-CEkquS/Gb81uuip9JPHoc5wN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
@ 2015-01-30 15:36           ` Joerg Roedel
       [not found]             ` <20150130153626.GH3702-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 73+ messages in thread
From: Joerg Roedel @ 2015-01-30 15:36 UTC (permalink / raw)
  To: Varun Sethi
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	jroedel-l3A5Bk7waGM, Emilian Medve

On Fri, Jan 30, 2015 at 02:50:17PM +0000, Varun Sethi wrote:
> Acked, all the patches in the series. Can you apply the series or would you prefer a pull request?

Yes, please add your acks and send me a pull-request.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH 00/26] iommu/fsl: Various cleanup
       [not found]             ` <20150130153626.GH3702-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
@ 2015-01-31 17:37               ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-01-31 17:37 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	jroedel-l3A5Bk7waGM, Emilian Medve

Hi Joerg,
I have applied the patches on the pamu_next branch at https://github.com/varunfsl/fsl_pamu/tree/pamu_next

Please pull commit ids e72d948 to 14241be

Regards
Varun
> -----Original Message-----
> From: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org [mailto:iommu-
> bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org] On Behalf Of Joerg Roedel
> Sent: Friday, January 30, 2015 9:06 PM
> To: Sethi Varun-B16395
> Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org; Medve Emilian-
> EMMEDVE1
> Subject: Re: [PATCH 00/26] iommu/fsl: Various cleanup
> 
> On Fri, Jan 30, 2015 at 02:50:17PM +0000, Varun Sethi wrote:
> > Acked, all the patches in the series. Can you apply the series or would you
> prefer a pull request?
> 
> Yes, please add your acks and send me a pull-request.
> 
> _______________________________________________
> iommu mailing list
> iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
> https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH 00/26] iommu/fsl: Various cleanup
       [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
                     ` (26 preceding siblings ...)
  2015-01-30 12:30   ` [PATCH 00/26] iommu/fsl: Various cleanup Joerg Roedel
@ 2015-01-31 17:58   ` Timur Tabi
       [not found]     ` <CAOZdJXXk5L7AFwryKXiTemw=jw+VXXXBZXdapzgzs4APC0PLtQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  27 siblings, 1 reply; 73+ messages in thread
From: Timur Tabi @ 2015-01-31 17:58 UTC (permalink / raw)
  To: Emil Medve
  Cc: Varun Sethi, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	jroedel-l3A5Bk7waGM

On Wed, Jan 28, 2015 at 8:34 AM, Emil Medve <Emilian.Medve-KZfg59tc24xl57MIdRCFDg@public.gmane.org> wrote:
> 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):

These should all be merged into one patch, IMHO.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH 00/26] iommu/fsl: Various cleanup
       [not found]     ` <CAOZdJXXk5L7AFwryKXiTemw=jw+VXXXBZXdapzgzs4APC0PLtQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-02-01  6:05       ` Emil Medve
       [not found]         ` <54CDC236.70004-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-02-03 17:51       ` Joerg Roedel
  1 sibling, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-02-01  6:05 UTC (permalink / raw)
  To: Timur Tabi
  Cc: Varun Sethi, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	jroedel-l3A5Bk7waGM

Hello Timur,


On 01/31/2015 11:58 AM, Timur Tabi wrote:
> On Wed, Jan 28, 2015 at 8:34 AM, Emil Medve <Emilian.Medve-KZfg59tc24xl57MIdRCFDg@public.gmane.org> wrote:
>> 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):
> 
> These should all be merged into one patch, IMHO.

Granted all the patches are small and lots of them are wrangling
whitespaces but I considered it to be much easier for the reviewers this way


Cheers,

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH 00/26] iommu/fsl: Various cleanup
       [not found]         ` <54CDC236.70004-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-02-01 17:07           ` Timur Tabi
  0 siblings, 0 replies; 73+ messages in thread
From: Timur Tabi @ 2015-02-01 17:07 UTC (permalink / raw)
  To: Emil Medve
  Cc: Varun Sethi, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	jroedel-l3A5Bk7waGM

Emil Medve wrote:
> Granted all the patches are small and lots of them are wrangling
> whitespaces but I considered it to be much easier for the reviewers this way

Well, if I were the maintainer, I would be annoyed.  Each diff is 
independent, so I don't need to "understand" the patch in order to 
review it, so reviewing 26 patches is more cumbersome than reviewing one.

Just my two cents.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH 00/26] iommu/fsl: Various cleanup
       [not found]     ` <CAOZdJXXk5L7AFwryKXiTemw=jw+VXXXBZXdapzgzs4APC0PLtQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2015-02-01  6:05       ` Emil Medve
@ 2015-02-03 17:51       ` Joerg Roedel
  1 sibling, 0 replies; 73+ messages in thread
From: Joerg Roedel @ 2015-02-03 17:51 UTC (permalink / raw)
  To: Timur Tabi
  Cc: Varun Sethi, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	jroedel-l3A5Bk7waGM, Emil Medve

On Sat, Jan 31, 2015 at 11:58:58AM -0600, Timur Tabi wrote:
> These should all be merged into one patch, IMHO.

I agree, it makes more sense to put all this into a single patch.
Applied this way.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
       [not found]     ` <1422455698-3074-2-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-01-30  6:46       ` Varun Sethi
@ 2015-02-09 21:46       ` Emil Medve
       [not found]         ` <54D92ABC.3030802-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  1 sibling, 1 reply; 73+ messages in thread
From: Emil Medve @ 2015-02-09 21:46 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM,
	Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg

Hello Joerg,


On 01/28/2015 08:34 AM, Emil Medve wrote:
> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> ---
>  drivers/iommu/fsl_pamu.c        | 12 ++++++------
>  drivers/iommu/fsl_pamu_domain.c |  2 +-
>  2 files changed, 7 insertions(+), 7 deletions(-)

Please don't apply this patch as it's wrong. It's based on
https://git.kernel.org/cgit/linux/kernel/git/joro/iommu.git/commit/?h=ppc/pamu&id=0f1fb99b62ce226f8d818852f812c5d79071ce58
which is wrong as well and its causing semi-random crashes upon more
extensive testing. I will follow-up with details shortly


Cheers,

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
       [not found]         ` <54D92ABC.3030802-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-02-10  2:26           ` Varun Sethi
       [not found]             ` <BY1PR0301MB122186F802612D1B8048722AEA240-M1kb196zaoruTkAIFHd/+ZwN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
  2015-02-11 11:35           ` Joerg Roedel
  1 sibling, 1 reply; 73+ messages in thread
From: Varun Sethi @ 2015-02-10  2:26 UTC (permalink / raw)
  To: Emilian Medve, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM

Hi Emil,


> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Tuesday, February 10, 2015 3:17 AM
> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
> Sethi Varun-B16395
> Subject: Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
> 
> Hello Joerg,
> 
> 
> On 01/28/2015 08:34 AM, Emil Medve wrote:
> > Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> > ---
> >  drivers/iommu/fsl_pamu.c        | 12 ++++++------
> >  drivers/iommu/fsl_pamu_domain.c |  2 +-
> >  2 files changed, 7 insertions(+), 7 deletions(-)
> 
> Please don't apply this patch as it's wrong. It's based on
> https://git.kernel.org/cgit/linux/kernel/git/joro/iommu.git/commit/?h=ppc/
> pamu&id=0f1fb99b62ce226f8d818852f812c5d79071ce58
> which is wrong as well and its causing semi-random crashes upon more
> extensive testing. I will follow-up with details shortly
Are you seeing  a crash with https://git.kernel.org/cgit/linux/kernel/git/joro/iommu.git/commit/?h=ppc/pamu&id=0f1fb99b62ce226f8d818852f812c5d79071ce58 ? At, what point do you see crashes?

-Varun

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
       [not found]             ` <BY1PR0301MB122186F802612D1B8048722AEA240-M1kb196zaoruTkAIFHd/+ZwN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
@ 2015-02-11 11:07               ` Emil Medve
       [not found]                 ` <54DB37DA.2040500-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-02-11 13:47                 ` Varun Sethi
  0 siblings, 2 replies; 73+ messages in thread
From: Emil Medve @ 2015-02-11 11:07 UTC (permalink / raw)
  To: Sethi Varun-B16395,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM

Hello Varun,


On 02/09/2015 08:26 PM, Sethi Varun-B16395 wrote:
> Hi Emil,
> 
> 
>> -----Original Message-----
>> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
>> Sent: Tuesday, February 10, 2015 3:17 AM
>> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org;
>> Sethi Varun-B16395
>> Subject: Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
>>
>> Hello Joerg,
>>
>>
>> On 01/28/2015 08:34 AM, Emil Medve wrote:
>>> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
>>> ---
>>>  drivers/iommu/fsl_pamu.c        | 12 ++++++------
>>>  drivers/iommu/fsl_pamu_domain.c |  2 +-
>>>  2 files changed, 7 insertions(+), 7 deletions(-)
>>
>> Please don't apply this patch as it's wrong. It's based on
>> https://git.kernel.org/cgit/linux/kernel/git/joro/iommu.git/commit/?h=ppc/
>> pamu&id=0f1fb99b62ce226f8d818852f812c5d79071ce58
>> which is wrong as well and its causing semi-random crashes upon more
>> extensive testing. I will follow-up with details shortly
> 
> Are you seeing  a crash with
> https://git.kernel.org/cgit/linux/kernel/git/joro/iommu.git/commit/?h=ppc/pamu&id=0f1fb99b62ce226f8d818852f812c5d79071ce58
> ? At, what point do you see crashes?

platform_driver.device_driver gets added to a (platform) bus klist of
drivers. (There are also a handful of other pointers that get set to
fsl_of_pamu_driver) Once fsl_of_pamu_driver gets released that klist
becomes "corrupted" and, depending on how said memory gets re-used,
traversing it for any reason will end up into a crash

Anyway, I identified easier ways to produce kernel crashes related to
the PAMU driver via sysfs (with or without my __init* annotation
patches). For example a "unbind, bind" sequence will cause a crash with
the driver as is in v3.19

BTW, why is the PAMU an "early" driver?

I'll send out some patches to properly fix all these __init* annotations


Cheers,

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
       [not found]                 ` <54DB37DA.2040500-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-02-11 11:30                   ` Varun Sethi
  0 siblings, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-02-11 11:30 UTC (permalink / raw)
  To: Emilian Medve, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM

Hi Emil,

> -----Original Message-----
> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> Sent: Wednesday, February 11, 2015 4:37 PM
> To: Sethi Varun-B16395; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org;
> joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org
> Subject: Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
> 
> Hello Varun,
> 
> 
> On 02/09/2015 08:26 PM, Sethi Varun-B16395 wrote:
> > Hi Emil,
> >
> >
> >> -----Original Message-----
> >> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> >> Sent: Tuesday, February 10, 2015 3:17 AM
> >> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org;
> >> jroedel-l3A5Bk7waGM@public.gmane.org; Sethi Varun-B16395
> >> Subject: Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init*
> >> annotations
> >>
> >> Hello Joerg,
> >>
> >>
> >> On 01/28/2015 08:34 AM, Emil Medve wrote:
> >>> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> >>> ---
> >>>  drivers/iommu/fsl_pamu.c        | 12 ++++++------
> >>>  drivers/iommu/fsl_pamu_domain.c |  2 +-
> >>>  2 files changed, 7 insertions(+), 7 deletions(-)
> >>
> >> Please don't apply this patch as it's wrong. It's based on
> >> https://git.kernel.org/cgit/linux/kernel/git/joro/iommu.git/commit/?h
> >> =ppc/
> >> pamu&id=0f1fb99b62ce226f8d818852f812c5d79071ce58
> >> which is wrong as well and its causing semi-random crashes upon more
> >> extensive testing. I will follow-up with details shortly
> >
> > Are you seeing  a crash with
> > https://git.kernel.org/cgit/linux/kernel/git/joro/iommu.git/commit/?h=
> > ppc/pamu&id=0f1fb99b62ce226f8d818852f812c5d79071ce58
> > ? At, what point do you see crashes?
> 
> platform_driver.device_driver gets added to a (platform) bus klist of drivers.
> (There are also a handful of other pointers that get set to
> fsl_of_pamu_driver) Once fsl_of_pamu_driver gets released that klist
> becomes "corrupted" and, depending on how said memory gets re-used,
> traversing it for any reason will end up into a crash
> 
> Anyway, I identified easier ways to produce kernel crashes related to the
> PAMU driver via sysfs (with or without my __init* annotation patches). For
> example a "unbind, bind" sequence will cause a crash with the driver as is in
> v3.19
> 
> BTW, why is the PAMU an "early" driver?
> 
> I'll send out some patches to properly fix all these __init* annotations
Yes, the fsl_of_pamu_driver structure shouldn't be marked init data, it could actually corrupt the driver list. PAMU driver should initialize before the DPAA driver initialization also, to ensure the default DMA window is setup for all devices. 

-Varun

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
       [not found]         ` <54D92ABC.3030802-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
  2015-02-10  2:26           ` Varun Sethi
@ 2015-02-11 11:35           ` Joerg Roedel
  1 sibling, 0 replies; 73+ messages in thread
From: Joerg Roedel @ 2015-02-11 11:35 UTC (permalink / raw)
  To: Emil Medve
  Cc: Varun.Sethi-eDlz3WWmN0ll57MIdRCFDg,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

On Mon, Feb 09, 2015 at 03:46:36PM -0600, Emil Medve wrote:
> Please don't apply this patch as it's wrong. It's based on
> https://git.kernel.org/cgit/linux/kernel/git/joro/iommu.git/commit/?h=ppc/pamu&id=0f1fb99b62ce226f8d818852f812c5d79071ce58
> which is wrong as well and its causing semi-random crashes upon more
> extensive testing. I will follow-up with details shortly

Please send a follow-on patch with a fix, I can't easily revert that
single patch.


	Joerg

^ permalink raw reply	[flat|nested] 73+ messages in thread

* RE: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
  2015-02-11 11:07               ` Emil Medve
       [not found]                 ` <54DB37DA.2040500-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
@ 2015-02-11 13:47                 ` Varun Sethi
  1 sibling, 0 replies; 73+ messages in thread
From: Varun Sethi @ 2015-02-11 13:47 UTC (permalink / raw)
  To: Emilian Medve, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	joro-zLv9SwRftAIdnm+yROfE0A, jroedel-l3A5Bk7waGM

Hi Emil,

> -----Original Message-----
> From: Sethi Varun-B16395
> Sent: Wednesday, February 11, 2015 5:00 PM
> To: 'Emil Medve'; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org;
> jroedel-l3A5Bk7waGM@public.gmane.org
> Subject: RE: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
> 
> Hi Emil,
> 
> > -----Original Message-----
> > From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> > Sent: Wednesday, February 11, 2015 4:37 PM
> > To: Sethi Varun-B16395; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org;
> > joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; jroedel-l3A5Bk7waGM@public.gmane.org
> > Subject: Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init*
> > annotations
> >
> > Hello Varun,
> >
> >
> > On 02/09/2015 08:26 PM, Sethi Varun-B16395 wrote:
> > > Hi Emil,
> > >
> > >
> > >> -----Original Message-----
> > >> From: Emil Medve [mailto:Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org]
> > >> Sent: Tuesday, February 10, 2015 3:17 AM
> > >> To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org;
> > >> jroedel-l3A5Bk7waGM@public.gmane.org; Sethi Varun-B16395
> > >> Subject: Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init*
> > >> annotations
> > >>
> > >> Hello Joerg,
> > >>
> > >>
> > >> On 01/28/2015 08:34 AM, Emil Medve wrote:
> > >>> Signed-off-by: Emil Medve <Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
> > >>> ---
> > >>>  drivers/iommu/fsl_pamu.c        | 12 ++++++------
> > >>>  drivers/iommu/fsl_pamu_domain.c |  2 +-
> > >>>  2 files changed, 7 insertions(+), 7 deletions(-)
> > >>
> > >> Please don't apply this patch as it's wrong. It's based on
> > >> https://git.kernel.org/cgit/linux/kernel/git/joro/iommu.git/commit/
> > >> ?h
> > >> =ppc/
> > >> pamu&id=0f1fb99b62ce226f8d818852f812c5d79071ce58
> > >> which is wrong as well and its causing semi-random crashes upon
> > >> more extensive testing. I will follow-up with details shortly
> > >
> > > Are you seeing  a crash with
> > > https://git.kernel.org/cgit/linux/kernel/git/joro/iommu.git/commit/?
> > > h=
> > > ppc/pamu&id=0f1fb99b62ce226f8d818852f812c5d79071ce58
> > > ? At, what point do you see crashes?
> >
> > platform_driver.device_driver gets added to a (platform) bus klist of
> drivers.
> > (There are also a handful of other pointers that get set to
> > fsl_of_pamu_driver) Once fsl_of_pamu_driver gets released that klist
> > becomes "corrupted" and, depending on how said memory gets re-used,
> > traversing it for any reason will end up into a crash
> >
> > Anyway, I identified easier ways to produce kernel crashes related to
> > the PAMU driver via sysfs (with or without my __init* annotation
> > patches). For example a "unbind, bind" sequence will cause a crash
> > with the driver as is in
> > v3.19
> >
> > BTW, why is the PAMU an "early" driver?
> >
> > I'll send out some patches to properly fix all these __init*
> > annotations
> Yes, the fsl_of_pamu_driver structure shouldn't be marked init data, it could
> actually corrupt the driver list. PAMU driver should initialize before the DPAA
> driver initialization also, to ensure the default DMA window is setup for all
> devices.
> 
I think that we can revert this patch, the section mismatch isn't really an issue. The pamu driver probe routine wouldn't get called during platform bus probe. 

-Varun

^ permalink raw reply	[flat|nested] 73+ messages in thread

end of thread, other threads:[~2015-02-11 13:47 UTC | newest]

Thread overview: 73+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-28 14:34 [PATCH 00/26] iommu/fsl: Various cleanup Emil Medve
     [not found] ` <1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-28 14:34   ` [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations Emil Medve
     [not found]     ` <1422455698-3074-2-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  6:46       ` Varun Sethi
     [not found]         ` <BN3PR0301MB121998FEF4EE5C92DEEF7D61EA310-CEkquS/Gb81uuip9JPHoc5wN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2015-01-30  6:55           ` Emil Medve
     [not found]             ` <54CB2AEC.9000800-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  9:20               ` Varun Sethi
     [not found]                 ` <BN3PR0301MB1219965593D06F96A8A1ADB8EA310-CEkquS/Gb81uuip9JPHoc5wN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2015-01-30 14:23                   ` Emil Medve
     [not found]                     ` <54CB93ED.80109-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30 14:44                       ` Varun Sethi
2015-02-09 21:46       ` Emil Medve
     [not found]         ` <54D92ABC.3030802-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-02-10  2:26           ` Varun Sethi
     [not found]             ` <BY1PR0301MB122186F802612D1B8048722AEA240-M1kb196zaoruTkAIFHd/+ZwN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2015-02-11 11:07               ` Emil Medve
     [not found]                 ` <54DB37DA.2040500-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-02-11 11:30                   ` Varun Sethi
2015-02-11 13:47                 ` Varun Sethi
2015-02-11 11:35           ` Joerg Roedel
2015-01-28 14:34   ` [PATCH 02/26] iommu/fsl: Use SVR_* instead of magic numbers Emil Medve
     [not found]     ` <1422455698-3074-3-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  6:57       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 03/26] iommu/fsl: Remove unused/extra includes Emil Medve
     [not found]     ` <1422455698-3074-4-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  7:10       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 04/26] iommu/fsl: Fix checkpatch type SPACE_BEFORE_TAB Emil Medve
     [not found]     ` <1422455698-3074-5-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  7:12       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 05/26] iommu/fsl: Fix checkpatch type LINE_SPACING Emil Medve
     [not found]     ` <1422455698-3074-6-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  7:13       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 06/26] iommu/fsl: Fix checkpatch type LEADING_SPACE Emil Medve
     [not found]     ` <1422455698-3074-7-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  7:15       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 07/26] iommu/fsl: Fix checkpath type BRACES Emil Medve
     [not found]     ` <1422455698-3074-8-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  7:17       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 08/26] iommu/fsl: Fix checkpatch type CODE_INDENT Emil Medve
     [not found]     ` <1422455698-3074-9-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  7:19       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 09/26] iommu/fsl: Fix checkpatch type ALLOC_SIZEOF_STRUCT Emil Medve
     [not found]     ` <1422455698-3074-10-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  7:30       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 10/26] iommu/fsl: Fix checkpatch type ALLOC_WITH_MULTIPLY Emil Medve
     [not found]     ` <1422455698-3074-11-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  7:33       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 11/26] iommu/fsl: Fix checkpatch type OOM_MESSAGE Emil Medve
     [not found]     ` <1422455698-3074-12-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  9:43       ` Varun Sethi
     [not found]         ` <BN3PR0301MB1219BCCB01E99D150D0753F6EA310-CEkquS/Gb81uuip9JPHoc5wN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2015-01-30 14:18           ` Emil Medve
     [not found]             ` <54CB92C0.5000304-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30 14:47               ` Varun Sethi
2015-01-28 14:34   ` [PATCH 12/26] iommu/fsl: Fix checkpatch type TYPO_SPELLING Emil Medve
     [not found]     ` <1422455698-3074-13-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  7:40       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 13/26] iommu/fsl: Fix checkpatch type PREFER_PACKED Emil Medve
     [not found]     ` <1422455698-3074-14-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  7:40       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 14/26] iommu/fsl: Fix checkpatch type QUOTED_WHITESPACE_BEFORE_NEWLINE Emil Medve
     [not found]     ` <1422455698-3074-15-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  7:42       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 15/26] iommu/fsl: Fix checkpatch type SPACING Emil Medve
     [not found]     ` <1422455698-3074-16-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  7:44       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 16/26] iommu/fsl: Use a device pointer to make lines shorter Emil Medve
     [not found]     ` <1422455698-3074-17-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  7:46       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 17/26] iommu/fsl: Remove pr/dev_*() prefixes Emil Medve
     [not found]     ` <1422455698-3074-18-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  7:47       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 18/26] iommu/fsl: Fix checkpatch type PARENTHESIS_ALIGNMENT Emil Medve
     [not found]     ` <1422455698-3074-19-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  9:29       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 19/26] iommu/fsl: Fix some comments alignment Emil Medve
     [not found]     ` <1422455698-3074-20-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  9:30       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 20/26] iommu/fsl: Fix alignment of some stray lines Emil Medve
     [not found]     ` <1422455698-3074-21-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  9:31       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 21/26] iommu/fsl: Fix checkpatch type LONG_LINE Emil Medve
     [not found]     ` <1422455698-3074-22-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  9:32       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 22/26] iommu/fsl: Make local symbols static Emil Medve
     [not found]     ` <1422455698-3074-23-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  9:33       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 23/26] iommu/fsl: Use NULL instead of zero Emil Medve
     [not found]     ` <1422455698-3074-24-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  9:33       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 24/26] iommu/fsl: Remove unneeded semicolon Emil Medve
     [not found]     ` <1422455698-3074-25-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  9:34       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 25/26] iommu/fsl: Don't use integers values with bool type Emil Medve
     [not found]     ` <1422455698-3074-26-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  9:35       ` Varun Sethi
2015-01-28 14:34   ` [PATCH 26/26] iommu/fsl: Remove extra paranthesis Emil Medve
     [not found]     ` <1422455698-3074-27-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-01-30  9:40       ` Varun Sethi
2015-01-30 12:30   ` [PATCH 00/26] iommu/fsl: Various cleanup Joerg Roedel
     [not found]     ` <20150130123040.GE3702-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-01-30 14:50       ` Varun Sethi
     [not found]         ` <BN3PR0301MB12194ECBA7501AFE17F34F69EA310-CEkquS/Gb81uuip9JPHoc5wN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2015-01-30 15:36           ` Joerg Roedel
     [not found]             ` <20150130153626.GH3702-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-01-31 17:37               ` Varun Sethi
2015-01-31 17:58   ` Timur Tabi
     [not found]     ` <CAOZdJXXk5L7AFwryKXiTemw=jw+VXXXBZXdapzgzs4APC0PLtQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-01  6:05       ` Emil Medve
     [not found]         ` <54CDC236.70004-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org>
2015-02-01 17:07           ` Timur Tabi
2015-02-03 17:51       ` Joerg Roedel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.