kernel: fix mips MT_SMP kernel crash on cache flush
authorFelix Fietkau <nbd@nbd.name>
Thu, 9 Jun 2016 17:09:23 +0000 (19:09 +0200)
committerFelix Fietkau <nbd@nbd.name>
Sat, 11 Jun 2016 07:49:13 +0000 (09:49 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
target/linux/generic/patches-4.4/100-MIPS-fix-MT_SMP-cacheflush.patch [new file with mode: 0644]

diff --git a/target/linux/generic/patches-4.4/100-MIPS-fix-MT_SMP-cacheflush.patch b/target/linux/generic/patches-4.4/100-MIPS-fix-MT_SMP-cacheflush.patch
new file mode 100644 (file)
index 0000000..14a10ba
--- /dev/null
@@ -0,0 +1,17 @@
+Fix crash on cache flush with the MT_SMP variant
+
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+
+--- a/arch/mips/mm/c-r4k.c
++++ b/arch/mips/mm/c-r4k.c
+@@ -60,8 +60,10 @@ static inline void r4k_on_each_cpu(void
+        * to restrict that call when a CM is not present because both
+        * CM-based SMP protocols (CMP & CPS) restrict index-based cache ops.
+        */
++#ifndef CONFIG_MIPS_MT_SMP
+       if (!mips_cm_present())
+               smp_call_function_many(&cpu_foreign_map, func, info, 1);
++#endif
+       func(info);
+       preempt_enable();
+ }