public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arkadiusz Miskiewicz <arekm@maven.pl>
To: Hugh Dickins <hugh@veritas.com>
Cc: Jeff Chua <jeffchua@silk.corp.fedex.com>,
	Jeff Garzik <jeff@garzik.org>, Matt Mackall <mpm@selenic.com>,
	Jens Axboe <axboe@suse.de>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: sata suspend resume ...
Date: Thu, 20 Apr 2006 15:25:20 +0200	[thread overview]
Message-ID: <200604201525.20484.arekm@maven.pl> (raw)
In-Reply-To: <Pine.LNX.4.64.0604191659230.7660@blonde.wat.veritas.com>

On Wednesday 19 April 2006 18:13, Hugh Dickins wrote:

> A bisection found that Matt Mackall's sensible
> rc1 patch, to speed up get_cmos_time, has removed what often used to be
> a 2 second delay in resuming: things work well when I reinstate that
> delay (1 second has proved not enough).  Below is the patch I'm using -
> where I've failed to resist mucking around to avoid those double calls
> to get_cmos_time, sorry: really it's just mdelay(2000) needed somewhere
> (until someone who knows puts in something more scientific).

FYI: I've started using 2.6.17rc2 + that patch and now resume (from suspend to 
ram) works well on ThinkPad Z60m! (so far several suspend/resume cycles)


> Hugh
>
> --- 2.6.17-rc2/arch/i386/kernel/time.c	2006-03-20 05:53:29.000000000 +0000
> +++ linux/arch/i386/kernel/time.c	2006-04-19 09:56:02.000000000 +0100
> @@ -379,6 +379,7 @@ void notify_arch_cmos_timer(void)
>  }
>
>  static long clock_cmos_diff, sleep_start;
> +unsigned long resume_mdelay = 2000;
>
>  static struct timer_opts *last_timer;
>  static int timer_suspend(struct sys_device *dev, pm_message_t state)
> @@ -386,9 +387,8 @@ static int timer_suspend(struct sys_devi
>  	/*
>  	 * Estimate time zone so that set_time can update the clock
>  	 */
> -	clock_cmos_diff = -get_cmos_time();
> -	clock_cmos_diff += get_seconds();
>  	sleep_start = get_cmos_time();
> +	clock_cmos_diff = get_seconds() - sleep_start;
>  	last_timer = cur_timer;
>  	cur_timer = &timer_none;
>  	if (last_timer->suspend)
> @@ -407,10 +407,11 @@ static int timer_resume(struct sys_devic
>  		hpet_reenable();
>  #endif
>  	setup_pit_timer();
> -	sec = get_cmos_time() + clock_cmos_diff;
> -	sleep_length = (get_cmos_time() - sleep_start) * HZ;
> +	mdelay(resume_mdelay);
> +	sec = get_cmos_time();
> +	sleep_length = (sec - sleep_start) * HZ;
>  	write_seqlock_irqsave(&xtime_lock, flags);
> -	xtime.tv_sec = sec;
> +	xtime.tv_sec = clock_cmos_diff + sec;
>  	xtime.tv_nsec = 0;
>  	jiffies_64 += sleep_length;
>  	wall_jiffies += sleep_length;


-- 
Arkadiusz Miśkiewicz        PLD/Linux Team
arekm / maven.pl            http://ftp.pld-linux.org/

  parent reply	other threads:[~2006-04-20 13:25 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-19 15:26 sata suspend resume Jeff Chua
2006-04-19 15:52 ` Arkadiusz Miskiewicz
2006-04-20  2:18   ` Jeff Chua
2006-04-19 16:13 ` Hugh Dickins
2006-04-19 16:56   ` Arkadiusz Miskiewicz
2006-04-19 17:08     ` Hugh Dickins
2006-04-19 21:49   ` Matt Mackall
2006-04-19 22:50     ` Hugh Dickins
2006-04-19 22:57       ` Matt Mackall
2006-04-19 23:26         ` Hugh Dickins
2006-04-20 13:25   ` Arkadiusz Miskiewicz [this message]
2006-04-20 13:47   ` Pavel Machek
2006-04-21 12:49     ` Hugh Dickins
2006-04-21 16:39       ` Pavel Machek
2006-04-21 20:44         ` Hugh Dickins
2006-04-21 20:50           ` Matt Mackall
2006-04-21 21:15           ` Pavel Machek
2006-04-21 21:36           ` Jeff Garzik
2006-04-23 12:58             ` Hugh Dickins
2006-04-29 18:06               ` Hugh Dickins
2006-04-21 23:39           ` Chris Ball
2006-04-23 12:42             ` Hugh Dickins
2006-04-23 13:52               ` Jeff Chua

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200604201525.20484.arekm@maven.pl \
    --to=arekm@maven.pl \
    --cc=axboe@suse.de \
    --cc=hugh@veritas.com \
    --cc=jeff@garzik.org \
    --cc=jeffchua@silk.corp.fedex.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox