MIPS: c-r4k: Fix cache flushing for MT cores
authorMarkos Chandras <markos.chandras@imgtec.com>
Fri, 10 Jul 2015 08:29:10 +0000 (09:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Aug 2015 19:21:51 +0000 (12:21 -0700)
commit7ed06198d9b38b8a6c8e8a0944a4a6c3f03e5a35
tree91ca80fff6389e10f459abe23af12d04eb166268
parenta6130c5e14b2f824c0b7e5e9dddd46529616c6af
MIPS: c-r4k: Fix cache flushing for MT cores

commit cccf34e9411c41b0cbfb41980fe55fc8e7c98fd2 upstream.

MT_SMP is not the only SMP option for MT cores. The MT_SMP option
allows more than one VPE per core to appear as a secondary CPU in the
system. Because of how CM works, it propagates the address-based
cache ops to the secondary cores but not the index-based ones.
Because of that, the code does not use IPIs to flush the L1 caches on
secondary cores because the CM would have done that already. However,
the CM functionality is independent of the type of SMP kernel so even in
non-MT kernels, IPIs are not necessary. As a result of which, we change
the conditional to depend on the CM presence. Moreover, since VPEs on
the same core share the same L1 caches, there is no need to send an
IPI on all of them so we calculate a suitable cpumask with only one
VPE per core.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/10654/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/mips/include/asm/smp.h
arch/mips/kernel/smp.c
arch/mips/mm/c-r4k.c