]> git.hungrycats.org Git - linux/commitdiff
[PATCH] [APM] Is this the correct way to fix suspend bug introduced
authorMichael Schierl <schierlm@gmx.de>
Thu, 29 Jan 2004 14:08:53 +0000 (06:08 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Thu, 29 Jan 2004 14:08:53 +0000 (06:08 -0800)
This fixes my APM problems (without them my laptop, Acer TravelMate
210TEV (Celeron 700, 128 MB RAM), hangs after resuming from APM since
2.6.0-test4).

Modified based on comments from Pavel Machek <pavel@suse.cz>, who
has acked the updated patch.

arch/i386/kernel/apm.c

index 2212132dacfb304f864396a736fae117470871b0..75b2a8c4ae89c5cc3d874b7c69dea5dfce4c8c29 100644 (file)
@@ -1201,6 +1201,7 @@ static int suspend(int vetoable)
        }
 
        device_suspend(3);
+       device_power_down(3);
 
        /* serialize with the timer interrupt */
        write_seqlock_irq(&xtime_lock);
@@ -1234,6 +1235,7 @@ static int suspend(int vetoable)
        if (err != APM_SUCCESS)
                apm_error("suspend", err);
        err = (err == APM_SUCCESS) ? 0 : -EIO;
+       device_power_up();
        device_resume();
        pm_send_all(PM_RESUME, (void *)0);
        queue_event(APM_NORMAL_RESUME, NULL);
@@ -1252,6 +1254,7 @@ static void standby(void)
 {
        int     err;
 
+       device_power_down(3);
        /* serialize with the timer interrupt */
        write_seqlock_irq(&xtime_lock);
        /* If needed, notify drivers here */
@@ -1261,6 +1264,7 @@ static void standby(void)
        err = set_system_power_state(APM_STATE_STANDBY);
        if ((err != APM_SUCCESS) && (err != APM_NO_ERROR))
                apm_error("standby", err);
+       device_power_up();
 }
 
 static apm_event_t get_event(void)