diff options
Diffstat (limited to 'arch/arm/mach-realview/platsmp.c')
-rw-r--r-- | arch/arm/mach-realview/platsmp.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c index 226c63102a00..bb8d6c4e4315 100644 --- a/arch/arm/mach-realview/platsmp.c +++ b/arch/arm/mach-realview/platsmp.c | |||
@@ -36,6 +36,19 @@ extern void realview_secondary_startup(void); | |||
36 | */ | 36 | */ |
37 | volatile int __cpuinitdata pen_release = -1; | 37 | volatile int __cpuinitdata pen_release = -1; |
38 | 38 | ||
39 | /* | ||
40 | * Write pen_release in a way that is guaranteed to be visible to all | ||
41 | * observers, irrespective of whether they're taking part in coherency | ||
42 | * or not. This is necessary for the hotplug code to work reliably. | ||
43 | */ | ||
44 | static void write_pen_release(int val) | ||
45 | { | ||
46 | pen_release = val; | ||
47 | smp_wmb(); | ||
48 | __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release)); | ||
49 | outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1)); | ||
50 | } | ||
51 | |||
39 | static void __iomem *scu_base_addr(void) | 52 | static void __iomem *scu_base_addr(void) |
40 | { | 53 | { |
41 | if (machine_is_realview_eb_mp()) | 54 | if (machine_is_realview_eb_mp()) |
@@ -64,8 +77,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu) | |||
64 | * let the primary processor know we're out of the | 77 | * let the primary processor know we're out of the |
65 | * pen, then head off into the C entry point | 78 | * pen, then head off into the C entry point |
66 | */ | 79 | */ |
67 | pen_release = -1; | 80 | write_pen_release(-1); |
68 | smp_wmb(); | ||
69 | 81 | ||
70 | /* | 82 | /* |
71 | * Synchronise with the boot thread. | 83 | * Synchronise with the boot thread. |
@@ -92,8 +104,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
92 | * Note that "pen_release" is the hardware CPU ID, whereas | 104 | * Note that "pen_release" is the hardware CPU ID, whereas |
93 | * "cpu" is Linux's internal ID. | 105 | * "cpu" is Linux's internal ID. |
94 | */ | 106 | */ |
95 | pen_release = cpu; | 107 | write_pen_release(cpu); |
96 | flush_cache_all(); | ||
97 | 108 | ||
98 | /* | 109 | /* |
99 | * Send the secondary CPU a soft interrupt, thereby causing | 110 | * Send the secondary CPU a soft interrupt, thereby causing |