[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1474541987-26168-1-git-send-email-matt.redfearn@imgtec.com>
Date: Thu, 22 Sep 2016 11:59:47 +0100
From: Matt Redfearn <matt.redfearn@...tec.com>
To: Ralf Baechle <ralf@...ux-mips.org>
CC: <linux-mips@...ux-mips.org>,
Matt Redfearn <matt.redfearn@...tec.com>,
Qais Yousef <qais.yousef@...tec.com>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
<linux-kernel@...r.kernel.org>,
James Hogan <james.hogan@...tec.com>,
Paul Burton <paul.burton@...tec.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH] MIPS: smp-cps: Avoid BUG() when offlining pre-r6 CPUs
Commit 0d2808f338c7 ("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
0d2808f338c7.
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: 0d2808f338c7 ("MIPS: smp-cps: Add support for CPU hotplug...)
Signed-off-by: Matt Redfearn <matt.redfearn@...tec.com>
---
Ralf, it'd be great to get this into v4.8, if possible at this late
stage, to avoid the regression introduced in v4.8-rc1.
---
arch/mips/kernel/smp-cps.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
index e9d9fc6c754c..6183ad84cc73 100644
--- a/arch/mips/kernel/smp-cps.c
+++ b/arch/mips/kernel/smp-cps.c
@@ -513,7 +513,7 @@ static void cps_cpu_die(unsigned int cpu)
* in which case the CPC will refuse to power down the core.
*/
do {
- mips_cm_lock_other(core, vpe_id);
+ mips_cm_lock_other(core, 0);
mips_cpc_lock_other(core);
stat = read_cpc_co_stat_conf();
stat &= CPC_Cx_STAT_CONF_SEQSTATE_MSK;
--
2.7.4
Powered by blists - more mailing lists