iommu/fsl: Various cleanup
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
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
@@ -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
@@ -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
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* annotationsSigned-off-by Emil Medve <[email protected]>--- 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
-0d958e65..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]
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* annotationsSigned-off-by Emil Medve <[email protected]>--- 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
-0d958e65..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
-1static 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]
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* annotationsHello 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*
annotationsSigned-off-by Emil Medve <[email protected]>--- 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@@ -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
-1static 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()andsetup_omt(); both__initfunctions. 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]
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* annotationsHello 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*
annotationsSigned-off-by Emil Medve <[email protected]>--- 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
-0drivers/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()andsetup_omt(); both__initfunctions. 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]
Varun Sethi
Acked-byRE: [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* annotationsHello 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*
annotationsHello 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*
annotationsSigned-off-by Emil Medve <[email protected]>--- 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
-0drivers/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()andsetup_omt(); both__initfunctions. 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 tofsl_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.
Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
In reply to a message not in the archiveHello Joerg,
Quoted 5 lines · Emil Medve
Signed-off-by Emil Medve <[email protected]>--- 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]
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* annotationsHello Joerg,
Quoted 5 lines · Emil Medve
Signed-off-by Emil Medve <[email protected]>--- 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]
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* annotationsHello Joerg,
Quoted 5 lines · Emil Medve
Signed-off-by Emil Medve <[email protected]>--- 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]
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* annotationsHello 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*
annotationsHello Joerg,
Quoted 5 lines · Emil Medve
Signed-off-by Emil Medve <[email protected]>--- 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 shortlyQuoted 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) Oncefsl_of_pamu_drivergets 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
RE: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
In reply to Emil MedveHi 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* annotationsHi 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*
annotationsHello 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*
annotationsHello Joerg,
Quoted 5 lines · Emil Medve
Signed-off-by Emil Medve <[email protected]>--- 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 shortlyQuoted 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) Oncefsl_of_pamu_drivergets released that klist becomes "corrupted" and, depending on how said memory gets re-used, traversing it for any reason will end up into a crashAnyway, 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_driverstructure 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
Re: [PATCH v2 01/26] iommu/fsl: Sprinkle some __init* annotations
In reply to a message not in the archiveQuoted 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
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
@@ -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
Varun Sethi
Acked-byRE: [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 numbersSigned-off-by Emil Medve <[email protected]>--- 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
-0652c34d..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
PATCH 3/26 iommu/fsl: Remove unused/extra includes
In reply to a message not in the archivelinux/modules.h - drivers can't be a modulelinux/bootmem.h - no boot time memory allocator is usedlinux/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
@@ -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
@@ -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
@@ -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
Varun Sethi
Acked-byRE: [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 modulelinux/bootmem.h- no boot time memory allocator is usedlinux/notifier.h- not used
etc.Factorize common includes into
fsl_pamu.hSigned-off-by Emil Medve <[email protected]>--- 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
-07d9f8a0..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 0x01drivers/iommu/fsl_pamu.h index renamed from drivers/iommu/fsl_pamu.h +0
-08fc1a12..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.cindex 48a72b3..7ea93ae 100644drivers/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
PATCH 4/26 iommu/fsl: Fix checkpatch type SPACE_BEFORE_TAB
In reply to a message not in the archiveWARNING: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
@@ -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
Varun Sethi
Acked-byRE: [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 typeSPACE_BEFORE_TABWARNING:SPACE_BEFORE_TAB: please, no space before tabs +^Iu32 ^Icpu;^I/* cpu number */$
WARNING:SPACE_BEFORE_TAB: please, no space before tabs +^Iu32 ^Icache;^I/* cache to stash to: L1,L2,L3 */$
Signed-off-by Emil Medve <[email protected]>--- 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@@ -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
PATCH 5/26 iommu/fsl: Fix checkpatch type LINE_SPACING
In reply to a message not in the archiveCHECK: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
@@ -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
@@ -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
Varun Sethi
Acked-byRE: [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 typeLINE_SPACINGCHECK: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
+ u32win_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+ +Signed-off-by Emil Medve <[email protected]>--- 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
-0d3a9fff..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_tpamu_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.cindex 7ea93ae..dc38db5 100644drivers/iommu/fsl_pamu_domain.c +1
-0@@ -633,6 +633,7 @@ static int handle_attach_device(structfsl_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(structiommu_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(structiommu_domain*domain,drivers/iommu/fsl_pamu_domain.c +0
-1struct 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
PATCH 6/26 iommu/fsl: Fix checkpatch type LEADING_SPACE
In reply to a message not in the archiveWARNING: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
@@ -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
@@ -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
Varun Sethi
Acked-byRE: [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 typeLEADING_SPACEWARNING:LEADING_SPACE: please, no spaces at the start of a line
+ return__ffs(subwindow_cnt)- 1;$WARNING:LEADING_SPACE: please, no spaces at the start of a line
+ (PAACE_ATM_WINDOW_XLATE| PAACE_ATM_PAGE_XLATE)$Signed-off-by Emil Medve <[email protected]>--- 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
-0df6007c..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
-0a7794b5..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
PATCH 7/26 iommu/fsl: Fix checkpath type BRACES
In reply to a message not in the archiveWARNING: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
@@ -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
@@ -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 dif (!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
Varun Sethi
Acked-byRE: [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 BRACESWARNING: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) { + } elseSigned-off-by Emil Medve <[email protected]>--- 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
-0ccdc5e5..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 --gita/drivers/iommu/fsl_pamu_domain.cb/drivers/iommu/fsl_pamu_domain.cindex dc38db5..080ffa4 100644drivers/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(structfsl_dma_domain*dma_domain, int liodn, struct ddrivers/iommu/fsl_pamu_domain.c +0
-2if (!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, u32wnd_nr, @@ -616,7 +612,6 @@ static int handle_attach_device(structfsl_dma_domain*dma_domain,drivers/iommu/fsl_pamu_domain.c +0
-1spin_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(structpci_dev*pdev)drivers/iommu/fsl_pamu_domain.c +2
-2if (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
PATCH 8/26 iommu/fsl: Fix checkpatch type CODE_INDENT
In reply to a message not in the archiveERROR: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
@@ -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
@@ -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
Varun Sethi
Acked-byRE: [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 typeCODE_INDENTERROR:CODE_INDENT: code indent should use tabs where possible
+^Istash_dest_hint, vcpu);$ERROR:CODE_INDENT: code indent should use tabs where possible
+^Iphys_addr_tppaact_phys,phys_addr_tspaact_phys,$ERROR:CODE_INDENT: code indent should use tabs where possible
+^I^I dev->of_node->full_name);$ERROR:CODE_INDENT: code indent should use tabs where possible
+^I^I dev->of_node->full_name);$Signed-off-by Emil Medve <[email protected]>--- 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
-06b28dd8..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
__initsetup_one_pamu(unsigned longpamu_reg_base, unsigned longpamu_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.cindex 080ffa4..d5137dd 100644drivers/iommu/fsl_pamu_domain.c +2
-2@@ -682,7 +682,7 @@ static int fsl_pamu_attach_device(structiommu_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(structiommu_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
PATCH 9/26 iommu/fsl: Fix checkpatch type ALLOC_SIZEOF_STRUCT
In reply to a message not in the archiveCHECK: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
@@ -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
@@ -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
Varun Sethi
Acked-byRE: [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 typeALLOC_SIZEOF_STRUCTCHECK: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)...) overkzalloc(sizeof(struct dma_window)...)+
dma_domain->win_arr= kzalloc(sizeof(structdma_window)Signed-off-by Emil Medve <[email protected]>--- 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
-07f0181c..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 allocationfailed\n");
drivers/iommu/fsl_pamu.c +0
-0ret = -ENOMEM ;(quoted diff) +0
-0
b/drivers/iommu/fsl_pamu_domain.cindex d5137dd..9417207 100644drivers/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
-0if (!dma_domain->win_arr) { spin_unlock_irqrestore(&dma_domain-Quoted 1 line
domain_lock, flags);
Quoted 2 lines
--
2.2.2
PATCH 10/26 iommu/fsl: Fix checkpatch type ALLOC_WITH_MULTIPLY
In reply to a message not in the archiveWARNING: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
@@ -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
Varun Sethi
Acked-byRE: [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 typeALLOC_WITH_MULTIPLYWARNING: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);Signed-off-by Emil Medve <[email protected]>--- drivers/iommu/fsl_pamu_domain.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/iommu/fsl_pamu_domain.cindex 9417207..dcb9bb4 100644drivers/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
PATCH 11/26 iommu/fsl: Fix checkpatch type OOM_MESSAGE
In reply to a message not in the archiveWARNING: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
@@ -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
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 typeOOM_MESSAGEWARNING: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");Signed-off-by Emil Medve <[email protected]>--- 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
-04f1926b..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
-0goto 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]
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 typeOOM_MESSAGEWARNING: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");Signed-off-by Emil Medve <[email protected]>--- 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
-04f1926b..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
-1data =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
-0goto 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]
Varun Sethi
Acked-byRE: [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 typeOOM_MESSAGEHello 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 typeOOM_MESSAGEWARNING: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");Signed-off-by Emil Medve <[email protected]>--- drivers/iommu/fsl_pamu.c | 1 - 1 file changed, 1 deletion(-)drivers/iommu/fsl_pamu.c +0
-0index
4f1926b..6f9c976 100644drivers/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
-1data =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
-0goto 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:
PATCH 12/26 iommu/fsl: Fix checkpatch type TYPO_SPELLING
In reply to a message not in the archiveCHECK: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
@@ -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
Varun Sethi
Acked-byRE: [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 typeTYPO_SPELLINGCHECK:TYPO_SPELLING: 'accomodate' may be misspelled - perhaps 'accommodate'?
+ * Hard coded value for the PAACT size to accomodateSigned-off-by Emil Medve <[email protected]>--- 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
-052a91af..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
PATCH 13/26 iommu/fsl: Fix checkpatch type PREFER_PACKED
In reply to a message not in the archiveWARNING: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
@@ -333,7 +333,7 @@ struct paace {#define NUM_MOE 128struct 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
Varun Sethi
Acked-byRE: [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 typePREFER_PACKEDWARNING:PREFER_PACKED:
__packedis preferred over
__attribute__((packed))
+} __attribute__((packed));Signed-off-by Emil Medve <[email protected]>--- 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
-086abc70..04dcd25 100644
drivers/iommu/fsl_pamu.h +1
-1@@ -333,7 +333,7 @@ struct paace {#define NUM_MOE 128struct 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
PATCH 14/26 iommu/fsl: Fix checkpatch type QUOTED_WHITESPACE_BEFORE_NEWLINE
In reply to a message not in the archiveWARNING: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
@@ -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
Varun Sethi
Acked-byRE: [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 typeQUOTED_WHITESPACE_BEFORE_NEWLINEWARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
+pr_debug("Invalid window size \n");Signed-off-by Emil Medve <[email protected]>--- drivers/iommu/fsl_pamu_domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/iommu/fsl_pamu_domain.cindex dcb9bb4..c9886ff 100644drivers/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
-1return -EINVAL ; } --
Quoted 1 line
2.2.2
PATCH 15/26 iommu/fsl: Fix checkpatch type SPACING
In reply to a message not in the archiveCHECK: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
@@ -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
@@ -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
Varun Sethi
Acked-byRE: [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 SPACINGCHECK: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((structpamu_stash_attribute*) data,
+&dma_domain->dma_stash,Signed-off-by Emil Medve <[email protected]>--- 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
-06f9c976..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
-0spaact_phys, omt_phys); /* Disable PAMU bypass for this PAMU */ diff --git
a/drivers/iommu/fsl_pamu_domain.cb/drivers/iommu/fsl_pamu_domain.cindex c9886ff..c7af760 100644drivers/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
-1case DOMAIN_ATTR_FSL_PAMU_ENABLE : *(int *)data = dma_domain->enabled; --
Quoted 1 line
2.2.2
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
@@ -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
Varun Sethi
Acked-byRE: [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
shorterSigned-off-by Emil Medve <[email protected]>--- 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
-018a604a..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(structplatform_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
-1ret = -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 ataddress "
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 coherencesubdomain\n");
drivers/iommu/fsl_pamu.c +1
-1return 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
PATCH 17/26 iommu/fsl: Remove pr/dev_*() prefixes
In reply to a message not in the archivepr_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
@@ -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
@@ -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
Varun Sethi
Acked-byRE: [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 itSigned-off-by Emil Medve <[email protected]>--- 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
-022b72e2..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.cindex c7af760..3e7954a 100644drivers/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
-1liodn);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
-2return 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
-2return 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
PATCH 18/26 iommu/fsl: Fix checkpatch type PARENTHESIS_ALIGNMENT
In reply to a message not in the archiveCHECK: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
@@ -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
Varun Sethi
Acked-byRE: [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 typePARENTHESIS_ALIGNMENTCHECK: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, structfsl_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
+staticphys_addr_tfsl_pamu_iova_to_phys(structiommu_domain*domain,
+dma_addr_tiova)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));Signed-off-by Emil Medve <[email protected]>--- 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
-0e46c75f..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
-2mb ();@@ -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 pamudrivers/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
-2return 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_tpamu_av_isr(int irq, void *arg)
pr_emerg("POES2=%08x\n", in_be32(p +PAMU_POES2));drivers/iommu/fsl_pamu.c +0
-0pr_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.cindex 3e7954a..51a6750 100644drivers/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
-2pr_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
-1return 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
-3unsigned long flags;@@ -222,9 +220,9 @@ static int update_liodn_stash(int liodn, structfsl_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
-2phys_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
-3list_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(structiommu_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
-1struct 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
-2break ; }@@ -630,8 +628,7 @@ static int handle_attach_device(structfsl_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
-2break ;if (dma_domain->mapped) {@@ -678,8 +675,7 @@ static int fsl_pamu_attach_device(structiommu_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
-5pr_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(structiommu_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
-1if (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
-0stash_attr->cpu);@@ -799,8 +795,7 @@ static int configure_domain_dma_state(struct
fsl_dma_domain*dma_domain, bool endrivers/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
-1kfree (dma_domain->win_arr); dma_domain->win_arr = kcalloc(w_count, --
Quoted 1 line
2.2.2
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
@@ -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
@@ -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
Varun Sethi
Acked-byRE: [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 alignmentSigned-off-by Emil Medve <[email protected]>--- 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
-0dc3955f..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
-1unsigned 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_idguts_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 returnsULONG_MAXindicating 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
-0case QMAN_PORTAL_PAACE : set_bf(ppaace->impl_attr, PAACE_IA_OTM,
PAACE_OTM_INDEXED);drivers/iommu/fsl_pamu.c +1
-1ppaace->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
-1break ;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.cindex 51a6750..eea2212 100644drivers/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
-1struct 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
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
@@ -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
@@ -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 istatic 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
Varun Sethi
Acked-byRE: [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 linesSigned-off-by Emil Medve <[email protected]>--- 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
-004dcd25..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_SHIFT16
#definePAMU_LAV_LIODN_NOT_IN_PPAACT0x400(quoted diff) +0
-0
b/drivers/iommu/fsl_pamu_domain.cindex eea2212..ae21305 100644drivers/iommu/fsl_pamu_domain.c +1
-2@@ -62,8 +62,7 @@ static int __init iommu_init_mempool(void) staticphys_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_tistatic 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
-0sub_win_ptr[i].size,@@ -180,8 +177,8 @@ static int update_liodn(int liodn, struct
fsl_dma_domain*dma_domain, u32wnd_nrdrivers/iommu/fsl_pamu_domain.c +0
-1wnd->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
PATCH 21/26 iommu/fsl: Fix checkpatch type LONG_LINE
In reply to a message not in the archiveOnly 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
@@ -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
@@ -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
Varun Sethi
Acked-byRE: [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 typeLONG_LINEOnly 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 forliodn %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 destinationupdate 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 forliodn %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 forliodn %d\n", liodn);
Signed-off-by Emil Medve <[email protected]>--- 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
-0ba5d1e0..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
-1return -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
-1BUG_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.cindex ae21305..38c26be 100644drivers/iommu/fsl_pamu_domain.c +0
-0@@ -167,7 +167,8 @@ static int update_liodn(int liodn, struct
fsl_dma_domain*dma_domain, u32wnd_nrdrivers/iommu/fsl_pamu_domain.c +0
-1(wnd_nr >0 ) ?1 :0 , wnd->prot);if (ret) - pr_debug("Subwindow reconfiguration failed forliodn %d\n", liodn);
drivers/iommu/fsl_pamu_domain.c +1
-0+ pr_debug("Subwindow reconfiguration failed forliodn %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, u32wnd_nr
dma_domain->snoop_id,dma_domain->stash_id,drivers/iommu/fsl_pamu_domain.c +0
-10, 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
-1spin_lock_irqsave (&iommu_lock, flags);if (!dma_domain->win_arr) { - pr_debug("Windows not configured, stash destinationupdate failed for liodn %d\n", liodn);
drivers/iommu/fsl_pamu_domain.c +1
-0+ pr_debug("Windows not configured, stash destinationupdate 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
-1spin_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
-1return 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
-1return ret; } } --
Quoted 1 line
2.2.2
PATCH 22/26 iommu/fsl: Make local symbols static
In reply to a message not in the archivedrivers/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
@@ -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
Varun Sethi
Acked-byRE: [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?Signed-off-by Emil Medve <[email protected]>--- 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
-03f83259..1d9273a 100644
drivers/iommu/fsl_pamu.c +1
-1@@ -75,7 +75,7 @@ static const struct of_device_id l3_device_ids[] = { staticu32 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
__initsetup_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
PATCH 23/26 iommu/fsl: Use NULL instead of zero
In reply to a message not in the archivedrivers/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
@@ -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
Varun Sethi
Acked-byRE: [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 pointerdrivers/iommu/fsl_pamu.c:559:72: warning: Using plain integer as NULL pointerdrivers/iommu/fsl_pamu.c:570:66: warning: Using plain integer as NULL pointerSigned-off-by Emil Medve <[email protected]>--- 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
-01d9273a..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
-1node->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
-2pr_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
PATCH 24/26 iommu/fsl: Remove unneeded semicolon
In reply to a message not in the archivedrivers/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
@@ -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
Varun Sethi
Acked-byRE: [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 semicolondrivers/iommu/fsl_pamu_domain.c:859:2-3: Unneeded semicolon drivers/iommu/fsl_pamu_domain.c:833:2-3: Unneeded semicolon
Signed-off-by Emil Medve <[email protected]>--- drivers/iommu/fsl_pamu_domain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/iommu/fsl_pamu_domain.cindex 38c26be..ebbc396 100644drivers/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
PATCH 25/26 iommu/fsl: Don't use integers values with bool type
In reply to a message not in the archivedrivers/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
@@ -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
Varun Sethi
Acked-byRE: [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 typedrivers/iommu/fsl_pamu_domain.c:884:9-10: WARNING: return of 0/1 in function '
check_pci_ctl_endpt_part' with return type boolSigned-off-by Emil Medve <[email protected]>--- drivers/iommu/fsl_pamu_domain.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)(quoted diff) +0
-0
b/drivers/iommu/fsl_pamu_domain.cindex ebbc396..36622e2 100644drivers/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
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
@@ -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
@@ -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
@@ -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
Varun Sethi
Acked-byRE: [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 paranthesisSigned-off-by Emil Medve <[email protected]>--- 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
-07a4665d..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
-0BUG_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
-0342ac6d..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 */
#definePAMU_PGC0x00000000/* Allows all peripheral accesses */(quoted diff) +0
-0
b/drivers/iommu/fsl_pamu_domain.cindex 36622e2..ceebd28 100644drivers/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_tidrivers/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
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 typeSPACE_BEFORE_TABiommu/fsl: Fix checkpatch typeLINE_SPACINGiommu/fsl: Fix checkpatch typeLEADING_SPACEiommu/fsl: Fix checkpath type BRACES
iommu/fsl: Fix checkpatch typeCODE_INDENT
iommu/fsl: Fix checkpatch typeALLOC_SIZEOF_STRUCTiommu/fsl: Fix checkpatch typeALLOC_WITH_MULTIPLYiommu/fsl: Fix checkpatch typeOOM_MESSAGE
iommu/fsl: Fix checkpatch typeTYPO_SPELLINGiommu/fsl: Fix checkpatch typePREFER_PACKEDiommu/fsl: Fix checkpatch typeQUOTED_WHITESPACE_BEFORE_NEWLINEiommu/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 typePARENTHESIS_ALIGNMENT
Quoted 8 lines
iommu/fsl: Fix some comments alignment iommu/fsl: Fix alignment of some stray lines iommu/fsl: Fix checkpatch type
LONG_LINEiommu/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]
Varun Sethi
Acked-byHi 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 cleanupVarun,
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 typeSPACE_BEFORE_TABiommu/fsl: Fix checkpatch typeLINE_SPACINGiommu/fsl: Fix checkpatch typeLEADING_SPACEiommu/fsl: Fix checkpath type BRACES
iommu/fsl: Fix checkpatch typeCODE_INDENT
iommu/fsl: Fix checkpatch typeALLOC_SIZEOF_STRUCTiommu/fsl: Fix checkpatch typeALLOC_WITH_MULTIPLYiommu/fsl: Fix checkpatch typeOOM_MESSAGE
iommu/fsl: Fix checkpatch typeTYPO_SPELLINGiommu/fsl: Fix checkpatch typePREFER_PACKEDiommu/fsl: Fix checkpatch typeQUOTED_WHITESPACE_BEFORE_NEWLINEiommu/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 typePARENTHESIS_ALIGNMENTQuoted 8 lines
iommu/fsl: Fix some comments alignment iommu/fsl: Fix alignment of some stray lines iommu/fsl: Fix checkpatch type
LONG_LINEiommu/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]
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]
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 cleanupQuoted 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
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
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]
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.
Quoted 1 line · Timur Tabi
These should all be merged into one patch, IMHO.
I agree, it makes more sense to put all this into a single patch. Applied this way.