kernel-ark/arch/arm/mach-realview
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.c ARM: 6307/1: mmci: allow the card detect GPIO value not to be inverted 2010-08-26 19:54:27 +01:00
core.h RealView: Add default memory configuration 2009-11-05 10:10:36 +00:00
headsmp.S
hotplug.c ARM: CPU hotplug: remove bug checks in platform_cpu_die() 2010-12-20 15:09:10 +00:00
Kconfig ARM: 6201/1: RealView: Do not use outer_sync() on ARM11MPCore boards with L220 2010-07-02 10:10:09 +01:00
localtimer.c [ARM] smp: allow re-use of realview localtimer TWD support 2009-05-17 19:16:41 +01:00
Makefile ARM: Realview/Versatile/Integrator: separate out common clock code 2010-05-02 09:35:33 +01:00
Makefile.boot RealView: Allow PHYS_OFFSET at 0x70000000 2008-12-01 14:54:55 +00:00
platsmp.c ARM: Fix subtle race in CPU pen_release hotplug code 2010-12-20 15:09:13 +00:00
realview_eb.c arm: remove machine_desc.io_pg_offst and .phys_io 2010-10-20 00:27:46 -04:00
realview_pb11mp.c arm: remove machine_desc.io_pg_offst and .phys_io 2010-10-20 00:27:46 -04:00
realview_pb1176.c arm: remove machine_desc.io_pg_offst and .phys_io 2010-10-20 00:27:46 -04:00
realview_pba8.c arm: remove machine_desc.io_pg_offst and .phys_io 2010-10-20 00:27:46 -04:00
realview_pbx.c arm: remove machine_desc.io_pg_offst and .phys_io 2010-10-20 00:27:46 -04:00