[PATCH] ARM: setup_mm_for_reboot(): use flush_cache_louis()

Will Deacon will.deacon at arm.com
Tue Nov 6 16:41:37 EST 2012


On Tue, Nov 06, 2012 at 09:12:27PM +0000, Nicolas Pitre wrote:
> 
> ... instead of flush_cache_all().  The later unconditionally flushes
> the L2 cache on ARMv7 architectures such as Cortex A15 and A7 which
> is costly and unnecessary in some scenarios where setup_mm_for_reboot()
> is used.  If L2 has to be flushed as well, it should already be done
> separately on other architectures anyway.
> 
> Signed-off-by: Nicolas Pitre <nico at linaro.org>
> 
> diff --git a/arch/arm/mm/idmap.c b/arch/arm/mm/idmap.c
> index ab88ed4f8e..2c61085a10 100644
> --- a/arch/arm/mm/idmap.c
> +++ b/arch/arm/mm/idmap.c
> @@ -104,7 +104,7 @@ early_initcall(init_static_idmap);
>  void setup_mm_for_reboot(void)
>  {
>  	/* Clean and invalidate L1. */
> -	flush_cache_all();
> +	flush_cache_louis();
>  
>  	/* Switch to the identity mapping. */
>  	cpu_switch_mm(idmap_pgd, &init_mm);

We could probably even predicate this on the half-implemented
TLB_CAN_READ_FROM_L1_CACHE option, but that can come later.

Acked-by: Will Deacon <will.deacon at arm.com>

Will



More information about the linux-arm-kernel mailing list