lkml.org 
[lkml]   [2016]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 09/15] MIPS: smp-cps: Ensure our VP ident calculation is correct
    Date
    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>
    ---

    arch/mips/kernel/smp-cps.c | 11 +++++++++++
    1 file changed, 11 insertions(+)

    diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
    index 2ad4e4c..7b35dec 100644
    --- 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);
    }
    --
    2.7.0
    \
     
     \ /
      Last update: 2016-02-03 05:01    [W:4.111 / U:0.052 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site