Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[ARM] Kirkwood: invalidate L2 cache before enabling it

I get random oopses on my Kirkwood board at startup when L2 cache is
enabled. FYI I'm using Marvell uboot version 3.4.16

Each boot produces the same oops, but anything that changes the kernel
size (even only changing initramfs) makes the oops different.

I noticed that nothing invalidates the L2 cache before enabling it,
doing so fixes my problem.

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
Signed-off-by: Nicolas Pitre <nico@marvell.com>

authored by

Maxime Bizon and committed by
Nicolas Pitre
d75de087 c31f403d

+5
+5
arch/arm/mm/cache-feroceon-l2.c
··· 115 115 raw_local_irq_restore(flags); 116 116 } 117 117 118 + static inline void l2_inv_all(void) 119 + { 120 + __asm__("mcr p15, 1, %0, c15, c11, 0" : : "r" (0)); 121 + } 118 122 119 123 /* 120 124 * Linux primitives. ··· 325 321 326 322 d = flush_and_disable_dcache(); 327 323 i = invalidate_and_disable_icache(); 324 + l2_inv_all(); 328 325 write_extra_features(u | 0x00400000); 329 326 if (i) 330 327 enable_icache();