]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ARM: l2c: only write the auxiliary control register if required
authorRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 17 Mar 2014 20:10:31 +0000 (20:10 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 29 May 2014 23:47:57 +0000 (00:47 +0100)
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>
arch/arm/mm/cache-l2x0.c

index fc609550b7fa5385e01ce7f4f3c9dbc495477b0f..1c947b4c7f05e7018dcce7ef555fb3b0d7875279 100644 (file)
@@ -92,7 +92,9 @@ static void l2c_enable(void __iomem *base, u32 aux, unsigned num_lock)
 {
        unsigned long flags;
 
-       writel_relaxed(aux, base + L2X0_AUX_CTRL);
+       /* Only write the aux register if it needs changing */
+       if (readl_relaxed(base + L2X0_AUX_CTRL) != aux)
+               writel_relaxed(aux, base + L2X0_AUX_CTRL);
 
        l2c_unlock(base, num_lock);