]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/apm_32.c
PM: Rework handling of interrupts during suspend-resume
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / apm_32.c
index 10033fe718e0ad574f57a4f54c9d67efb72cb23e..ac7783a6743230693540178af6c13e9bfa98a383 100644 (file)
@@ -1190,8 +1190,10 @@ static int suspend(int vetoable)
        struct apm_user *as;
 
        device_suspend(PMSG_SUSPEND);
-       local_irq_disable();
+
        device_power_down(PMSG_SUSPEND);
+
+       local_irq_disable();
        sysdev_suspend(PMSG_SUSPEND);
 
        local_irq_enable();
@@ -1209,9 +1211,12 @@ static int suspend(int vetoable)
        if (err != APM_SUCCESS)
                apm_error("suspend", err);
        err = (err == APM_SUCCESS) ? 0 : -EIO;
+
        sysdev_resume();
-       device_power_up(PMSG_RESUME);
        local_irq_enable();
+
+       device_power_up(PMSG_RESUME);
+
        device_resume(PMSG_RESUME);
        queue_event(APM_NORMAL_RESUME, NULL);
        spin_lock(&user_list_lock);
@@ -1228,8 +1233,9 @@ static void standby(void)
 {
        int err;
 
-       local_irq_disable();
        device_power_down(PMSG_SUSPEND);
+
+       local_irq_disable();
        sysdev_suspend(PMSG_SUSPEND);
        local_irq_enable();
 
@@ -1239,8 +1245,9 @@ static void standby(void)
 
        local_irq_disable();
        sysdev_resume();
-       device_power_up(PMSG_RESUME);
        local_irq_enable();
+
+       device_power_up(PMSG_RESUME);
 }
 
 static apm_event_t get_event(void)