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