From: Frans Pop usb: restore state before enabling device on resume When resuming from suspend, restore the PCI config before enabling the device. Signed-off-by: Frans Pop diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index 5b87ae7..85bcd80 100644 --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c @@ -389,11 +389,9 @@ int usb_hcd_pci_resume(struct pci_dev *dev) dev_dbg(hcd->self.controller, "PCI legacy resume\n"); } - /* NOTE: the PCI API itself is asymmetric here. We don't need to - * pci_set_power_state(PCI_D0) since that's part of re-enabling; - * but that won't re-enable bus mastering. Yet pci_disable_device() - * explicitly disables bus mastering... - */ + pci_set_power_state(dev, PCI_D0); + pci_restore_state(dev); + retval = pci_enable_device(dev); if (retval < 0) { dev_err(hcd->self.controller, @@ -401,7 +399,6 @@ int usb_hcd_pci_resume(struct pci_dev *dev) return retval; } pci_set_master(dev); - pci_restore_state(dev); clear_bit(HCD_FLAG_SAW_IRQ, &hcd->flags);