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

MIPS: fix case mismatch in local_r4k_flush_icache_range()

Currently, Loongson-2 call protected_blast_icache_range() and others
call protected_loongson23_blast_icache_range(), but I think the correct
behavior should be the opposite. BTW, Loongson-3's cache-ops is
compatible with MIPS64, but not compatible with Loongson-2. So, rename
xxx_loongson23_yyy things to xxx_loongson2_yyy.

The patch fixes early boot hang with 3.13-rc1, introduced in commit
14bd8c082016 ("MIPS: Loongson: Get rid of Loongson 2 #ifdefery all over
arch/mips").

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Acked-by: John Crispin <blogic@openwrt.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Huacai Chen and committed by
Linus Torvalds
bad009fe 70f2fe3a

+7 -7
+1 -1
arch/mips/include/asm/cacheops.h
··· 83 83 /* 84 84 * Loongson2-specific cacheops 85 85 */ 86 - #define Hit_Invalidate_I_Loongson23 0x00 86 + #define Hit_Invalidate_I_Loongson2 0x00 87 87 88 88 #endif /* __ASM_CACHEOPS_H */
+4 -4
arch/mips/include/asm/r4kcache.h
··· 165 165 __iflush_prologue 166 166 switch (boot_cpu_type()) { 167 167 case CPU_LOONGSON2: 168 - cache_op(Hit_Invalidate_I_Loongson23, addr); 168 + cache_op(Hit_Invalidate_I_Loongson2, addr); 169 169 break; 170 170 171 171 default: ··· 219 219 { 220 220 switch (boot_cpu_type()) { 221 221 case CPU_LOONGSON2: 222 - protected_cache_op(Hit_Invalidate_I_Loongson23, addr); 222 + protected_cache_op(Hit_Invalidate_I_Loongson2, addr); 223 223 break; 224 224 225 225 default: ··· 452 452 __BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_, ) 453 453 __BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_, ) 454 454 __BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_, ) 455 - __BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I_Loongson23, \ 456 - protected_, loongson23_) 455 + __BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I_Loongson2, \ 456 + protected_, loongson2_) 457 457 __BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, , ) 458 458 __BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, , ) 459 459 /* blast_inv_dcache_range */
+2 -2
arch/mips/mm/c-r4k.c
··· 580 580 else { 581 581 switch (boot_cpu_type()) { 582 582 case CPU_LOONGSON2: 583 - protected_blast_icache_range(start, end); 583 + protected_loongson2_blast_icache_range(start, end); 584 584 break; 585 585 586 586 default: 587 - protected_loongson23_blast_icache_range(start, end); 587 + protected_blast_icache_range(start, end); 588 588 break; 589 589 } 590 590 }