kernel_optimize_test/arch/arm/mach-vexpress
Russell King 3705ff6da5 ARM: Fix subtle race in CPU pen_release hotplug code
There is a subtle race in the CPU hotplug code, where a CPU which has
been offlined can online itself before being requested, which results
in things going astray on the next online/offline cycle.

What happens in the normal online/offline/online cycle is:

	CPU0			CPU3
	requests boot of CPU3
	pen_release = 3
	flush cache line
				checks pen_release, reads 3
				starts boot
				pen_release = -1
	... requests CPU3 offline ...
				... dies ...
				checks pen_release, reads -1
	requests boot of CPU3
	pen_release = 3
	flush cache line
				checks pen_release, reads 3
				starts boot
				pen_release = -1

However, as the write of -1 of pen_release is not fully flushed back to
memory, and the checking of pen_release is done with caches disabled,
this allows CPU3 the opportunity to read the old value of pen_release:

	CPU0			CPU3
	requests boot of CPU3
	pen_release = 3
	flush cache line
				checks pen_release, reads 3
				starts boot
				pen_release = -1
	... requests CPU3 offline ...
				... dies ...
				checks pen_release, reads 3
				starts boot
				pen_release = -1
	requests boot of CPU3
	pen_release = 3
	flush cache line

Fix this by grouping the write of pen_release along with its cache line
flushing code to ensure that any update to pen_release is always pushed
out to physical memory.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-12-20 15:09:13 +00:00
..
include/mach ARM: SMP: remove smp_mpidr.h 2010-12-20 15:09:11 +00:00
core.h
ct-ca9x4.c ARM: 6472/1: vexpress ct-ca9x4: only set twd_base if local timers are being used 2010-11-10 15:11:19 +00:00
headsmp.S ARM: Add Versatile Express SMP support 2010-05-02 09:35:39 +01:00
Kconfig ARM: Add Versatile Express CA9x4 processor support 2010-05-02 09:35:39 +01:00
localtimer.c ARM: Add Versatile Express SMP support 2010-05-02 09:35:39 +01:00
Makefile ARM: Add Versatile Express SMP support 2010-05-02 09:35:39 +01:00
Makefile.boot
platsmp.c ARM: Fix subtle race in CPU pen_release hotplug code 2010-12-20 15:09:13 +00:00
v2m.c ARM: fix section mismatch warnings in Versatile Express 2010-10-05 11:30:40 +01:00