Commit 66431f4b authored by Pavel Machek's avatar Pavel Machek Committed by Linus Torvalds

[PATCH] S3 and swsusp: fixing device_resume order

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.
parent 090d3e77
...@@ -90,7 +90,11 @@ static int pci_device_resume(struct device * dev, u32 level) ...@@ -90,7 +90,11 @@ static int pci_device_resume(struct device * dev, u32 level)
struct pci_dev * pci_dev = to_pci_dev(dev); struct pci_dev * pci_dev = to_pci_dev(dev);
if (pci_dev->driver) { 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); pci_dev->driver->resume(pci_dev);
} }
return 0; return 0;
......
...@@ -619,8 +619,8 @@ static void free_some_memory(void) ...@@ -619,8 +619,8 @@ static void free_some_memory(void)
/* Make disk drivers accept operations, again */ /* Make disk drivers accept operations, again */
static void drivers_unsuspend(void) static void drivers_unsuspend(void)
{ {
device_resume(RESUME_ENABLE);
device_resume(RESUME_RESTORE_STATE); device_resume(RESUME_RESTORE_STATE);
device_resume(RESUME_ENABLE);
} }
/* Called from process context */ /* Called from process context */
...@@ -647,8 +647,8 @@ static int drivers_suspend(void) ...@@ -647,8 +647,8 @@ static int drivers_suspend(void)
static void drivers_resume(int flags) static void drivers_resume(int flags)
{ {
if (flags & RESUME_PHASE1) { if (flags & RESUME_PHASE1) {
device_resume(RESUME_ENABLE);
device_resume(RESUME_RESTORE_STATE); device_resume(RESUME_RESTORE_STATE);
device_resume(RESUME_ENABLE);
} }
if (flags & RESUME_PHASE2) { if (flags & RESUME_PHASE2) {
if(pm_suspend_state) { if(pm_suspend_state) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment