xtensa: SMP: fix secondary CPU initialization
authorMax Filippov <jcmvbkbc@gmail.com>
Fri, 21 Dec 2018 16:26:20 +0000 (08:26 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Mar 2019 21:02:28 +0000 (14:02 -0700)
commit8655802aa1556962562179536eabcfc17f413053
tree45a3e0ea5dd184e9d6c5e5b004a87ec64cb11f4a
parent0165df14095b3d48c5568373e18da16784b58435
xtensa: SMP: fix secondary CPU initialization

[ Upstream commit 32a7726c4f4aadfabdb82440d84f88a5a2c8fe13 ]

- 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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/xtensa/kernel/head.S
arch/xtensa/kernel/smp.c