diff options
| author | Paul Burton <paul.burton@imgtec.com> | 2016-02-03 03:15:29 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@google.com> | 2018-02-05 08:58:34 -0800 |
| commit | 85e9df5b2a8347cd124042faab2c2d0f85b5fd04 (patch) | |
| tree | 229321667147a540eecb197cec95b9a4c8de3bd3 | |
| parent | 11afd7041257637e50e6fbd830b294f58879f901 (diff) | |
UPSTREAM: MIPS: smp-cps: Ensure our VP ident calculation is correct
When bringing up a CPU, ensure that its local ID as provided by the GIC
matches up with our calculation of it. This is vital, since if the
condition doesn't hold then we won't have configured interrupts
correctly for the VP.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: Niklas Cassel <niklas.cassel@axis.com>
Cc: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/12335/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
(cherry picked from commit ba1c0a490a1fa61971b1cf9dd89acc7b4424e798)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
| -rw-r--r-- | arch/mips/kernel/smp-cps.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c index e04c8057b882..7f7ac25d379b 100644 --- a/arch/mips/kernel/smp-cps.c +++ b/arch/mips/kernel/smp-cps.c @@ -304,6 +304,17 @@ static void cps_init_secondary(void) if (cpu_has_mipsmt) dmt(); + if (mips_cm_revision() >= CM_REV_CM3) { + unsigned ident = gic_read_local_vp_id(); + + /* + * Ensure that our calculation of the VP ID matches up with + * what the GIC reports, otherwise we'll have configured + * interrupts incorrectly. + */ + BUG_ON(ident != mips_cm_vp_id(smp_processor_id())); + } + change_c0_status(ST0_IM, STATUSF_IP2 | STATUSF_IP3 | STATUSF_IP4 | STATUSF_IP5 | STATUSF_IP6 | STATUSF_IP7); } |
