Re: APM Suspend Problem

From: Felipe Alfaro Solana
Date: Thu Nov 27 2003 - 06:47:28 EST


On Thu, 2003-11-27 at 07:20, Misha Nasledov wrote:
> Hi,
>
> Since about 2.6.0-test9, my ThinkPad T21 no longer suspends with APM. I had
> issues with it suspending before, I don't remember exactly what issues, but I
> know that it definitely worked in -test2. When I hit the key on my laptop to
> suspend, it will turn off the LCD and the HD will spin down, but the machine
> will not actually suspend. Here is what is printed out on the console when I
> hit the suspend key and then when I hit another key to "wake" it up:

Could you please try the attached patch? It allows my system to suspend
and resume using APM flawlessly.
--- 1.11/drivers/base/power/resume.c Mon Aug 25 11:08:21 2003
+++ edited/drivers/base/power/resume.c Fri Oct 10 21:06:07 2003
@@ -22,8 +22,17 @@

int resume_device(struct device * dev)
{
- if (dev->bus && dev->bus->resume)
- return dev->bus->resume(dev);
+ if (dev->bus && dev->bus->resume) {
+ int retval;
+
+ /* drop lock so the call can use device_del() to clean up
+ * after unplugged (or otherwise vanished) child devices
+ */
+ up(&dpm_sem);
+ retval = dev->bus->resume(dev);
+ down(&dpm_sem);
+ return retval;
+ }
return 0;
}