Message ID | 20220902145835.344302-3-helgaas@kernel.org |
---|---|
State | New |
Headers | show |
Series | None | expand |
diff --git a/drivers/pci/pcie/ptm.c b/drivers/pci/pcie/ptm.c index b6a417247ce3..3115601a85ef 100644 --- a/drivers/pci/pcie/ptm.c +++ b/drivers/pci/pcie/ptm.c @@ -82,6 +82,14 @@ void pci_restore_ptm_state(struct pci_dev *dev) return; cap = (u16 *)&save_state->cap.data[0]; + + /* + * The suspend path may disable PTM before saving config state. + * Make sure PCI_PTM_CTRL_ENABLE is set if PTM should be enabled. + */ + if (dev->ptm_enabled) + *cap |= PCI_PTM_CTRL_ENABLE; + pci_write_config_word(dev, ptm + PCI_PTM_CTRL, *cap); }