Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: smp-cps: use CPC core-other locking

The core which the CPC core-other region relates to is based upon the
core-local core-other addressing register. As its name suggests this
register is shared between all VPEs within a core, and if there is a
possibility that multiple VPEs within a core will attempt to access
another core simultaneously then locking is required. This wasn't
previously a problem with the only user being cpu0 during boot, but will
be an issue once hotplug is implemented & may race with other users such
as cpuidle.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>

+2 -3
+2 -3
arch/mips/kernel/smp-cps.c
··· 161 161 write_gcr_access(access); 162 162 163 163 if (mips_cpc_present()) { 164 - /* Select the appropriate core */ 165 - write_cpc_cl_other(core << CPC_Cx_OTHER_CORENUM_SHF); 166 - 167 164 /* Reset the core */ 165 + mips_cpc_lock_other(core); 168 166 write_cpc_co_cmd(CPC_Cx_CMD_RESET); 167 + mips_cpc_unlock_other(); 169 168 } else { 170 169 /* Take the core out of reset */ 171 170 write_gcr_co_reset_release(0);