Skip to contentSkip to conversation

iommu/fsl: Various cleanup

PATCH In review Emil Medve 5 participants 73 messages Jan 28, 2015 – Feb 11, 2015 41 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Emil Medve

author
#0 lore raw

cover iommu/fsl: Various cleanup

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(-)
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-1-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

author
#2 lore raw

PATCH v2 1/26 iommu/fsl: Sprinkle some __init* annotations

---
 drivers/iommu/fsl_pamu.c        | 12 ++++++------
 drivers/iommu/fsl_pamu_domain.c |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/iommu/fsl_pamu.c +6 -6
index d958e65..652c34d 100644
@@ -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 */
drivers/iommu/fsl_pamu_domain.c +1 -1
index c828f80..48a72b3 100644
@@ -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;
 
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-2-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

#4 lore raw

RE: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations

Hi Emil,

Quoted 19 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; Sethi Varun-B16395
Cc: Medve Emilian-EMMEDVE1
Subject: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations

---
 drivers/iommu/fsl_pamu.c        | 12 ++++++------
 drivers/iommu/fsl_pamu_domain.c |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/iommu/fsl_pamu.c index renamed from drivers/iommu/fsl_pamu.c +0 -0

d958e65..652c34d 100644

drivers/iommu/fsl_pamu.c struct pamu_isr_data { · line 53

Quoted 5 lines
drivers/iommu/fsl_pamu.c +1 -1
@@ -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

A message that is not in the archive (sent off-list or not yet received): BN3PR0301MB121998FEF4EE5C92DEEF7D61EA310-CEkquS/Gb81uuip9JPHoc5wN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/[email protected]

author
#6 lore raw

Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations

Hello Varun,

Quoted 22 lines · On 01/30/2015 12:46 AM, Sethi Varun-B16395 wrote:

Hi Emil,

Quoted 20 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; Sethi Varun-B16395
Cc: Medve Emilian-EMMEDVE1
Subject: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations

---
 drivers/iommu/fsl_pamu.c        | 12 ++++++------
 drivers/iommu/fsl_pamu_domain.c |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/iommu/fsl_pamu.c index renamed from drivers/iommu/fsl_pamu.c +0 -0

d958e65..652c34d 100644

drivers/iommu/fsl_pamu.c +0 -0
@@ -50,7 +50,7 @@ struct pamu_isr_data {
 
Quoted 6 lines

drivers/iommu/fsl_pamu.c struct pamu_isr_data { · line 53

Quoted 4 lines
drivers/iommu/fsl_pamu.c +1 -1
 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,

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw

RE: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations

Hi Emil,

Quoted 41 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Friday, January 30, 2015 12:26 PM
To: Sethi Varun-B16395; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]
Subject: Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations

Hello Varun,

Quoted 23 lines · On 01/30/2015 12:46 AM, Sethi Varun-B16395 wrote:

Hi Emil,

Quoted 21 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; Sethi Varun-B16395
Cc: Medve Emilian-EMMEDVE1
Subject: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init*
annotations

---
 drivers/iommu/fsl_pamu.c        | 12 ++++++------
 drivers/iommu/fsl_pamu_domain.c |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/iommu/fsl_pamu.c +0 -0
index d958e65..652c34d 100644
@@ -50,7 +50,7 @@ struct pamu_isr_data {
 
Quoted 6 lines

drivers/iommu/fsl_pamu.c struct pamu_isr_data { · line 53

Quoted 4 lines
drivers/iommu/fsl_pamu.c +1 -1
 static struct paace *ppaact;
 static struct paace *spaact;
-static struct ome *omt;
+static struct ome *omt __initdata;

[varun] omt shouldn't be initdata.

Quoted 4 lines

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

A message that is not in the archive (sent off-list or not yet received): BN3PR0301MB1219965593D06F96A8A1ADB8EA310-CEkquS/Gb81uuip9JPHoc5wN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/[email protected]

author
#10 lore raw

Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations

Hello Varun,

Quoted 43 lines · On 01/30/2015 03:20 AM, Sethi Varun-B16395 wrote:

Hi Emil,

Quoted 41 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Friday, January 30, 2015 12:26 PM
To: Sethi Varun-B16395; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]
Subject: Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations

Hello Varun,

Quoted 29 lines · On 01/30/2015 12:46 AM, Sethi Varun-B16395 wrote:

Hi Emil,

Quoted 20 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; Sethi Varun-B16395
Cc: Medve Emilian-EMMEDVE1
Subject: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init*
annotations

---
 drivers/iommu/fsl_pamu.c        | 12 ++++++------
 drivers/iommu/fsl_pamu_domain.c |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/iommu/fsl_pamu.c +0 -0
index d958e65..652c34d 100644

drivers/iommu/fsl_pamu.c struct pamu_isr_data { · line 53

Quoted 5 lines
drivers/iommu/fsl_pamu.c +1 -1
@@ -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.

Quoted 7 lines
Quoted 4 lines

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,

A message that is not in the archive (sent off-list or not yet received): [email protected]

Acked-by
#12 lore raw

RE: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations

Hi Emil,

Quoted 63 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Friday, January 30, 2015 7:54 PM
To: Sethi Varun-B16395; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]
Subject: Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations

Hello Varun,

Quoted 44 lines · On 01/30/2015 03:20 AM, Sethi Varun-B16395 wrote:

Hi Emil,

Quoted 42 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Friday, January 30, 2015 12:26 PM
To: Sethi Varun-B16395; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]
Subject: Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init*
annotations

Hello Varun,

Quoted 29 lines · On 01/30/2015 12:46 AM, Sethi Varun-B16395 wrote:

Hi Emil,

Quoted 20 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; Sethi Varun-B16395
Cc: Medve Emilian-EMMEDVE1
Subject: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init*
annotations

---
 drivers/iommu/fsl_pamu.c        | 12 ++++++------
 drivers/iommu/fsl_pamu_domain.c |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/iommu/fsl_pamu.c +0 -0
index d958e65..652c34d 100644

drivers/iommu/fsl_pamu.c struct pamu_isr_data { · line 53

Quoted 5 lines
drivers/iommu/fsl_pamu.c +1 -1
@@ -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.

Quoted 7 lines
Quoted 4 lines

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.

Quoted 5 lines

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.

author
#13 lore raw

Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations

In reply to a message not in the archive

Hello Joerg,

Quoted 5 lines · Emil Medve
---
 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,

A message that is not in the archive (sent off-list or not yet received): [email protected]

#15 lore raw

RE: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations

Hi Emil,

Quoted 17 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Tuesday, February 10, 2015 3:17 AM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; Sethi Varun-B16395
Subject: Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations

Hello Joerg,

Quoted 5 lines · Emil Medve
---
 drivers/iommu/fsl_pamu.c        | 12 ++++++------
 drivers/iommu/fsl_pamu_domain.c |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
Quoted 5 lines

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

A message that is not in the archive (sent off-list or not yet received): BY1PR0301MB122186F802612D1B8048722AEA240-M1kb196zaoruTkAIFHd/+ZwN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/[email protected]

author
#17 lore raw

Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations

Hello Varun,

Quoted 26 lines · On 02/09/2015 08:26 PM, Sethi Varun-B16395 wrote:

Hi Emil,

Quoted 17 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Tuesday, February 10, 2015 3:17 AM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; Sethi Varun-B16395
Subject: Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations

Hello Joerg,

Quoted 5 lines · Emil Medve
---
 drivers/iommu/fsl_pamu.c        | 12 ++++++------
 drivers/iommu/fsl_pamu_domain.c |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
Quoted 5 lines

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

Quoted 3 lines

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,

A message that is not in the archive (sent off-list or not yet received): [email protected]

#19 lore raw

RE: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations

Hi Emil,

Quoted 50 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, February 11, 2015 4:37 PM
To: Sethi Varun-B16395; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]
Subject: Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations

Hello Varun,

Quoted 28 lines · On 02/09/2015 08:26 PM, Sethi Varun-B16395 wrote:

Hi Emil,

Quoted 18 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Tuesday, February 10, 2015 3:17 AM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; Sethi Varun-B16395
Subject: Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init*
annotations

Hello Joerg,

Quoted 5 lines · Emil Medve
---
 drivers/iommu/fsl_pamu.c        | 12 ++++++------
 drivers/iommu/fsl_pamu_domain.c |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
Quoted 6 lines

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

Quoted 4 lines

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

Quoted 8 lines

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

#20 lore raw

RE: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations

In reply to Emil Medve

Hi Emil,

Quoted 69 lines

-----Original Message-----
From: Sethi Varun-B16395
Sent: Wednesday, February 11, 2015 5:00 PM
To: 'Emil Medve'; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]
Subject: RE: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations

Hi Emil,

Quoted 41 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, February 11, 2015 4:37 PM
To: Sethi Varun-B16395; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]
Subject: Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init*
annotations

