projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
835d2b4
)
MIPS: smp-cps: Ensure our VP ident calculation is correct
author
Paul Burton
<
[email protected]
>
Wed, 3 Feb 2016 03:15:29 +0000
(
03:15
+0000)
committer
Ralf Baechle
<
[email protected]
>
Fri, 13 May 2016 12:01:49 +0000
(14:01 +0200)
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 <
[email protected]
>
Cc: Rusty Russell <
[email protected]
>
Cc: Matt Redfearn <
[email protected]
>
Cc: Niklas Cassel <
[email protected]
>
Cc: Ezequiel Garcia <
[email protected]
>
Cc:
[email protected]
Cc:
[email protected]
Patchwork: https://patchwork.linux-mips.org/patch/12335/
Signed-off-by: Ralf Baechle <
[email protected]
>
arch/mips/kernel/smp-cps.c
patch
|
blob
|
history
diff --git
a/arch/mips/kernel/smp-cps.c
b/arch/mips/kernel/smp-cps.c
index 253e1409338c146706ffb730952fb880c30e5b5d..9d9c7ff61d4dfd84528d71c8227830039d9ba5e2 100644
(file)
--- a/
arch/mips/kernel/smp-cps.c
+++ b/
arch/mips/kernel/smp-cps.c
@@
-307,6
+307,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);
}