summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Yu <yu.c.chen@intel.com>2020-01-13 07:07:24 +0100
committerBjorn Helgaas <bhelgaas@google.com>2020-01-13 22:43:38 +0100
commit47b802d5d80c2fef3ccd9772d518bd602c83cea1 (patch)
tree6128cfbd479a7b45a807f304a6f36c6854411668
parentLinux 5.5-rc1 (diff)
downloadlinux-47b802d5d80c2fef3ccd9772d518bd602c83cea1.tar.xz
linux-47b802d5d80c2fef3ccd9772d518bd602c83cea1.zip
PCI/PM: Print config space of devices before suspend
When resuming from hibernation (S4, also known as "suspend to disk") on a VM, we have seen invalid config space, e.g., serial 0000:00:16.3: restoring config space at offset 0x14 (was 0x9104e000, writing 0xffffffff) To help debug problems like this, log the config space being saved before suspend, similar to the log in pci_restore_config_dword() when resuming. Link: https://lore.kernel.org/r/20200113060724.19571-1-yu.c.chen@intel.com [bhelgaas: commit log] Signed-off-by: Chen Yu <yu.c.chen@intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Cc: Len Brown <lenb@kernel.org>
-rw-r--r--drivers/pci/pci.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index e87196cc1a7f..34cde70440c3 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1372,8 +1372,11 @@ int pci_save_state(struct pci_dev *dev)
{
int i;
/* XXX: 100% dword access ok here? */
- for (i = 0; i < 16; i++)
+ for (i = 0; i < 16; i++) {
pci_read_config_dword(dev, i * 4, &dev->saved_config_space[i]);
+ pci_dbg(dev, "saving config space at offset %#x (reading %#x)\n",
+ i * 4, dev->saved_config_space[i]);
+ }
dev->state_saved = true;
i = pci_save_pcie_state(dev);