Hello Varun,

Quoted 29 lines · On 02/09/2015 08:26 PM, Sethi Varun-B16395 wrote:

Hi Emil,

Quoted 25 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Tuesday, February 10, 2015 3:17 AM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; Sethi Varun-B16395
Subject: Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init*
annotations

Hello Joerg,

Quoted 5 lines · Emil Medve
---
 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

Quoted 7 lines
Quoted 5 lines

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.

Quoted 11 lines

(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

Quoted 9 lines
Quoted 4 lines

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

#21 lore raw

Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations

In reply to a message not in the archive
Quoted 4 lines · Emil Medve

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

author
#22 lore raw

PATCH 2/26 iommu/fsl: Use SVR_* instead of magic numbers

In reply to a message not in the archive
---
 drivers/iommu/fsl_pamu.c | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)
drivers/iommu/fsl_pamu.c +14 -13
index 652c34d..7d9f8a0 100644
@@ -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 */
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-3-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#24 lore raw

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

Quoted 61 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; Sethi Varun-B16395
Cc: Medve Emilian-EMMEDVE1
Subject: [PATCH 02/26] iommu/fsl: Use SVR_* instead of magic numbers

---
 drivers/iommu/fsl_pamu.c | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)
drivers/iommu/fsl_pamu.c index renamed from drivers/iommu/fsl_pamu.c +0 -0

652c34d..7d9f8a0 100644

drivers/iommu/fsl_pamu.c +14 -14
@@ -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 */
--
Quoted 1 line

2.2.2

author
#25 lore raw

PATCH 3/26 iommu/fsl: Remove unused/extra includes

In reply to a message not in the archive

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

---
 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(-)
drivers/iommu/fsl_pamu.c +3 -13
index 7d9f8a0..d3a9fff 100644
@@ -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
drivers/iommu/fsl_pamu.h +2 -0
index 8fc1a12..a7794b5 100644
@@ -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
drivers/iommu/fsl_pamu_domain.c +2 -18
index 48a72b3..7ea93ae 100644
@@ -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.
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-4-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#27 lore raw

RE: [PATCH 03/26] iommu/fsl: Remove unused/extra includes

Quoted 103 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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

---
 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(-)
drivers/iommu/fsl_pamu.c index renamed from drivers/iommu/fsl_pamu.c +0 -0

7d9f8a0..d3a9fff 100644

drivers/iommu/fsl_pamu.c +3 -13
@@ -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
drivers/iommu/fsl_pamu.h index renamed from drivers/iommu/fsl_pamu.h +0 -0

8fc1a12..a7794b5 100644

drivers/iommu/fsl_pamu.h +2 -0
@@ -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
(quoted diff) +0 -0

b/drivers/iommu/fsl_pamu_domain.c index 48a72b3..7ea93ae 100644

drivers/iommu/fsl_pamu_domain.c +2 -19
@@ -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.
--
Quoted 1 line

2.2.2

author
#28 lore raw

PATCH 4/26 iommu/fsl: Fix checkpatch type SPACE_BEFORE_TAB

In reply to a message not in the archive

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 */$

---
 arch/powerpc/include/asm/fsl_pamu_stash.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/include/asm/fsl_pamu_stash.h +2 -2
index caa1b21..38311c9 100644
@@ -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 */
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-5-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#30 lore raw

RE: [PATCH 04/26] iommu/fsl: Fix checkpatch type SPACE_BEFORE_TAB

Quoted 38 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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 */$

---
 arch/powerpc/include/asm/fsl_pamu_stash.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/include/asm/fsl_pamu_stash.h +2 -3
index caa1b21..38311c9 100644
@@ -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 */
--
Quoted 1 line

2.2.2

author
#31 lore raw

PATCH 5/26 iommu/fsl: Fix checkpatch type LINE_SPACING

In reply to a message not in the archive

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 +
+

---
 drivers/iommu/fsl_pamu.c        | 4 ----
 drivers/iommu/fsl_pamu_domain.c | 3 +--
 2 files changed, 1 insertion(+), 6 deletions(-)
drivers/iommu/fsl_pamu.c +0 -4
index d3a9fff..df6007c 100644
@@ -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;
 }
 
drivers/iommu/fsl_pamu_domain.c +1 -2
index 7ea93ae..dc38db5 100644
@@ -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,
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-6-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#33 lore raw

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

Quoted 114 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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

(quoted diff) +2 -0
+
+

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

(quoted diff) +2 -0
+
+

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

(quoted diff) +2 -0
+
+

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

(quoted diff) +2 -0
+
+

WARNING:LINE_SPACING: Missing a blank line after declarations
+ u32 win_cnt = dma_domain->win_cnt > 1 ? dma_domain-

Quoted 1 line

win_cnt : 0;

+ ret = pamu_set_liodn(liodn[i], dev, dma_domain,

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

(quoted diff) +2 -0
+
+

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

(quoted diff) +2 -0
+
+
---
 drivers/iommu/fsl_pamu.c        | 4 ----
 drivers/iommu/fsl_pamu_domain.c | 3 +--
 2 files changed, 1 insertion(+), 6 deletions(-)
drivers/iommu/fsl_pamu.c index renamed from drivers/iommu/fsl_pamu.c +0 -0

d3a9fff..df6007c 100644

drivers/iommu/fsl_pamu.c +0 -1
@@ -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.

drivers/iommu/fsl_pamu.c +0 -2
@@ -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)

drivers/iommu/fsl_pamu.c +0 -1
 		}
 	}
 
-
 	return IRQ_HANDLED;
 }
(quoted diff) +0 -0

b/drivers/iommu/fsl_pamu_domain.c index 7ea93ae..dc38db5 100644

drivers/iommu/fsl_pamu_domain.c +1 -0
@@ -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,
drivers/iommu/fsl_pamu_domain.c +0 -1
 					      &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,

drivers/iommu/fsl_pamu_domain.c +0 -1
 	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,
Quoted 3 lines

&dma_domain->dma_stash,
--
2.2.2

author
#34 lore raw

PATCH 6/26 iommu/fsl: Fix checkpatch type LEADING_SPACE

In reply to a message not in the archive

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)$

---
 drivers/iommu/fsl_pamu.c | 4 ++--
 drivers/iommu/fsl_pamu.h | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/iommu/fsl_pamu.c +2 -2
index df6007c..ccdc5e5 100644
@@ -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;
 }
 
 /*
drivers/iommu/fsl_pamu.h +1 -2
index a7794b5..52a91af 100644
@@ -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
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-7-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#36 lore raw

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

Quoted 53 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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)$

---
 drivers/iommu/fsl_pamu.c | 4 ++--
 drivers/iommu/fsl_pamu.h | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/iommu/fsl_pamu.c index renamed from drivers/iommu/fsl_pamu.c +0 -0

df6007c..ccdc5e5 100644

drivers/iommu/fsl_pamu.c +2 -2
@@ -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;
 }
 
 /*
drivers/iommu/fsl_pamu.h index renamed from drivers/iommu/fsl_pamu.h +0 -0

a7794b5..52a91af 100644

drivers/iommu/fsl_pamu.h +2 -3
@@ -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
--
Quoted 1 line

2.2.2

author
#37 lore raw

PATCH 7/26 iommu/fsl: Fix checkpath type BRACES

In reply to a message not in the archive

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
[...]

---
 drivers/iommu/fsl_pamu.c        | 9 +++------
 drivers/iommu/fsl_pamu_domain.c | 8 ++------
 2 files changed, 5 insertions(+), 12 deletions(-)
drivers/iommu/fsl_pamu.c +3 -6
index ccdc5e5..6b28dd8 100644
@@ -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,
drivers/iommu/fsl_pamu_domain.c +2 -6
index dc38db5..080ffa4 100644
@@ -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)
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-8-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#39 lore raw

RE: [PATCH 07/26] iommu/fsl: Fix checkpath type BRACES

Quoted 157 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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

(quoted diff) +3 -0
+               if (!paace) {
+                       return -ENOENT;
+               }

WARNING:BRACES: braces {} are not necessary for single statement blocks

(quoted diff) +3 -0
+               if (!paace) {
+                       return -ENOENT;
+               }

WARNING:BRACES: braces {} are not necessary for single statement blocks

(quoted diff) +3 -0
+       if (!ppaace) {
+               return -ENOENT;
+       }

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

(quoted diff) +2 -0
+{
+

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

(quoted diff) +2 -0
+
+}

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

(quoted diff) +2 -0
+
+}

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

(quoted diff) +2 -0
+
+}

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

(quoted diff) +2 -0
+       for (i = 0; i < num; i++) {
+

CHECK:BRACES: braces {} should be used on all arms of this statement

(quoted diff) +2 -0
+               if (pci_ctl->parent->iommu_group) {
[...]
+               } else
[...]
---
 drivers/iommu/fsl_pamu.c        | 9 +++------
 drivers/iommu/fsl_pamu_domain.c | 8 ++------
 2 files changed, 5 insertions(+), 12 deletions(-)
drivers/iommu/fsl_pamu.c index renamed from drivers/iommu/fsl_pamu.c +0 -0

ccdc5e5..6b28dd8 100644

drivers/iommu/fsl_pamu.c +3 -6
@@ -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

drivers/iommu/fsl_pamu_domain.c +0 -2
@@ -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

drivers/iommu/fsl_pamu_domain.c +0 -2
 	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,

drivers/iommu/fsl_pamu_domain.c +0 -1
 	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)

drivers/iommu/fsl_pamu_domain.c +2 -2
 		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)
--
Quoted 1 line

2.2.2

author
#40 lore raw

PATCH 8/26 iommu/fsl: Fix checkpatch type CODE_INDENT

In reply to a message not in the archive

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);$

---
 drivers/iommu/fsl_pamu.c        | 6 +++---
 drivers/iommu/fsl_pamu_domain.c | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/iommu/fsl_pamu.c +3 -3
index 6b28dd8..7f0181c 100644
@@ -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;
drivers/iommu/fsl_pamu_domain.c +2 -2
index 080ffa4..d5137dd 100644
@@ -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)
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-9-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#42 lore raw

RE: [PATCH 08/26] iommu/fsl: Fix checkpatch type CODE_INDENT

Quoted 78 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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);$

---
 drivers/iommu/fsl_pamu.c        | 6 +++---
 drivers/iommu/fsl_pamu_domain.c | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/iommu/fsl_pamu.c index renamed from drivers/iommu/fsl_pamu.c +0 -0

6b28dd8..7f0181c 100644

drivers/iommu/fsl_pamu.c +1 -1
@@ -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,

drivers/iommu/fsl_pamu.c +1 -2
-	           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,

drivers/iommu/fsl_pamu.c +1 -0
+				 phys_addr_t omt_phys)
 {
 	u32 *pc;
 	struct pamu_mmap_regs *pamu_regs;
(quoted diff) +0 -0

b/drivers/iommu/fsl_pamu_domain.c index 080ffa4..d5137dd 100644

drivers/iommu/fsl_pamu_domain.c +2 -2
@@ -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);
 }
 
Quoted 4 lines

static int configure_domain_geometry(struct iommu_domain *domain, void
*data)
--
2.2.2

author
#43 lore raw

PATCH 9/26 iommu/fsl: Fix checkpatch type ALLOC_SIZEOF_STRUCT

In reply to a message not in the archive

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)

---
 drivers/iommu/fsl_pamu.c        | 2 +-
 drivers/iommu/fsl_pamu_domain.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/fsl_pamu.c +1 -1
index 7f0181c..4f1926b 100644
@@ -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;
drivers/iommu/fsl_pamu_domain.c +1 -1
index d5137dd..9417207 100644
@@ -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);
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-10-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#45 lore raw

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

Quoted 58 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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-

Quoted 1 line

win_arr)...) over kzalloc(sizeof(struct dma_window)...)

+ dma_domain->win_arr = kzalloc(sizeof(struct dma_window)

---
 drivers/iommu/fsl_pamu.c        | 2 +-
 drivers/iommu/fsl_pamu_domain.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/fsl_pamu.c index renamed from drivers/iommu/fsl_pamu.c +0 -0

7f0181c..4f1926b 100644

drivers/iommu/fsl_pamu.c +1 -1
@@ -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");

drivers/iommu/fsl_pamu.c +0 -0
 		ret = -ENOMEM;
(quoted diff) +0 -0

b/drivers/iommu/fsl_pamu_domain.c index d5137dd..9417207 100644

drivers/iommu/fsl_pamu_domain.c +1 -1
@@ -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-
Quoted 1 line

win_arr) *

w_count,
GFP_ATOMIC);

drivers/iommu/fsl_pamu_domain.c +0 -0
 		if (!dma_domain->win_arr) {
 			spin_unlock_irqrestore(&dma_domain-
Quoted 1 line

domain_lock, flags);

Quoted 2 lines

--
2.2.2

author
#46 lore raw

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

In reply to a message not in the archive

WARNING:ALLOC_WITH_MULTIPLY: Prefer kcalloc over kzalloc with multiply
+ dma_domain->win_arr = kzalloc(sizeof(*dma_domain->win_arr) *
+ w_count, GFP_ATOMIC);

---
 drivers/iommu/fsl_pamu_domain.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/iommu/fsl_pamu_domain.c +3 -2
index 9417207..dcb9bb4 100644
@@ -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;
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-11-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#48 lore raw

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

Quoted 40 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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

(quoted diff) +3 -0
+               dma_domain->win_arr = kzalloc(sizeof(*dma_domain->win_arr) *
+                                                         w_count,
+ GFP_ATOMIC);
---
 drivers/iommu/fsl_pamu_domain.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/iommu/fsl_pamu_domain.c index 9417207..dcb9bb4 100644

drivers/iommu/fsl_pamu_domain.c +0 -1
@@ -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-
Quoted 1 line

win_arr) *

drivers/iommu/fsl_pamu_domain.c +0 -1
-							  w_count,

GFP_ATOMIC);

drivers/iommu/fsl_pamu_domain.c +3 -0
+		dma_domain->win_arr = kcalloc(w_count,
+					      sizeof(*dma_domain->win_arr),
+					      GFP_ATOMIC);
 		if (!dma_domain->win_arr) {
 			spin_unlock_irqrestore(&dma_domain-
Quoted 1 line

domain_lock, flags);

Quoted 3 lines

return -ENOMEM;
--
2.2.2

author
#49 lore raw

PATCH 11/26 iommu/fsl: Fix checkpatch type OOM_MESSAGE

In reply to a message not in the archive

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

---
 drivers/iommu/fsl_pamu.c | 1 -
 1 file changed, 1 deletion(-)
drivers/iommu/fsl_pamu.c +0 -1
index 4f1926b..6f9c976 100644
@@ -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;
 	}
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-12-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

#51 lore raw

RE: [PATCH 11/26] iommu/fsl: Fix checkpatch type OOM_MESSAGE

Hi Emil,

Quoted 30 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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

(quoted diff) +3 -0
+       if (!data) {
+               dev_err(&pdev->dev, "PAMU isr data memory allocation
+ failed\n");
---
 drivers/iommu/fsl_pamu.c | 1 -
 1 file changed, 1 deletion(-)
drivers/iommu/fsl_pamu.c index renamed from drivers/iommu/fsl_pamu.c +0 -0

4f1926b..6f9c976 100644

drivers/iommu/fsl_pamu.c +0 -1
@@ -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;

drivers/iommu/fsl_pamu.c static int __init fsl_pamu_probe(struct platform_device *pdev) · line 1046

Quoted 2 lines
drivers/iommu/fsl_pamu.c +0 -0
 		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

A message that is not in the archive (sent off-list or not yet received): BN3PR0301MB1219BCCB01E99D150D0753F6EA310-CEkquS/Gb81uuip9JPHoc5wN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/[email protected]

author
#53 lore raw

Re: [PATCH 11/26] iommu/fsl: Fix checkpatch type OOM_MESSAGE

Hello Varun,

Quoted 27 lines · On 01/30/2015 03:43 AM, Sethi Varun-B16395 wrote:

Hi Emil,

Quoted 25 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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

(quoted diff) +3 -0
+       if (!data) {
+               dev_err(&pdev->dev, "PAMU isr data memory allocation
+ failed\n");
---
 drivers/iommu/fsl_pamu.c | 1 -
 1 file changed, 1 deletion(-)
drivers/iommu/fsl_pamu.c index renamed from drivers/iommu/fsl_pamu.c +0 -0

4f1926b..6f9c976 100644

drivers/iommu/fsl_pamu.c +0 -0
@@ -1041,7 +1041,6 @@ static int __init fsl_pamu_probe(struct
 platform_device *pdev)
 
Quoted 9 lines

drivers/iommu/fsl_pamu.c static int __init fsl_pamu_probe(struct platform_device *pdev) · line 1046

Quoted 7 lines
drivers/iommu/fsl_pamu.c +0 -1
 	data = kzalloc(sizeof(*data), GFP_KERNEL);
 	if (!data) {
-		dev_err(&pdev->dev, "PAMU isr data memory allocation
 failed\n");
 		ret = -ENOMEM;
drivers/iommu/fsl_pamu.c +0 -0
 		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:

Quoted 3 lines

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,

A message that is not in the archive (sent off-list or not yet received): [email protected]

Acked-by
#55 lore raw

RE: [PATCH 11/26] iommu/fsl: Fix checkpatch type OOM_MESSAGE

Hi Emil,

Quoted 50 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Friday, January 30, 2015 7:49 PM
To: Sethi Varun-B16395; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]
Subject: Re: [PATCH 11/26] iommu/fsl: Fix checkpatch type OOM_MESSAGE

Hello Varun,

Quoted 11 lines · On 01/30/2015 03:43 AM, Sethi Varun-B16395 wrote:

Hi Emil,

Quoted 9 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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

Quoted 17 lines
Quoted 17 lines
(quoted diff) +3 -0
+       if (!data) {
+               dev_err(&pdev->dev, "PAMU isr data memory allocation
+ failed\n");
---
 drivers/iommu/fsl_pamu.c | 1 -
 1 file changed, 1 deletion(-)
drivers/iommu/fsl_pamu.c +0 -0

index
4f1926b..6f9c976 100644

drivers/iommu/fsl_pamu.c +0 -0
@@ -1041,7 +1041,6 @@ static int __init fsl_pamu_probe(struct
 platform_device *pdev)
 
Quoted 9 lines

drivers/iommu/fsl_pamu.c static int __init fsl_pamu_probe(struct platform_device *pdev) · line 1046

Quoted 7 lines
drivers/iommu/fsl_pamu.c +0 -1
 	data = kzalloc(sizeof(*data), GFP_KERNEL);
 	if (!data) {
-		dev_err(&pdev->dev, "PAMU isr data memory allocation
 failed\n");
 		ret = -ENOMEM;
drivers/iommu/fsl_pamu.c +0 -0
 		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.

Quoted 1 line

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

author
#56 lore raw

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

In reply to a message not in the archive

CHECK:TYPO_SPELLING: 'accomodate' may be misspelled - perhaps 'accommodate'?
+ * Hard coded value for the PAACT size to accomodate

---
 drivers/iommu/fsl_pamu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/fsl_pamu.h +1 -1
index 52a91af..86abc70 100644
@@ -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
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-13-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#58 lore raw

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

Quoted 33 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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

---
 drivers/iommu/fsl_pamu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/fsl_pamu.h index renamed from drivers/iommu/fsl_pamu.h +0 -0

52a91af..86abc70 100644

drivers/iommu/fsl_pamu.h +1 -2
@@ -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
--
Quoted 1 line

2.2.2

author
#59 lore raw

PATCH 13/26 iommu/fsl: Fix checkpatch type PREFER_PACKED

In reply to a message not in the archive

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

---
 drivers/iommu/fsl_pamu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/fsl_pamu.h +1 -1
index 86abc70..04dcd25 100644
@@ -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)
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-14-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#61 lore raw

RE: [PATCH 13/26] iommu/fsl: Fix checkpatch type PREFER_PACKED

Quoted 32 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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));

---
 drivers/iommu/fsl_pamu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/fsl_pamu.h index renamed from drivers/iommu/fsl_pamu.h +0 -0

86abc70..04dcd25 100644

drivers/iommu/fsl_pamu.h +1 -1
@@ -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)
Quoted 4 lines

#define SPAACT_SIZE (sizeof(struct paace) *
SPAACE_NUMBER_ENTRIES)
--
2.2.2

author
#62 lore raw

PATCH 14/26 iommu/fsl: Fix checkpatch type QUOTED_WHITESPACE_BEFORE_NEWLINE

In reply to a message not in the archive

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

---
 drivers/iommu/fsl_pamu_domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/fsl_pamu_domain.c +1 -1
index dcb9bb4..c9886ff 100644
@@ -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;
 	}
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-15-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#64 lore raw

RE: [PATCH 14/26] iommu/fsl: Fix checkpatch type QUOTED_WHITESPACE_BEFORE_NEWLINE

Quoted 36 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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");

---
 drivers/iommu/fsl_pamu_domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/iommu/fsl_pamu_domain.c index dcb9bb4..c9886ff 100644

drivers/iommu/fsl_pamu_domain.c +1 -1
@@ -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);
drivers/iommu/fsl_pamu_domain.c +0 -1
 		return -EINVAL;
 	}
--
Quoted 1 line

2.2.2

author
#65 lore raw

PATCH 15/26 iommu/fsl: Fix checkpatch type SPACING

In reply to a message not in the archive

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,

---
 drivers/iommu/fsl_pamu.c        | 2 +-
 drivers/iommu/fsl_pamu_domain.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/iommu/fsl_pamu.c +1 -1
index 6f9c976..18a604a 100644
@@ -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 */
drivers/iommu/fsl_pamu_domain.c +2 -2
index c9886ff..c7af760 100644
@@ -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;
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-16-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#67 lore raw

