Using goto here doesn't bring any advantages and only makes the code
flow less clear. No functional changes.
Signed-off-by: Andrey Smirnov <redacted>
---
RESEND, now with Russell King on CC list.
arch/arm/mach-imx/system.c | 36 +++++++++++++++++-------------------
1 file changed, 17 insertions(+), 19 deletions(-)
@@ -106,26 +106,24 @@ void __init imx_init_l2cache(void)gotoout;}-if(readl_relaxed(l2x0_base+L2X0_CTRL)&L2X0_CTRL_EN)-gotoskip_if_enabled;--/* Configure the L2 PREFETCH and POWER registers */-val=readl_relaxed(l2x0_base+L310_PREFETCH_CTRL);-val|=0x70800000;-/*-*TheL2cachecontroller(PL310)versiononthei.MX6D/Qisr3p1-50rel0-*TheL2cachecontroller(PL310)versiononthei.MX6DL/SOLO/SLisr3p2-*ButaccordingtoARMPL310errata:752271-*ID:752271:Doublelinefillfeaturecancausedatacorruption-*FaultStatus:Presentin:r3p0,r3p1,r3p1-50rel0.Fixedinr3p2-*Workaround:Theonlyworkaroundtothiserratumistodisablethe-*doublelinefillfeature.Thisisthedefaultbehavior.-*/-if(cpu_is_imx6q())-val&=~(1<<30|1<<23);-writel_relaxed(val,l2x0_base+L310_PREFETCH_CTRL);+if(!(readl_relaxed(l2x0_base+L2X0_CTRL)&L2X0_CTRL_EN)){+/* Configure the L2 PREFETCH and POWER registers */+val=readl_relaxed(l2x0_base+L310_PREFETCH_CTRL);+val|=0x70800000;+/*+*TheL2cachecontroller(PL310)versiononthei.MX6D/Qisr3p1-50rel0+*TheL2cachecontroller(PL310)versiononthei.MX6DL/SOLO/SLisr3p2+*ButaccordingtoARMPL310errata:752271+*ID:752271:Doublelinefillfeaturecancausedatacorruption+*FaultStatus:Presentin:r3p0,r3p1,r3p1-50rel0.Fixedinr3p2+*Workaround:Theonlyworkaroundtothiserratumistodisablethe+*doublelinefillfeature.Thisisthedefaultbehavior.+*/+if(cpu_is_imx6q())+val&=~(1<<30|1<<23);+writel_relaxed(val,l2x0_base+L310_PREFETCH_CTRL);+}-skip_if_enabled:iounmap(l2x0_base);of_node_put(np);
Applying a fix for ARM errata 752271 would already be taken care by a
call to a 'fixup' hook as a part of l2x0_of_init() -> __l2c_init() call
chain. Moreso the code in 'fixup' function would do that based on the
PL310's revsion information, whereas removed code does so based on SoC
version which does not work very well on i.MX6Q+ which identifies itself
as i.MX6Q, but is not affected by 752271.
Signed-off-by: Andrey Smirnov <redacted>
---
RESEND, now with Russell King on CC list.
arch/arm/mach-imx/system.c | 11 -----------
1 file changed, 11 deletions(-)
@@ -110,17 +110,6 @@ void __init imx_init_l2cache(void)/* Configure the L2 PREFETCH and POWER registers */val=readl_relaxed(l2x0_base+L310_PREFETCH_CTRL);val|=0x70800000;-/*-*TheL2cachecontroller(PL310)versiononthei.MX6D/Qisr3p1-50rel0-*TheL2cachecontroller(PL310)versiononthei.MX6DL/SOLO/SLisr3p2-*ButaccordingtoARMPL310errata:752271-*ID:752271:Doublelinefillfeaturecancausedatacorruption-*FaultStatus:Presentin:r3p0,r3p1,r3p1-50rel0.Fixedinr3p2-*Workaround:Theonlyworkaroundtothiserratumistodisablethe-*doublelinefillfeature.Thisisthedefaultbehavior.-*/-if(cpu_is_imx6q())-val&=~(1<<30|1<<23);writel_relaxed(val,l2x0_base+L310_PREFETCH_CTRL);}
Signed-off-by: Andrey Smirnov <redacted>
---
RESEND, now with Russell King on CC list.
arch/arm/include/asm/hardware/cache-l2x0.h | 7 +++++++
arch/arm/mach-imx/system.c | 5 ++++-
2 files changed, 11 insertions(+), 1 deletion(-)
@@ -109,7 +109,10 @@ void __init imx_init_l2cache(void)if(!(readl_relaxed(l2x0_base+L2X0_CTRL)&L2X0_CTRL_EN)){/* Configure the L2 PREFETCH and POWER registers */val=readl_relaxed(l2x0_base+L310_PREFETCH_CTRL);-val|=0x70800000;+val|=L310_DOUBLE_LINEFILL_EN|+L310_INSTRUCTION_PREFETCH_EN|+L310_DATA_PREFETCH_EN|+L310_INCR_DOUBLE_LINEFILL_EN;writel_relaxed(val,l2x0_base+L310_PREFETCH_CTRL);}
Most of these macros seem to all exist further down in the file already
under slightly differnet names, e.g.
#define L310_PREFETCH_CTRL_DBL_LINEFILL_INCR BIT(23)
Arnd
On Sunday, June 12, 2016 10:55:27 PM CEST Andrey Smirnov wrote:
Using goto here doesn't bring any advantages and only makes the code
flow less clear. No functional changes.
Signed-off-by: Andrey Smirnov <redacted>
All three patches looks reasonable to me, but now that I looked at
the function, I wonder if we could do another cleanup on top and
not call this function for imx35 at all but instead set the
.l2c_aux_val/.l2c_aux_mask fields in its machine descriptor.
The call to l2x0_of_init(0, ~0) seems to be the only thing we
do on imx35 (where arm,pl310-cache is not present), and the kernel
can do it automatically.
Arnd
From: Russell King - ARM Linux <linux@armlinux.org.uk> Date: 2016-06-13 09:28:38
On Sun, Jun 12, 2016 at 10:55:29PM -0700, Andrey Smirnov wrote:
quoted hunk
Signed-off-by: Andrey Smirnov <redacted>
---
RESEND, now with Russell King on CC list.
arch/arm/include/asm/hardware/cache-l2x0.h | 7 +++++++
arch/arm/mach-imx/system.c | 5 ++++-
2 files changed, 11 insertions(+), 1 deletion(-)
Looks like a spelling error... surely this should be EXCLUSIVE ?
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
Most of these macros seem to all exist further down in the file already
under slightly differnet names, e.g.
#define L310_PREFETCH_CTRL_DBL_LINEFILL_INCR BIT(23)
Indeed they do. Andrey, please use the existing definitions.
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.