Hi!

Without this fix, usb can not survive critical suspend. As we have at
least 5 seconds available, calling everyone in-kernel is safe.

                                                                Pavel

--- clean//arch/i386/kernel/apm.c       Fri Mar 10 02:15:02 2000
+++ linux/arch/i386/kernel/apm.c        Fri May  5 23:58:31 2000
@@ -921,6 +921,10 @@
        case APM_USER_SUSPEND:
                /* map all suspends to ACPI D3 */
                if (pm_send_all(PM_SUSPEND, (void *)3)) {
+                       if (event == APM_CRITICAL_SUSPEND) {
+                               printk( "apm: Critical suspend was vetoed, expect 
+armagedon\n" );
+                               return 0;
+                       }
                        if (apm_bios_info.version > 0x100)
                                apm_set_power_state(APM_STATE_REJECT);
                        return 0;
@@ -933,7 +937,6 @@
                break;
        }
 
-       queue_event(event, sender);
        return 1;
 }
 
@@ -967,6 +970,7 @@
                                break;
 #endif
                        if (send_event(event, NULL)) {
+                               queue_event(event, NULL);
 #ifdef CONFIG_APM_IGNORE_MULTIPLE_SUSPEND
                                waiting_for_resume = 1;
 #endif
@@ -991,6 +995,7 @@
                                break;
 #endif
                        if (send_event(event, NULL)) {
+                               queue_event(event, NULL);
 #ifdef CONFIG_APM_IGNORE_MULTIPLE_SUSPEND
                                waiting_for_resume = 1;
 #endif
@@ -1011,6 +1016,7 @@
 #endif
                        set_time();
                        send_event(event, NULL);
+                       queue_event(event, NULL);
                        break;
 
                case APM_CAPABILITY_CHANGE:
@@ -1024,6 +1030,7 @@
                        break;
 
                case APM_CRITICAL_SUSPEND:
+                       send_event(event, NULL);        /* We can only hope it worked; 
+critical suspend may not fail */
                        (void) suspend();
                        break;
                }

-- 
I'm [EMAIL PROTECTED] "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents me at [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to