RE: [PATCH 15/26] iommu/fsl: Fix checkpatch type SPACING

Quoted 60 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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,

---
 drivers/iommu/fsl_pamu.c        | 2 +-
 drivers/iommu/fsl_pamu_domain.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/iommu/fsl_pamu.c index renamed from drivers/iommu/fsl_pamu.c +0 -0

6f9c976..18a604a 100644

drivers/iommu/fsl_pamu.c +1 -1
@@ -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,

drivers/iommu/fsl_pamu.c +0 -0
 				 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

drivers/iommu/fsl_pamu_domain.c +2 -2
@@ -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;
drivers/iommu/fsl_pamu_domain.c +0 -1
 	case DOMAIN_ATTR_FSL_PAMU_ENABLE:
 		*(int *)data = dma_domain->enabled;
--
Quoted 1 line

2.2.2

author
#68 lore raw

PATCH 16/26 iommu/fsl: Use a device pointer to make lines shorter

In reply to a message not in the archive
---
 drivers/iommu/fsl_pamu.c | 39 ++++++++++++++++++---------------------
 1 file changed, 18 insertions(+), 21 deletions(-)
drivers/iommu/fsl_pamu.c +18 -21
index 18a604a..22b72e2 100644
@@ -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;
 	}
 
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-17-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#70 lore raw

