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

MIPS: cpu-features: Use boot_cpu_type for CPU type based features

Some CPU feature macros were using current_cpu_type to mark feature
availability.

However current_cpu_type will use smp_processor_id, which is prohibited
under preemptable context.

Since those features are all uniform on all CPUs in a SMP system, use
boot_cpu_type instead of current_cpu_type to fix preemptable kernel.

Cc: stable@vger.kernel.org
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

authored by

Jiaxun Yang and committed by
Thomas Bogendoerfer
5487a7b6 ece68749

+2 -2
+2 -2
arch/mips/include/asm/cpu-features.h
··· 125 125 ({ \ 126 126 int __res; \ 127 127 \ 128 - switch (current_cpu_type()) { \ 128 + switch (boot_cpu_type()) { \ 129 129 case CPU_CAVIUM_OCTEON: \ 130 130 case CPU_CAVIUM_OCTEON_PLUS: \ 131 131 case CPU_CAVIUM_OCTEON2: \ ··· 368 368 ({ \ 369 369 int __res; \ 370 370 \ 371 - switch (current_cpu_type()) { \ 371 + switch (boot_cpu_type()) { \ 372 372 case CPU_M14KC: \ 373 373 case CPU_74K: \ 374 374 case CPU_1074K: \