aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-03-17 16:10:31 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-05-29 19:47:57 -0400
commit9a07f27bc5ff2e36400e605d99cc1e129582a0ca (patch)
tree3f834d8ad2a32a0f52f0c6820693afc1fd36785f /arch
parent17f3f99fab43ad17ae1adfc724e5ebaca9635902 (diff)
ARM: l2c: only write the auxiliary control register if required
Avoid unnecessary writes to the auxiliary control register if the register already contains the required value. This allows us to avoid invoking the platforms secure monitor code unnecessarily. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mm/cache-l2x0.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index fc609550b7fa..1c947b4c7f05 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -92,7 +92,9 @@ static void l2c_enable(void __iomem *base, u32 aux, unsigned num_lock)
92{ 92{
93 unsigned long flags; 93 unsigned long flags;
94 94
95 writel_relaxed(aux, base + L2X0_AUX_CTRL); 95 /* Only write the aux register if it needs changing */
96 if (readl_relaxed(base + L2X0_AUX_CTRL) != aux)
97 writel_relaxed(aux, base + L2X0_AUX_CTRL);
96 98
97 l2c_unlock(base, num_lock); 99 l2c_unlock(base, num_lock);
98 100