RE: [PATCH 16/26] iommu/fsl: Use a device pointer to make lines shorter

Quoted 159 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; Sethi Varun-B16395
Cc: Medve Emilian-EMMEDVE1
Subject: [PATCH 16/26] iommu/fsl: Use a device pointer to make lines
shorter

---
 drivers/iommu/fsl_pamu.c | 39 ++++++++++++++++++---------------------
 1 file changed, 18 insertions(+), 21 deletions(-)
drivers/iommu/fsl_pamu.c index renamed from drivers/iommu/fsl_pamu.c +0 -0

18a604a..22b72e2 100644

drivers/iommu/fsl_pamu.c +6 -5
@@ -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;
drivers/iommu/fsl_pamu.c +3 -4
 	}
@@ -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;
drivers/iommu/fsl_pamu.c +1 -1
 	}
@@ -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;
drivers/iommu/fsl_pamu.c +1 -1
 	}
@@ -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");
drivers/iommu/fsl_pamu.c +1 -1
 		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;
drivers/iommu/fsl_pamu.c +1 -2
 	}
@@ -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 */

drivers/iommu/fsl_pamu.c +1 -2
@@ -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 "

drivers/iommu/fsl_pamu.c +1 -2
-			"%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",

drivers/iommu/fsl_pamu.c +2 -2
+			&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");

drivers/iommu/fsl_pamu.c +1 -1
 			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;

}

Quoted 2 lines

--
2.2.2

author
#71 lore raw

PATCH 17/26 iommu/fsl: Remove pr/dev_*() prefixes

In reply to a message not in the archive

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

---
 drivers/iommu/fsl_pamu.c        |  2 +-
 drivers/iommu/fsl_pamu_domain.c | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/iommu/fsl_pamu.c +1 -1
index 22b72e2..e46c75f 100644
@@ -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;
 	}
 
drivers/iommu/fsl_pamu_domain.c +6 -6
index c7af760..3e7954a 100644
@@ -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;
 	}
 
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-18-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#73 lore raw

RE: [PATCH 17/26] iommu/fsl: Remove pr/dev_*() prefixes

Quoted 102 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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

---
 drivers/iommu/fsl_pamu.c        |  2 +-
 drivers/iommu/fsl_pamu_domain.c | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/iommu/fsl_pamu.c index renamed from drivers/iommu/fsl_pamu.c +0 -0

22b72e2..e46c75f 100644

drivers/iommu/fsl_pamu.c +1 -1
@@ -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;
 	}
(quoted diff) +0 -0

b/drivers/iommu/fsl_pamu_domain.c index c7af760..3e7954a 100644

drivers/iommu/fsl_pamu_domain.c +1 -1
@@ -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",
drivers/iommu/fsl_pamu_domain.c +1 -1
 					 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);
drivers/iommu/fsl_pamu_domain.c +3 -2
 	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);
drivers/iommu/fsl_pamu_domain.c +2 -2
 				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;

}

Quoted 2 lines

--
2.2.2

author
#74 lore raw

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

In reply to a message not in the archive

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));

---
 drivers/iommu/fsl_pamu.c        | 29 +++++++++---------
 drivers/iommu/fsl_pamu_domain.c | 67 +++++++++++++++++++----------------------
 2 files changed, 46 insertions(+), 50 deletions(-)
drivers/iommu/fsl_pamu.c +15 -14
index e46c75f..dc3955f 100644
@@ -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;
 	}
drivers/iommu/fsl_pamu_domain.c +31 -36

179 lines not on this page · raw message

Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-19-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#76 lore raw

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

Quoted 497 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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

(quoted diff) +2 -0
+               set_bf(paace->addr_bitfields, PAACE_AF_V,
+                        PAACE_V_INVALID);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

(quoted diff) +2 -0
+               set_bf(paace->addr_bitfields, PAACE_AF_AP,
+                        PAACE_AP_PERMS_DENIED);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

(quoted diff) +2 -0
+       set_bf(ppaace->addr_bitfields, PPAACE_AF_WSE,
+               map_addrspace_size_to_wse(win_size));

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

(quoted diff) +2 -0
+                       pr_debug("can't find next-level-cache at %s\n",
+                               node->full_name);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

(quoted diff) +2 -0
+       out_be32((u32 *)(pamu_reg_base + PAMU_PICS),
+                       PAMU_ACCESS_VIOLATION_ENABLE);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

(quoted diff) +2 -0
+                       set_bf(ppaace->impl_attr, PAACE_IA_ATM,
+                               PAACE_ATM_NO_XLATE);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

(quoted diff) +2 -0
+                       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

(quoted diff) +2 -0
+                       phys = make64(in_be32(p + PAMU_POEAH),
+                               in_be32(p + PAMU_POEAL));

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

(quoted diff) +2 -0
+               setup_one_pamu(pamu_reg_base, pamu_reg_off, ppaact_phys,
+                                spaact_phys, omt_phys);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

