[PATCH 2/2] PCI/PTM: fix in pci_disable_ptm()

From: Rajvi Jingar
Date: Thu Jul 07 2022 - 13:22:20 EST


Set ptm_enabled from 'struct pci_dev' to 0 in pci_ptm_disable() to
save the disabled PTM state for the device.

Fixes: a697f072f5da ("PCI: Disable PTM during suspend to save power")
Signed-off-by: Rajvi Jingar <rajvi.jingar@xxxxxxxxxxxxxxx>
---
drivers/pci/pcie/ptm.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/pci/pcie/ptm.c b/drivers/pci/pcie/ptm.c
index 368a254e3124..746e29779c27 100644
--- a/drivers/pci/pcie/ptm.c
+++ b/drivers/pci/pcie/ptm.c
@@ -44,6 +44,7 @@ void pci_disable_ptm(struct pci_dev *dev)
pci_read_config_word(dev, ptm + PCI_PTM_CTRL, &ctrl);
ctrl &= ~(PCI_PTM_CTRL_ENABLE | PCI_PTM_CTRL_ROOT);
pci_write_config_word(dev, ptm + PCI_PTM_CTRL, ctrl);
+ dev->ptm_enabled = 0;
}

void pci_save_ptm_state(struct pci_dev *dev)
--
2.25.1