]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: smp-cps: Avoid BUG() when offlining pre-r6 CPUs
authorMatt Redfearn <matt.redfearn@imgtec.com>
Thu, 22 Sep 2016 10:59:47 +0000 (11:59 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 29 Sep 2016 16:59:49 +0000 (18:59 +0200)
commit939fb28794c9e5f30a50415389dd204d5d6209bf
tree51296ee068824fda591eb74a9ccf8dcd038040ac
parent7893f85ba5589bfb4a6ddc1e1003bb1523ff5309
MIPS: smp-cps: Avoid BUG() when offlining pre-r6 CPUs

Commit 442e6fdbd4d8 ("MIPS: smp-cps: Add support for CPU hotplug of
MIPSr6 processors") added a call to mips_cm_lock_other in order to lock
the CPC in CPUs containing a version 3 or higher Coherence Manager,
which use the general CM core other register, where previous CMs had a
dedicated core other register for the CPC.

A kernel BUG() is triggered, however, if mips_cm_lock_other is called
with a VP other than 0 on a CPU with CM < 3, a condition introduced by
442e6fdbd4d8.

Avoid the BUG() by always locking VP0 when locking the CPC, since the
required register, cpc_stat_conf, is shared by all vps in a core.

Fixes: 442e6fdbd4d8 ("MIPS: smp-cps: Add support for CPU hotplug...)
Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: Qais Yousef <qsyousef@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/14297/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/kernel/smp-cps.c