swsusp & modules [was Re: [linux-pm] [Fwd: Re: PM messages]]

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

 



Hi!

> > > Remember that we have two lists of devices - regular devices and system
> > > devices. The stopping and starting (or freezing and thawing) that I'm
> > > talking about is only for regular devices. System devices are not even
> > > touched at all before writing the image, so that behavior wouldn't change.
> > > 
> > > Note, though, that is likely a bug, since we don't appear to be saving any
> > > system device state..
> > 
> > Yes, its a bug, and people tell me that clocks are wrong after resume
> > due to this. I'll need to fix it sooner on later.

Ok, here's probable fix. It compiles.

> STR needs to suspend/resume those timers too, right?
> If we go the "STD = STR plus image-to-disk" route,
> we should need just a single patch ... ;)

Well, STD != STR plus image-to-disk.

For std you need to free 50% memory, plus you need freezing phase,
plus atomic snapshot. That's pretty different code.

STR should already handle time okay, because device_power_down() calls
sysdev_suspend().
								Pavel


--- clean/kernel/power/disk.c	2004-10-01 00:30:32.000000000 +0200
+++ linux/kernel/power/disk.c	2004-10-29 00:30:40.000000000 +0200
@@ -102,6 +116,7 @@
 
 static void finish(void)
 {
+	sysdev_resume();
 	device_resume();
 	platform_finish();
 	enable_nonboot_cpus();
@@ -133,8 +148,12 @@
 	free_some_memory();
 
 	disable_nonboot_cpus();
-	if ((error = device_suspend(PM_SUSPEND_DISK)))
+	if ((error = device_suspend(PM_SUSPEND_DISK))) {
+		printk("Some devices failed to suspend\n");
 		goto Finish;
+	}
+
+	sysdev_suspend(POWER_SUSPEND_DISK);
 
 	return 0;
  Finish:
--- clean/kernel/power/swsusp.c	2004-10-19 14:16:29.000000000 +0200
+++ linux/kernel/power/swsusp.c	2004-10-29 00:32:26.000000000 +0200
@@ -825,6 +812,7 @@
 int swsusp_write(void)
 {
 	int error;
+	sysdev_resume();
 	device_resume();
 	lock_swapdevices();
 	error = write_suspend_image();


-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux