Commit 2bd40827 authored by RongQing.Li's avatar RongQing.Li Committed by Ralf Baechle

MIPS: CMP/SMTC: Fix tc_id calculation

Currently the tc_id code is:

  (read_c0_tcbind() >> TCBIND_CURTC_SHIFT) & TCBIND_CURTC;

After processing this becomes:

  (read_c0_tcbind() >> 21) & ((0xff) << 21)

But it should be:

  (read_c0_tcbind() & ((0xff)<< 21)) >> 21
Signed-off-by: default avatarRongQing.Li <roy.qing.li@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/4077/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent fea7a08a
...@@ -102,7 +102,7 @@ static void cmp_init_secondary(void) ...@@ -102,7 +102,7 @@ static void cmp_init_secondary(void)
c->vpe_id = (read_c0_tcbind() >> TCBIND_CURVPE_SHIFT) & TCBIND_CURVPE; c->vpe_id = (read_c0_tcbind() >> TCBIND_CURVPE_SHIFT) & TCBIND_CURVPE;
#endif #endif
#ifdef CONFIG_MIPS_MT_SMTC #ifdef CONFIG_MIPS_MT_SMTC
c->tc_id = (read_c0_tcbind() >> TCBIND_CURTC_SHIFT) & TCBIND_CURTC; c->tc_id = (read_c0_tcbind() & TCBIND_CURTC) >> TCBIND_CURTC_SHIFT;
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment