aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s5pv310/hotplug.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-12-19 06:30:43 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-12-20 10:09:14 -0500
commitd4450261e546953c4a1ce8b48e29164a57c6ed33 (patch)
treeb0f06bdcf316b78a05fb6e14167b4cccb247d78f /arch/arm/mach-s5pv310/hotplug.c
parent58613cd1d4f8c2d5f25b6c57ad7fbed80e75a67b (diff)
ARM: CPU hotplug: fix reporting of spurious wakeups
The original scheme for reporting spurious wakeups was broken - it tried to use printk() from a context which wasn't coherent with the other CPUs, which risks corrupting the printk() data. Fix this by noting the number spurious wakeups, and only report them when we are properly woken - when we will be coherent with the rest of the system. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-s5pv310/hotplug.c')
-rw-r--r--arch/arm/mach-s5pv310/hotplug.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/arch/arm/mach-s5pv310/hotplug.c b/arch/arm/mach-s5pv310/hotplug.c
index ea951ef6ea5..951ba6d63d2 100644
--- a/arch/arm/mach-s5pv310/hotplug.c
+++ b/arch/arm/mach-s5pv310/hotplug.c
@@ -56,7 +56,7 @@ static inline void cpu_leave_lowpower(void)
56 : "cc"); 56 : "cc");
57} 57}
58 58
59static inline void platform_do_lowpower(unsigned int cpu) 59static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
60{ 60{
61 /* 61 /*
62 * there is no power-control hardware on this platform, so all 62 * there is no power-control hardware on this platform, so all
@@ -80,16 +80,13 @@ static inline void platform_do_lowpower(unsigned int cpu)
80 } 80 }
81 81
82 /* 82 /*
83 * getting here, means that we have come out of WFI without 83 * Getting here, means that we have come out of WFI without
84 * having been woken up - this shouldn't happen 84 * having been woken up - this shouldn't happen
85 * 85 *
86 * The trouble is, letting people know about this is not really 86 * Just note it happening - when we're woken, we can report
87 * possible, since we are currently running incoherently, and 87 * its occurrence.
88 * therefore cannot safely call printk() or anything else
89 */ 88 */
90#ifdef DEBUG 89 (*spurious)++;
91 printk(KERN_WARN "CPU%u: spurious wakeup call\n", cpu);
92#endif
93 } 90 }
94} 91}
95 92
@@ -105,17 +102,22 @@ int platform_cpu_kill(unsigned int cpu)
105 */ 102 */
106void platform_cpu_die(unsigned int cpu) 103void platform_cpu_die(unsigned int cpu)
107{ 104{
105 int spurious = 0;
106
108 /* 107 /*
109 * we're ready for shutdown now, so do it 108 * we're ready for shutdown now, so do it
110 */ 109 */
111 cpu_enter_lowpower(); 110 cpu_enter_lowpower();
112 platform_do_lowpower(cpu); 111 platform_do_lowpower(cpu, &spurious);
113 112
114 /* 113 /*
115 * bring this CPU back into the world of cache 114 * bring this CPU back into the world of cache
116 * coherency, and then restore interrupts 115 * coherency, and then restore interrupts
117 */ 116 */
118 cpu_leave_lowpower(); 117 cpu_leave_lowpower();
118
119 if (spurious)
120 pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious);
119} 121}
120 122
121int platform_cpu_disable(unsigned int cpu) 123int platform_cpu_disable(unsigned int cpu)