aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/kernel/head.S
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2018-12-21 08:26:20 -0800
committerMax Filippov <jcmvbkbc@gmail.com>2019-01-26 02:02:13 -0800
commit32a7726c4f4aadfabdb82440d84f88a5a2c8fe13 (patch)
tree5cdf2947f361d0d90c3322f3121316f93870bd5c /arch/xtensa/kernel/head.S
parentxtensa: SMP: fix ccount_timer_shutdown (diff)
downloadlinux-dev-32a7726c4f4aadfabdb82440d84f88a5a2c8fe13.tar.xz
linux-dev-32a7726c4f4aadfabdb82440d84f88a5a2c8fe13.zip
xtensa: SMP: fix secondary CPU initialization
- add missing memory barriers to the secondary CPU synchronization spin loops; add comment to the matching memory barrier in the boot_secondary and __cpu_die functions; - use READ_ONCE/WRITE_ONCE to access cpu_start_id/cpu_start_ccount instead of reading/writing them directly; - re-initialize cpu_running every time before starting secondary CPU to flush possible previous CPU startup results. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/kernel/head.S')
-rw-r--r--arch/xtensa/kernel/head.S5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/xtensa/kernel/head.S b/arch/xtensa/kernel/head.S
index da08e75100ab..7f009719304e 100644
--- a/arch/xtensa/kernel/head.S
+++ b/arch/xtensa/kernel/head.S
@@ -276,12 +276,13 @@ should_never_return:
movi a2, cpu_start_ccount
1:
+ memw
l32i a3, a2, 0
beqi a3, 0, 1b
movi a3, 0
s32i a3, a2, 0
- memw
1:
+ memw
l32i a3, a2, 0
beqi a3, 0, 1b
wsr a3, ccount
@@ -317,11 +318,13 @@ ENTRY(cpu_restart)
rsr a0, prid
neg a2, a0
movi a3, cpu_start_id
+ memw
s32i a2, a3, 0
#if XCHAL_DCACHE_IS_WRITEBACK
dhwbi a3, 0
#endif
1:
+ memw
l32i a2, a3, 0
dhi a3, 0
bne a2, a0, 1b