commit e73843999856e11b8d455a1a8ba8d1aac3371821 Author: Bjorn Helgaas Date: Thu Oct 25 18:34:42 2012 -0600 Revert "PCI: check saved state before restore" This reverts commit c82f63e411f1b58427c103bd95af2863b1c96dd1. Eduardo found that on his Toshiba M40-285 laptop, c82f63e411 causes a sky2 network driver error after suspend-to-RAM. c82f63e411 added a "dev->state_saved" test in pci_restore_state() and removed it from pci_restore_standard_config(). That made no difference in this path: pci_restore_standard_config pci_restore_state But there are many other callers of pci_restore_state(), and apparently the new "dev->state_saved" check added there makes a difference to one of them. The revert is not completely trivial because 1d3c16a818 made pci_restore_state() a void function in the interim. Reference: https://bugzilla.kernel.org/show_bug.cgi?id=15388 Reported-and-Tested-by: Eduardo Signed-off-by: Bjorn Helgaas diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 94c6e2a..0bdced9 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -438,7 +438,9 @@ static int pci_restore_standard_config(struct pci_dev *pci_dev) return error; } - pci_restore_state(pci_dev); + if (pci_dev->state_saved) + pci_restore_state(pci_dev); + return 0; } diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 5485883..b1ddaa5 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1013,9 +1013,6 @@ static void pci_restore_config_space(struct pci_dev *pdev) */ void pci_restore_state(struct pci_dev *dev) { - if (!dev->state_saved) - return; - /* PCI Express register must be restored first */ pci_restore_pcie_state(dev); pci_restore_ats_state(dev);