]> git.hungrycats.org Git - linux/commitdiff
[PATCH] S3 and swsusp: fixing device_resume order
authorPavel Machek <pavel@ucw.cz>
Sat, 10 Aug 2002 09:44:25 +0000 (02:44 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sat, 10 Aug 2002 09:44:25 +0000 (02:44 -0700)
pci driver's resume must not be called during RESUME_POWER_ON because
interrupts are still off and i8259A is not initialized [OHCI kills
machine in such case, cardbus probably too.  PCI drivers just assume
initialized interrupts.]

Second hunk fixes device_resume calls to be okay according to
documentation.

drivers/pci/pci-driver.c
kernel/suspend.c

index 3ad23175d6a51633b40b3a18a806904df810044d..4055c7580993b527cb79f6311674e99f07e13b2a 100644 (file)
@@ -90,7 +90,11 @@ static int pci_device_resume(struct device * dev, u32 level)
        struct pci_dev * pci_dev = to_pci_dev(dev);
 
        if (pci_dev->driver) {
-               if (level == RESUME_POWER_ON && pci_dev->driver->resume)
+               /* We may not call PCI drivers resume at
+                  RESUME_POWER_ON because interrupts are not yet
+                  working at that point. Calling resume at
+                  RESUME_RESTORE_STATE seems like solution. */
+               if (level == RESUME_RESTORE_STATE && pci_dev->driver->resume)
                        pci_dev->driver->resume(pci_dev);
        }
        return 0;
index f11214bb9a6709c6014f42d98cc98fd483af12a8..67f26e26d5948dece67021f6aa924ed65acd7686 100644 (file)
@@ -619,8 +619,8 @@ static void free_some_memory(void)
 /* Make disk drivers accept operations, again */
 static void drivers_unsuspend(void)
 {
-       device_resume(RESUME_ENABLE);
        device_resume(RESUME_RESTORE_STATE);
+       device_resume(RESUME_ENABLE);
 }
 
 /* Called from process context */
@@ -647,8 +647,8 @@ static int drivers_suspend(void)
 static void drivers_resume(int flags)
 {
        if (flags & RESUME_PHASE1) {
-               device_resume(RESUME_ENABLE);
                device_resume(RESUME_RESTORE_STATE);
+               device_resume(RESUME_ENABLE);
        }
        if (flags & RESUME_PHASE2) {
                if(pm_suspend_state) {