mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Chua <jeff.tw.chua@gmail.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: Chris Ball <cjb@mrao.cam.ac.uk>, Pavel Machek <pavel@suse.cz>,
	Arkadiusz Miskiewicz <arekm@maven.pl>,
	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: Sun, 23 Apr 2006 21:52:21 +0800 (SGT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0604232133380.2890@boston.corp.fedex.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0604231341310.2515@blonde.wat.veritas.com>

On Sun, 23 Apr 2006, Hugh Dickins wrote:

> On Sat, 22 Apr 2006, Chris Ball wrote:
>> FWIW, this patch fixes S3 resume for me too.  I'm on an Alienware m5500
>> using sd_mod and ata_piix, and I think your T43p is using AHCI, so it
>> seems that this fixes a libata-wide problem rather than something
>> specific to your hardware.
>
> Thanks for the info, that is useful; but in fact I'm ata_piix not ahci.


May be just me, not matter what I tried, it still doesn't work. Closest I 
can get is to use "resume=/dev/sda" on boot, able to suspend, able to 
resume to X windows, can do anything, but can't access disk. ... simple 
"ls" would hang. Dmesg is show SATA disk timeout.


I've tried both "piix" and "ahci". Both suspend to disk and mem.


My config ...
 	CONFIG_SOFTWARE_SUSPEND=y
 	CONFIG_PM_STD_PARTITION="/dev/sda3"
 	CONFIG_SUSPEND_SMP=y
 	CONFIG_SUSPEND2_CRYPTO=y
 	CONFIG_SUSPEND2=y
 	CONFIG_SUSPEND2_SWAPWRITER=y
 	CONFIG_SUSPEND2_DEFAULT_RESUME2="swap:/dev/sda3"
 	CONFIG_SUSPEND_SHARED=y


Tried suspending via ...

 	echo shutdown > /sys/power/disk; echo disk > /sys/power/state
 	echo platform > /sys/power/disk; echo disk > /sys/power/state
 	echo mem > /sys/power/state


Grub.cfg ...
 	linux /linux/bzc1 root=/dev/sda2 resume=/dev/sda3


To use "piix" ...
 	Power On -> BIOS Setup -> SATA -> select "Compatibility"

To use "ahci" ...
 	Power On -> BIOS Setup -> SATA -> select "AHCI"


Linux version is 2.6.17-rc2. IBM X60s is Pentium D, so SMP ... may be this 
has something to do with it.

I would really like to get suspend to work, so whatever ideas you've, I'm 
willing to try it.


Thanks,
Jeff.

PS. Official email jchua at fedex dot com, but simply got too much spam at 
jeffchua@silk.corp.fedex.com and not easy to access as I'm travelling now.



--- arch/i386/kernel/time.c.org	2006-04-21 22:32:15 +0800
+++ arch/i386/kernel/time.c	2006-04-21 22:34:01 +0800
@@ -379,6 +379,8 @@
  }

  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 +388,8 @@
  	/*
  	 * 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 +408,11 @@
  		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;
--- linux/drivers/scsi/libata-core.c.org	2006-04-23 00:27:00 +0800
+++ linux/drivers/scsi/libata-core.c	2006-04-23 00:22:47 +0800
@@ -4287,7 +4287,8 @@
  int ata_device_resume(struct ata_port *ap, struct ata_device *dev)
  {
  	if (ap->flags & ATA_FLAG_SUSPENDED) {
  		ap->flags &= ~ATA_FLAG_SUSPENDED;
+		ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT);
  		ata_set_mode(ap);
  	}
  	if (!ata_dev_present(dev))

      reply	other threads:[~2006-04-23 13:52 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-19 15:26 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
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 [this message]

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=Pine.LNX.4.64.0604232133380.2890@boston.corp.fedex.com \
    --to=jeff.tw.chua@gmail.com \
    --cc=arekm@maven.pl \
    --cc=axboe@suse.de \
    --cc=cjb@mrao.cam.ac.uk \
    --cc=hugh@veritas.com \
    --cc=jeff@garzik.org \
    --cc=jeffchua@silk.corp.fedex.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=pavel@suse.cz \
    /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

all inboxes | Powered by JetHome®