Cc: Rafael J. Wysocki <rjw@...>, Jeff Chua <jeff.chua.linux@...>, <rusty@...>, <vatsa@...>, <zwane@...>, kernel list <linux-kernel@...>, Len Brown <lenb@...>
Pavel,
On Fri, 2007-09-14 at 14:38 +0200, Pavel Machek wrote:
Venki sent me an initial patch, but it has issues with the notify
ordering. Find below my "cache the broadcast flags" version for testing.
Thanks,
tglx
---
kernel/time/tick-broadcast.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
Index: linux-2.6/kernel/time/tick-broadcast.c
===================================================================
--- linux-2.6.orig/kernel/time/tick-broadcast.c 2007-09-14 13:22:29.000000000 +0200
+++ linux-2.6/kernel/time/tick-broadcast.c 2007-09-14 13:22:29.000000000 +0200
@@ -261,10 +261,25 @@ void tick_broadcast_on_off(unsigned long
int cpu = get_cpu();
if (!cpu_isset(*oncpu, cpu_online_map)) {
- printk(KERN_ERR "tick-braodcast: ignoring broadcast for "
- "offline CPU #%d\n", *oncpu);
- } else {
+ unsigned long flags;
+
+ spin_lock_irqsave(&tick_broadcast_lock, flags);
+ /*
+ * We need to cache the broadcast flag for offline
+ * CPUs. ACPI currently does not reevaluate the
+ * broadcast flag when a CPU goes online again. Adding
+ * a cpu notifier to ACPI is probably the correct
+ * solution, but it is hard to get this correct due to
+ * notify ordering problems. So caching the flag is
+ * the safe solution for now.
+ */
+ if (reason == CLOCK_EVT_NOTIFY_BROADCAST_ON)
+ cpu_set(*oncpu, tick_broadcast_mask);
+ else
+ cpu_clear(*oncpu, tick_broadcast_mask);
+ spin_unlock_irqrestore(&tick_broadcast_lock, flags);
+ } else {
if (cpu == *oncpu)
tick_do_broadcast_on_off(&reason);
else
-