(quoted diff) +2 -0
+       fsl_pamu_domain_cache = kmem_cache_create("fsl_pamu_domain",
+                                        sizeof(struct fsl_dma_domain),

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

(quoted diff) +3 -0
+       iommu_devinfo_cache = kmem_cache_create("iommu_devinfo",
+                                        sizeof(struct
+ device_domain_info),

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

(quoted diff) +2 -0
+               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

(quoted diff) +2 -0
+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

(quoted diff) +2 -0
+       if ((iova < domain->geometry.aperture_start) ||
+               iova > (domain->geometry.aperture_end))

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

(quoted diff) +2 -0
+               ret = pamu_set_liodn(info->liodn, info->dev, dma_domain,
+                                     geom_attr, win_cnt);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

(quoted diff) +2 -0
+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

(quoted diff) +2 -0
+                       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

(quoted diff) +2 -0
+                       ret = pamu_set_liodn(liodn[i], dev, dma_domain,
+                                             &domain->geometry,

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

(quoted diff) +2 -0
+               ret = handle_attach_device(dma_domain, dev,
+                                        liodn, liodn_cnt);

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

(quoted diff) +2 -0
+static void fsl_pamu_detach_device(struct iommu_domain *domain,
+                                     struct device *dev)

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

(quoted diff) +2 -0
+       if (check_size(geom_size, geom_attr->aperture_start) ||
+               !geom_attr->force_aperture) {

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

(quoted diff) +2 -0
+       memcpy(&dma_domain->dma_stash, stash_attr,
+                sizeof(struct pamu_stash_attribute));

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

(quoted diff) +2 -0
+       list_for_each_entry(info, &dma_domain->devices,
+                                link) {

CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

(quoted diff) +2 -0
+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

(quoted diff) +2 -0
+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-

Quoted 1 line

geometry,

+ ((w_count > 1) ? w_count : 0));

---
 drivers/iommu/fsl_pamu.c        | 29 +++++++++---------
 drivers/iommu/fsl_pamu_domain.c | 67 +++++++++++++++++++-------------
---------
 2 files changed, 46 insertions(+), 50 deletions(-)
drivers/iommu/fsl_pamu.c index renamed from drivers/iommu/fsl_pamu.c +0 -0

e46c75f..dc3955f 100644

drivers/iommu/fsl_pamu.c +2 -3
@@ -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);
 	}
 
drivers/iommu/fsl_pamu.c +2 -2
 	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

drivers/iommu/fsl_pamu.c +1 -1
 	 */
 
 	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);

drivers/iommu/fsl_pamu.c +2 -2
 	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));

drivers/iommu/fsl_pamu.c +0 -0
 			pr_emerg("AVS1=%08x\n", avs1);
 			pr_emerg("AVS2=%08x\n", in_be32(p +

PAMU_AVS2));

drivers/iommu/fsl_pamu.c +0 -1
-			pr_emerg("AVA=%016llx\n", make64(in_be32(p +

PAMU_AVAH),

drivers/iommu/fsl_pamu.c +3 -1
-				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));

drivers/iommu/fsl_pamu.c +0 -1
-			pr_emerg("POEA=%016llx\n", make64(in_be32(p +

PAMU_POEAH),

drivers/iommu/fsl_pamu.c +5 -3
-				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);
drivers/iommu/fsl_pamu.c +0 -0
 		/* Disable PAMU bypass for this PAMU */
 		pamubypenr &= ~pamu_counter;
 	}
(quoted diff) +0 -0

b/drivers/iommu/fsl_pamu_domain.c index 3e7954a..51a6750 100644

drivers/iommu/fsl_pamu_domain.c +8 -9
@@ -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) {
drivers/iommu/fsl_pamu_domain.c +1 -2
 		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);
 
drivers/iommu/fsl_pamu_domain.c +1 -1
 	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;
drivers/iommu/fsl_pamu_domain.c +3 -3
 	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;
drivers/iommu/fsl_pamu_domain.c +2 -2
 	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,

drivers/iommu/fsl_pamu_domain.c +3 -3
 	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;
drivers/iommu/fsl_pamu_domain.c +1 -1
 	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;
drivers/iommu/fsl_pamu_domain.c +1 -2
 			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)
drivers/iommu/fsl_pamu_domain.c +1 -2
 				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 {
drivers/iommu/fsl_pamu_domain.c +5 -5
 		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);
drivers/iommu/fsl_pamu_domain.c +1 -1
 	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,
drivers/iommu/fsl_pamu_domain.c +0 -0
 					    stash_attr->cpu);
@@ -799,8 +795,7 @@ static int configure_domain_dma_state(struct

fsl_dma_domain *dma_domain, bool en

drivers/iommu/fsl_pamu_domain.c +4 -5
 	}
 
 	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) {
drivers/iommu/fsl_pamu_domain.c +0 -1
 		kfree(dma_domain->win_arr);
 		dma_domain->win_arr = kcalloc(w_count,
--
Quoted 1 line

2.2.2

author
#77 lore raw

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

In reply to a message not in the archive
---
 drivers/iommu/fsl_pamu.c        | 24 ++++++++++++------------
 drivers/iommu/fsl_pamu_domain.c |  6 +++---
 2 files changed, 15 insertions(+), 15 deletions(-)
drivers/iommu/fsl_pamu.c +12 -12
index dc3955f..ba5d1e0 100644
@@ -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();
 
drivers/iommu/fsl_pamu_domain.c +3 -3
index 51a6750..eea2212 100644
@@ -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;
 
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-20-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#79 lore raw

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

Quoted 141 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; Sethi Varun-B16395
Cc: Medve Emilian-EMMEDVE1
Subject: [PATCH 19/26] iommu/fsl: Fix some comments alignment

---
 drivers/iommu/fsl_pamu.c        | 24 ++++++++++++------------
 drivers/iommu/fsl_pamu_domain.c |  6 +++---
 2 files changed, 15 insertions(+), 15 deletions(-)
drivers/iommu/fsl_pamu.c index renamed from drivers/iommu/fsl_pamu.c +0 -0

dc3955f..ba5d1e0 100644

drivers/iommu/fsl_pamu.c +0 -1
@@ -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*/

drivers/iommu/fsl_pamu.c +1 -0
+	void __iomem *pamu_reg_base;	/* Base address of PAMU

regs */

drivers/iommu/fsl_pamu.c +1 -1
 	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.

drivers/iommu/fsl_pamu.c +1 -1
-*/
+ */
 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.
*

drivers/iommu/fsl_pamu.c +6 -7
-*/
+ */
 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)

drivers/iommu/fsl_pamu.c +0 -0
 	case QMAN_PORTAL_PAACE:
 		set_bf(ppaace->impl_attr, PAACE_IA_OTM,

PAACE_OTM_INDEXED);

drivers/iommu/fsl_pamu.c +1 -1
 		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));

drivers/iommu/fsl_pamu.c +1 -1
 		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;
drivers/iommu/fsl_pamu.c +1 -1
 	}
@@ -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();
(quoted diff) +0 -0

b/drivers/iommu/fsl_pamu_domain.c index 51a6750..eea2212 100644

