Re: 2.6.15-rc5-mm2: broken resume from disk on x86-64

Rafael J. Wysocki
2005-12-11T16:08:31Z

It is impossible to resume from disk on x86-64 machines due to the changes
introduced by the x86_64-hpet-overflow patch. The problem is known
(appeared in -mm1), but there's no official fix yet.

The appended patch fixes the issue, although I'm not sure if this is the right
fix.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

arch/x86_64/kernel/time.c | 9 +++++++++
1 files changed, 9 insertions(+)

Index: linux-2.6.15-rc5-mm1/arch/x86_64/kernel/time.c
===================================================================
--- linux-2.6.15-rc5-mm1.orig/arch/x86_64/kernel/time.c 2005-12-08 22:57:33.000000000 +0100
+++ linux-2.6.15-rc5-mm1/arch/x86_64/kernel/time.c 2005-12-09 14:37:31.000000000 +0100
@@ -65,6 +65,7 @@ unsigned long hpet_tick;
static int hpet_use_timer;
unsigned long vxtime_hz = PIT_TICK_RATE;
unsigned long long monotonic_base;
+static int vxtime_last_invalid; /* for the interrupt handler */
static int report_lost_ticks; /* command line option */

@@ -417,6 +418,13 @@ static irqreturn_t timer_interrupt(int i

rdtscll_sync(&tsc);

+ if (vxtime_last_invalid) {
+ if (vxtime.mode == VXTIME_HPET)
+ vxtime.last = offset;
+ vxtime.last_tsc = tsc;
+ vxtime_last_invalid = 0;
+ }
+
if (vxtime.mode == VXTIME_HPET) {
if (hpet64 > 0) {
unsigned long delta = offset - vxtime.last;
@@ -1125,6 +1133,7 @@ static int timer_resume(struct sys_devic

sec = ctime + clock_cmos_diff;
write_seqlock_irqsave(&xtime_lock,flags);
+ vxtime_last_invalid = 1;
xtime.tv_sec = sec;
xtime.tv_nsec = 0;
write_sequnlock_irqrestore(&xtime_lock,flags);