MIPS: c-octeon: Provide alternative SMP cache flush function
authorJiaxun Yang <jiaxun.yang@flygoat.com>
Tue, 4 Apr 2023 09:33:45 +0000 (10:33 +0100)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Wed, 5 Apr 2023 07:45:09 +0000 (09:45 +0200)
Currently c-octeon relies on octeon's own smp function to flush
I-Cache. However this function is not available on generic platform.

Just use smp_call_function_many on generic platform.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/mm/c-octeon.c

index c7ed589..b7393b6 100644 (file)
@@ -83,8 +83,13 @@ static void octeon_flush_icache_all_cores(struct vm_area_struct *vma)
        else
                mask = *cpu_online_mask;
        cpumask_clear_cpu(cpu, &mask);
+#ifdef CONFIG_CAVIUM_OCTEON_SOC
        for_each_cpu(cpu, &mask)
                octeon_send_ipi_single(cpu, SMP_ICACHE_FLUSH);
+#else
+       smp_call_function_many(&mask, (smp_call_func_t)octeon_local_flush_icache,
+                              NULL, 1);
+#endif
 
        preempt_enable();
 #endif