Re: Totally broken PCI PM calls

From: David Brownell
Date: Mon Oct 11 2004 - 22:12:23 EST


On Monday 11 October 2004 3:12 pm, Stefan Seyfried wrote:
> David Brownell wrote:
>
> > The machines I've tested with relatively generic 2.6.9-rc kernels
> > don't use BIOS support for S4 when I call swsusp.
>
> first do either
> echo platform > /sys/power/disk # for S4
> echo shutdown > /sys/power/disk # for poweroff
>
> then do
> echo disk > /sys/power/state

Oddly enough, neither of them work lately for me.
They each resume immediately after writing the
image to disk.

- Dave

p.s. I find the /sys/power/disk file mildly cryptic, maybe
other folk will find the attached patch slightly more
informative about what this interface can do.



--- 1.19/kernel/power/disk.c Thu Sep 9 08:45:13 2004
+++ edited/kernel/power/disk.c Fri Oct 1 11:01:41 2004
@@ -282,7 +282,14 @@

static ssize_t disk_show(struct subsystem * subsys, char * buf)
{
- return sprintf(buf,"%s\n",pm_disk_modes[pm_disk_mode]);
+ return sprintf(buf,"%s%s %s%s %s%s\n",
+ (pm_disk_mode == pm_ops->pm_disk_mode) ? "*" : "",
+ pm_disk_modes[pm_ops->pm_disk_mode],
+ (pm_disk_mode == PM_DISK_SHUTDOWN) ? "*" : "",
+ pm_disk_modes[PM_DISK_SHUTDOWN],
+ (pm_disk_mode == PM_DISK_REBOOT) ? "*" : "",
+ pm_disk_modes[PM_DISK_REBOOT]
+ );
}