[PATCH] ARM: mm: show prefetch state when either data or instr prefect is enabled

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Thu Jun 11 05:39:35 PDT 2015


Russell,

On Thu, 11 Jun 2015 13:10:52 +0100, Russell King - ARM Linux wrote:

> > diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
> > index d6e43d8..6bdf3a5 100644
> > --- a/arch/arm/mm/cache-l2x0.c
> > +++ b/arch/arm/mm/cache-l2x0.c
> > @@ -656,7 +656,8 @@ static void __init l2c310_enable(void __iomem *base, u32 aux, unsigned num_lock)
> >  	/* Read back resulting AUX_CTRL value as it could have been altered. */
> >  	aux = readl_relaxed(base + L2X0_AUX_CTRL);
> >  
> > -	if (aux & (L310_AUX_CTRL_DATA_PREFETCH | L310_AUX_CTRL_INSTR_PREFETCH)) {
> 
> What this says is...
> 	first, bitwise _OR_ L310_AUX_CTRL_DATA_PREFETCH with
> 	L310_AUX_CTRL_INSTR_PREFETCH.  This produces a number which has
> 	_two_ bits set.
> 
> 	then, bitwise _AND_ that number with the auxiliary control register.
> 
> 	If the result is non-zero, then execute the code within the if() { }
> 	block.
> 
> So, I'm not going to take this patch.  The code is correct as it stands.

You are indeed absolutely correct. I got confused because I wasn't
seeing the message, but it was caused by the other problem (writing
AUX_CTRL overwriting the changes made to PREFETCH_CTRL). But that
obviously had nothing to do with this part of the code.

Sorry for the noise, and thanks for the quick feedback,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com



More information about the linux-arm-kernel mailing list