Re: 2.6.27-rc6: nohz + s2ram = need to press keys to get progress

From: Thomas Gleixner
Date: Tue Sep 16 2008 - 13:03:20 EST


On Tue, 16 Sep 2008, Thomas Gleixner wrote:
> On Mon, 15 Sep 2008, Pavel Machek wrote:
> > > cg-seek here, and problem is back. Good. I can get the

Does the patch below fix it ?

Thanks,

tglx
----
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 1876b52..eb8736f 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -69,6 +69,9 @@ void clockevents_set_mode(struct clock_event_device *dev,
dev->set_mode(mode, dev);
dev->mode = mode;
}
+
+ if (mode == CLOCK_EVT_MODE_SHUTDOWN)
+ dev->next_event.tv64 = KTIME_MAX;
}

/**
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index 2f5a382..6b0b230 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -434,6 +434,19 @@ again:
}

/*
+ * We shutdown the device which will stop anyway, but we keep the
+ * next_event untouched as it carries the information when we
+ * broadcast.
+ */
+static void tick_broadcast_shutdown_device(struct clock_event_device *dev)
+{
+ if (dev->mode != CLOCK_EVT_MODE_SHUTDOWN) {
+ dev->set_mode(CLOCK_EVT_MODE_SHUTDOWN, dev);
+ dev->mode = CLOCK_EVT_MODE_SHUTDOWN;
+ }
+}
+
+/*
* Powerstate information: The system enters/leaves a state, where
* affected devices might stop
*/
@@ -464,7 +477,7 @@ void tick_broadcast_oneshot_control(unsigned long reason)
if (reason == CLOCK_EVT_NOTIFY_BROADCAST_ENTER) {
if (!cpu_isset(cpu, tick_broadcast_oneshot_mask)) {
cpu_set(cpu, tick_broadcast_oneshot_mask);
- clockevents_set_mode(dev, CLOCK_EVT_MODE_SHUTDOWN);
+ tick_broadcast_shutdown_device(dev);
if (dev->next_event.tv64 < bc->next_event.tv64)
tick_broadcast_set_event(dev->next_event, 1);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/