drivers/iommu/fsl_pamu_domain.c +2 -2
@@ -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)  {
drivers/iommu/fsl_pamu_domain.c +1 -1
 	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;

Quoted 2 lines

--
2.2.2

author
#80 lore raw

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

In reply to a message not in the archive
---
 drivers/iommu/fsl_pamu.h        |  2 +-
 drivers/iommu/fsl_pamu_domain.c | 15 ++++++---------
 2 files changed, 7 insertions(+), 10 deletions(-)
drivers/iommu/fsl_pamu.h +1 -1
index 04dcd25..342ac6d 100644
@@ -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
 
drivers/iommu/fsl_pamu_domain.c +6 -9
index eea2212..ae21305 100644
@@ -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;
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-21-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#82 lore raw

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

Quoted 89 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; Sethi Varun-B16395
Cc: Medve Emilian-EMMEDVE1
Subject: [PATCH 20/26] iommu/fsl: Fix alignment of some stray lines

---
 drivers/iommu/fsl_pamu.h        |  2 +-
 drivers/iommu/fsl_pamu_domain.c | 15 ++++++---------
 2 files changed, 7 insertions(+), 10 deletions(-)
drivers/iommu/fsl_pamu.h index renamed from drivers/iommu/fsl_pamu.h +0 -0

04dcd25..342ac6d 100644

drivers/iommu/fsl_pamu.h +1 -1
@@ -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

(quoted diff) +0 -0

b/drivers/iommu/fsl_pamu_domain.c index eea2212..ae21305 100644

drivers/iommu/fsl_pamu_domain.c +1 -2
@@ -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) {

drivers/iommu/fsl_pamu_domain.c +2 -4
-	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-
Quoted 1 line

win_cnt, i,

drivers/iommu/fsl_pamu_domain.c +0 -0
 						 sub_win_ptr[i].size,
@@ -180,8 +177,8 @@ static int update_liodn(int liodn, struct

fsl_dma_domain *dma_domain, u32 wnd_nr

drivers/iommu/fsl_pamu_domain.c +0 -1
 					 wnd->size,
 					 ~(u32)0,
 					 wnd->paddr >> PAMU_PAGE_SHIFT,
-					dma_domain->snoop_id,

dma_domain->stash_id,

drivers/iommu/fsl_pamu_domain.c +1 -1
-					0, wnd->prot);
+					 dma_domain->snoop_id,

dma_domain->stash_id,

drivers/iommu/fsl_pamu_domain.c +1 -0
+					 0, wnd->prot);
 		if (ret)
 			pr_debug("Window reconfiguration failed for liodn

%d\n", liodn);

drivers/iommu/fsl_pamu_domain.c +1 -1
 	}
@@ -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;
 	}
 
Quoted 3 lines

return ret;
--
2.2.2

author
#83 lore raw

PATCH 21/26 iommu/fsl: Fix checkpatch type LONG_LINE

In reply to a message not in the archive

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);

---
 drivers/iommu/fsl_pamu.c        | 15 ++++++++++-----
 drivers/iommu/fsl_pamu_domain.c | 18 ++++++++++++------
 2 files changed, 22 insertions(+), 11 deletions(-)
drivers/iommu/fsl_pamu.c +10 -5
index ba5d1e0..3f83259 100644
@@ -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);
 		}
drivers/iommu/fsl_pamu_domain.c +12 -6
index ae21305..38c26be 100644
@@ -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;
 			}
 		}
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-22-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#85 lore raw

RE: [PATCH 21/26] iommu/fsl: Fix checkpatch type LONG_LINE

Quoted 212 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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

(quoted diff) +1 -0
+		pr_debug("window size too small or not a power of two

%pa\n",
+&win_size);

WARNING:LONG_LINE: line over 80 characters

(quoted diff) +1 -0
+				pr_debug("missing cache-stash-id at %s\n",

node->full_name);

ARNING:LONG_LINE: line over 80 characters

(quoted diff) +1 -0
+				pr_debug("missing cache-stash-id at %s\n",

node->full_name);

WARNING:LONG_LINE: line over 80 characters

(quoted diff) +1 -0
+					pr_emerg("PAACE[%u]=%08x\n", j,

in_be32(paace + j));

WARNING:LONG_LINE: line over 80 characters

(quoted diff) +1 -0
+				pr_emerg("Disabling liodn %x\n", avs1 >>

PAMU_AVS1_LIODN_SHIFT);

WARNING:LONG_LINE: line over 80 characters

(quoted diff) +1 -0
+			pr_debug("Subwindow reconfiguration failed for

liodn %d\n", liodn);

WARNING:LONG_LINE: line over 80 characters

(quoted diff) +1 -0
+			pr_debug("Window reconfiguration failed for liodn

%d\n", liodn);

WARNING:LONG_LINE: line over 80 characters

(quoted diff) +1 -0
+		pr_debug("Windows not configured, stash destination

update failed for
+liodn %d\n", liodn);

WARNING:LONG_LINE: line over 80 characters

(quoted diff) +1 -0
+			pr_debug("Failed to update SPAACE %d field for

liodn %d\n ", i,
+liodn);

WARNING:LONG_LINE: line over 80 characters

(quoted diff) +1 -0
+		pr_debug("PAACE configuration failed for liodn %d, win_cnt

=%d\n",
+liodn, win_cnt);

WARNING:LONG_LINE: line over 80 characters

(quoted diff) +1 -0
+				pr_debug("SPAACE configuration failed for

liodn %d\n", liodn);

---
 drivers/iommu/fsl_pamu.c        | 15 ++++++++++-----
 drivers/iommu/fsl_pamu_domain.c | 18 ++++++++++++------
 2 files changed, 22 insertions(+), 11 deletions(-)
drivers/iommu/fsl_pamu.c index renamed from drivers/iommu/fsl_pamu.c +0 -0

ba5d1e0..3f83259 100644

drivers/iommu/fsl_pamu.c +2 -1
@@ -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);
drivers/iommu/fsl_pamu.c +2 -1
 		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;
drivers/iommu/fsl_pamu.c +2 -1
 			}
@@ -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;
drivers/iommu/fsl_pamu.c +2 -1
 			}
@@ -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));
 			}
 
