lkml.org 
[lkml]   [2004]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Strange IO behaviour on wakeup from sleep
On Wed, 27 Oct 2004, Benjamin Herrenschmidt wrote:

> Not much datas at this point yet, but paulus and I noticed that current
> bk (happened already last saturday or so) has a very strange problem
> when waking up from sleep (suspend to ram) on our laptops.

It's a shot in the dark, but I am concerned whether timers continue to
work correctly after suspend with the following patch from Linus' bk tree.
I think jiffies may not be set behind the back of the timer subsystem, but
maybe it works if we can guarantee there are no timers scheduled.

It might be worth backing out and retesting.

Tim


[PATCH] swsusp: fix process start times after resume

http://linus.bkbits.net:8080/linux-2.5/cset@4174ae167_Yica8ChkiLcj_rmOcG1Q?nav=index.html|ChangeSet@-2w

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/10/18 23:03:02-07:00 pavel@ucw.cz
# [PATCH] swsusp: fix process start times after resume
#
# Currently, process start times change after swsusp (because they are
# derived from jiffies and current time, oops). This should fix it.
#
# Signed-off-by: Andrew Morton <akpm@osdl.org>
# Signed-off-by: Linus Torvalds <torvalds@osdl.org>
#
# arch/i386/kernel/time.c
# 2004/10/18 22:26:45-07:00 pavel@ucw.cz +5 -1
# swsusp: fix process start times after resume
#
diff -Nru a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
--- a/arch/i386/kernel/time.c 2004-10-27 03:58:08 -07:00
+++ b/arch/i386/kernel/time.c 2004-10-27 03:58:08 -07:00
@@ -319,7 +319,7 @@
return retval;
}

-static long clock_cmos_diff;
+static long clock_cmos_diff, sleep_start;

static int time_suspend(struct sys_device *dev, u32 state)
{
@@ -328,6 +328,7 @@
*/
clock_cmos_diff = -get_cmos_time();
clock_cmos_diff += get_seconds();
+ sleep_start = get_cmos_time();
return 0;
}

@@ -335,10 +336,13 @@
{
unsigned long flags;
unsigned long sec = get_cmos_time() + clock_cmos_diff;
+ unsigned long sleep_length = get_cmos_time() - sleep_start;
+
write_seqlock_irqsave(&xtime_lock, flags);
xtime.tv_sec = sec;
xtime.tv_nsec = 0;
write_sequnlock_irqrestore(&xtime_lock, flags);
+ jiffies += sleep_length * HZ;
return 0;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:07    [W:1.116 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site