diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-12-19 06:30:43 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-12-20 10:09:14 -0500 |
commit | d4450261e546953c4a1ce8b48e29164a57c6ed33 (patch) | |
tree | b0f06bdcf316b78a05fb6e14167b4cccb247d78f /arch/arm/mach-realview/hotplug.c | |
parent | 58613cd1d4f8c2d5f25b6c57ad7fbed80e75a67b (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-realview/hotplug.c')
-rw-r--r-- | arch/arm/mach-realview/hotplug.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/arch/arm/mach-realview/hotplug.c b/arch/arm/mach-realview/hotplug.c index e06572e6c490..b6387cfe7044 100644 --- a/arch/arm/mach-realview/hotplug.c +++ b/arch/arm/mach-realview/hotplug.c | |||
@@ -53,7 +53,7 @@ static inline void cpu_leave_lowpower(void) | |||
53 | : "cc"); | 53 | : "cc"); |
54 | } | 54 | } |
55 | 55 | ||
56 | static inline void platform_do_lowpower(unsigned int cpu) | 56 | static inline void platform_do_lowpower(unsigned int cpu, int *spurious) |
57 | { | 57 | { |
58 | /* | 58 | /* |
59 | * there is no power-control hardware on this platform, so all | 59 | * there is no power-control hardware on this platform, so all |
@@ -77,16 +77,13 @@ static inline void platform_do_lowpower(unsigned int cpu) | |||
77 | } | 77 | } |
78 | 78 | ||
79 | /* | 79 | /* |
80 | * getting here, means that we have come out of WFI without | 80 | * Getting here, means that we have come out of WFI without |
81 | * having been woken up - this shouldn't happen | 81 | * having been woken up - this shouldn't happen |
82 | * | 82 | * |
83 | * The trouble is, letting people know about this is not really | 83 | * Just note it happening - when we're woken, we can report |
84 | * possible, since we are currently running incoherently, and | 84 | * its occurrence. |
85 | * therefore cannot safely call printk() or anything else | ||
86 | */ | 85 | */ |
87 | #ifdef DEBUG | 86 | (*spurious)++; |
88 | printk("CPU%u: spurious wakeup call\n", cpu); | ||
89 | #endif | ||
90 | } | 87 | } |
91 | } | 88 | } |
92 | 89 | ||
@@ -102,17 +99,22 @@ int platform_cpu_kill(unsigned int cpu) | |||
102 | */ | 99 | */ |
103 | void platform_cpu_die(unsigned int cpu) | 100 | void platform_cpu_die(unsigned int cpu) |
104 | { | 101 | { |
102 | int spurious = 0; | ||
103 | |||
105 | /* | 104 | /* |
106 | * we're ready for shutdown now, so do it | 105 | * we're ready for shutdown now, so do it |
107 | */ | 106 | */ |
108 | cpu_enter_lowpower(); | 107 | cpu_enter_lowpower(); |
109 | platform_do_lowpower(cpu); | 108 | platform_do_lowpower(cpu, &spurious); |
110 | 109 | ||
111 | /* | 110 | /* |
112 | * bring this CPU back into the world of cache | 111 | * bring this CPU back into the world of cache |
113 | * coherency, and then restore interrupts | 112 | * coherency, and then restore interrupts |
114 | */ | 113 | */ |
115 | cpu_leave_lowpower(); | 114 | cpu_leave_lowpower(); |
115 | |||
116 | if (spurious) | ||
117 | pr_warn("CPU%u: %u spurious wakeup calls\n", cpu, spurious); | ||
116 | } | 118 | } |
117 | 119 | ||
118 | int platform_cpu_disable(unsigned int cpu) | 120 | int platform_cpu_disable(unsigned int cpu) |