drivers/iommu/fsl_pamu.c +1 -0
 			/* 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);

drivers/iommu/fsl_pamu.c +0 -1
 				BUG_ON(ret);
-				pr_emerg("Disabling liodn %x\n", avs1 >>

PAMU_AVS1_LIODN_SHIFT);

drivers/iommu/fsl_pamu.c +2 -0
+				pr_emerg("Disabling liodn %x\n",
+					 avs1 >> PAMU_AVS1_LIODN_SHIFT);
 			}
 			out_be32((p + PAMU_PICS), pics);
 		}
(quoted diff) +0 -0

b/drivers/iommu/fsl_pamu_domain.c index ae21305..38c26be 100644

drivers/iommu/fsl_pamu_domain.c +0 -0
@@ -167,7 +167,8 @@ static int update_liodn(int liodn, struct

fsl_dma_domain *dma_domain, u32 wnd_nr

drivers/iommu/fsl_pamu_domain.c +0 -1
 					 (wnd_nr > 0) ? 1 : 0,
 					 wnd->prot);
 		if (ret)
-			pr_debug("Subwindow reconfiguration failed for

liodn %d\n", liodn);

drivers/iommu/fsl_pamu_domain.c +1 -0
+			pr_debug("Subwindow reconfiguration failed for

liodn %d\n",

drivers/iommu/fsl_pamu_domain.c +1 -0
+				 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,

drivers/iommu/fsl_pamu_domain.c +0 -1
 					 0, wnd->prot);
 		if (ret)
-			pr_debug("Window reconfiguration failed for liodn

%d\n", liodn);

drivers/iommu/fsl_pamu_domain.c +1 -0
+			pr_debug("Window reconfiguration failed for liodn

%d\n",

drivers/iommu/fsl_pamu_domain.c +1 -0
+				 liodn);
 	}
 
 	spin_unlock_irqrestore(&iommu_lock, flags); @@ -196,7 +198,8 @@

static int update_liodn_stash(int liodn, struct fsl_dma_domain *dma_domain,

drivers/iommu/fsl_pamu_domain.c +0 -1
 	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);

drivers/iommu/fsl_pamu_domain.c +1 -0
+		pr_debug("Windows not configured, stash destination

update failed for liodn %d\n",

drivers/iommu/fsl_pamu_domain.c +3 -1
+			 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);
drivers/iommu/fsl_pamu_domain.c +2 -1
 			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);
drivers/iommu/fsl_pamu_domain.c +2 -1
 		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);
drivers/iommu/fsl_pamu_domain.c +0 -1
 				return ret;
 			}
 		}
--
Quoted 1 line

2.2.2

author
#86 lore raw

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

In reply to a message not in the archive

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?

---
 drivers/iommu/fsl_pamu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/fsl_pamu.c +2 -2
index 3f83259..1d9273a 100644
@@ -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;
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-23-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#88 lore raw

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

Quoted 43 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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?

---
 drivers/iommu/fsl_pamu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/fsl_pamu.c index renamed from drivers/iommu/fsl_pamu.c +0 -0

3f83259..1d9273a 100644

drivers/iommu/fsl_pamu.c +1 -1
@@ -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)

drivers/iommu/fsl_pamu.c +1 -2
 	}
 }
 
-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;
--
Quoted 1 line

2.2.2

author
#89 lore raw

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

In reply to a message not in the archive

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

---
 drivers/iommu/fsl_pamu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iommu/fsl_pamu.c +3 -3
index 1d9273a..7a4665d 100644
@@ -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);
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-24-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#91 lore raw

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

Quoted 57 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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

---
 drivers/iommu/fsl_pamu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iommu/fsl_pamu.c index renamed from drivers/iommu/fsl_pamu.c +0 -0

1d9273a..7a4665d 100644

drivers/iommu/fsl_pamu.c +1 -1
@@ -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",
drivers/iommu/fsl_pamu.c +1 -1
 					 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) {
drivers/iommu/fsl_pamu.c +1 -2
 				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);
--
Quoted 1 line

2.2.2

author
#92 lore raw

PATCH 24/26 iommu/fsl: Remove unneeded semicolon

In reply to a message not in the archive

drivers/iommu/fsl_pamu_domain.c:859:2-3: Unneeded semicolon drivers/iommu/fsl_pamu_domain.c:833:2-3: Unneeded semicolon

---
 drivers/iommu/fsl_pamu_domain.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/fsl_pamu_domain.c +2 -2
index 38c26be..ebbc396 100644
@@ -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;
 }
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-25-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#94 lore raw

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

Quoted 41 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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

---
 drivers/iommu/fsl_pamu_domain.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/iommu/fsl_pamu_domain.c index 38c26be..ebbc396 100644

drivers/iommu/fsl_pamu_domain.c +1 -1
@@ -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;

}

drivers/iommu/fsl_pamu_domain.c +1 -1
@@ -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;
Quoted 3 lines

}
--
2.2.2

author
#95 lore raw

PATCH 25/26 iommu/fsl: Don't use integers values with bool type

In reply to a message not in the archive

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

---
 drivers/iommu/fsl_pamu_domain.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/iommu/fsl_pamu_domain.c +1 -4
index ebbc396..36622e2 100644
@@ -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 */
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-26-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#97 lore raw

RE: [PATCH 25/26] iommu/fsl: Don't use integers values with bool type

Quoted 34 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; 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

---
 drivers/iommu/fsl_pamu_domain.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
(quoted diff) +0 -0

b/drivers/iommu/fsl_pamu_domain.c index ebbc396..36622e2 100644

drivers/iommu/fsl_pamu_domain.c +1 -4
@@ -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;
 }
 
Quoted 4 lines

/* Get iommu group information from peer devices or devices on the parent
bus */
--
2.2.2

author
#98 lore raw

PATCH 26/26 iommu/fsl: Remove extra paranthesis

In reply to a message not in the archive
---
 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(-)
drivers/iommu/fsl_pamu.c +2 -2
index 7a4665d..ea49d9f 100644
@@ -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 */
drivers/iommu/fsl_pamu.h +2 -2
index 342ac6d..aab723f 100644
@@ -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 */
drivers/iommu/fsl_pamu_domain.c +4 -4
index 36622e2..ceebd28 100644
@@ -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,
Signature · 1 line
2.2.2

A message that is not in the archive (sent off-list or not yet received): 1422455698-3074-27-git-send-email-Emilian.Medve-eDlz3WWmN0ll57MIdRCFDg@public.gmane.org

Acked-by
#100 lore raw

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

Quoted 95 lines

-----Original Message-----
From: Emil Medve [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 8:05 PM
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; [email protected]; Sethi Varun-B16395
Cc: Medve Emilian-EMMEDVE1
Subject: [PATCH 26/26] iommu/fsl: Remove extra paranthesis

---
 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(-)
drivers/iommu/fsl_pamu.c index renamed from drivers/iommu/fsl_pamu.c +0 -0

7a4665d..ea49d9f 100644

drivers/iommu/fsl_pamu.c +2 -2
@@ -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);

drivers/iommu/fsl_pamu.c +0 -0
 			BUG_ON(!paace);
 			/* check if we got a violation for a disabled LIODN */
drivers/iommu/fsl_pamu.h index renamed from drivers/iommu/fsl_pamu.h +0 -0

342ac6d..aab723f 100644

drivers/iommu/fsl_pamu.h +2 -2
@@ -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 */

(quoted diff) +0 -0

b/drivers/iommu/fsl_pamu_domain.c index 36622e2..ceebd28 100644

drivers/iommu/fsl_pamu_domain.c +0 -0
@@ -84,7 +84,7 @@ static phys_addr_t get_phys_addr(struct

fsl_dma_domain *dma_domain, dma_addr_t i

drivers/iommu/fsl_pamu_domain.c +3 -3
 	}
 
 	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)

drivers/iommu/fsl_pamu_domain.c +0 -0
 	}
 
 	ret = pamu_set_domain_geometry(dma_domain, &domain-
Quoted 1 line

geometry,

drivers/iommu/fsl_pamu_domain.c +1 -2
-				       ((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,
--
Quoted 1 line

2.2.2

#101 lore raw
In reply to a message not in the archive

Varun,

Quoted 25 lines · 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

Quoted 8 lines

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

Acked-by
#103 lore raw

Hi Joerg,

Quoted 45 lines

-----Original Message-----
From: Joerg Roedel [mailto:[email protected]]
Sent: Friday, January 30, 2015 6:01 PM
To: Medve Emilian-EMMEDVE1
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; [email protected]; Sethi Varun-B16395
Subject: Re: [PATCH 00/26] iommu/fsl: Various cleanup

Varun,

Quoted 26 lines · 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

Quoted 8 lines

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

Quoted 2 lines

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?

A message that is not in the archive (sent off-list or not yet received): BN3PR0301MB12194ECBA7501AFE17F34F69EA310-CEkquS/Gb81uuip9JPHoc5wN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/[email protected]

#105 lore raw
Quoted 1 line · Varun Sethi

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.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#107 lore raw

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

Quoted 19 lines

-----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; [email protected]; Medve Emilian- EMMEDVE1
Subject: Re: [PATCH 00/26] iommu/fsl: Various cleanup

Quoted 1 line · Varun Sethi

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

#108 lore raw
In reply to a message not in the archive
Quoted 7 lines · 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):

These should all be merged into one patch, IMHO.

A message that is not in the archive (sent off-list or not yet received): CAOZdJXXk5L7AFwryKXiTemw=jw+VXXXBZXdapzgzs4APC0PLtQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

author
#110 lore raw

Hello Timur,

Quoted 10 lines · Timur Tabi
Quoted 7 lines · 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):

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,

A message that is not in the archive (sent off-list or not yet received): [email protected]

#112 lore raw
Quoted 2 lines · Emil Medve

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.