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

ARM: 6429/1: Check for is_smp for tlb_ops and cache_ops broadcast

Broadcast should not be needed when running SMP kernel on UP systems.

Also, this fixes an undefined instruction for SMP_ON_UP on earlier ARM
cores without the extended CPUID_EXT_MMFR3 register.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Tony Lindgren and committed by
Russell King
7511db9d 81d11955

+17 -11
+17 -11
arch/arm/include/asm/smp_plat.h
··· 7 7 8 8 #include <asm/cputype.h> 9 9 10 - /* all SMP configurations have the extended CPUID registers */ 11 - static inline int tlb_ops_need_broadcast(void) 12 - { 13 - return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 2; 14 - } 15 - 16 - static inline int cache_ops_need_broadcast(void) 17 - { 18 - return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 1; 19 - } 20 - 21 10 /* 22 11 * Return true if we are running on a SMP platform 23 12 */ ··· 20 31 #else 21 32 return true; 22 33 #endif 34 + } 35 + 36 + /* all SMP configurations have the extended CPUID registers */ 37 + static inline int tlb_ops_need_broadcast(void) 38 + { 39 + if (!is_smp()) 40 + return 0; 41 + 42 + return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 2; 43 + } 44 + 45 + static inline int cache_ops_need_broadcast(void) 46 + { 47 + if (!is_smp()) 48 + return 0; 49 + 50 + return ((read_cpuid_ext(CPUID_EXT_MMFR3) >> 12) & 0xf) < 1; 23 51 } 24 52 25 53 #endif