Skip to content

Commit

Permalink
PCI/PM: Print config space of devices before suspend
Browse files Browse the repository at this point in the history
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/[email protected]
[bhelgaas: commit log]
Signed-off-by: Chen Yu <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
Cc: Len Brown <[email protected]>
  • Loading branch information
yu-chen-surf authored and bjorn-helgaas committed Jan 13, 2020
1 parent e42617b commit 47b802d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 47b802d

Please sign in to comment.