Re: sata suspend resume ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 [email protected] 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))
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux