Skip to content

Commit c198faf

Browse files
debox1bjorn-helgaas
authored andcommitted
PCI/ASPM: Call pci_save_ltr_state() from pci_save_pcie_state()
ASPM state is saved and restored from pci_save/restore_pcie_state(). Since the LTR Capability is linked with ASPM, move the LTR save and restore calls there as well. No functional change intended. Suggested-by: Bjorn Helgaas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: David E. Box <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 1742336 commit c198faf

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/pci/pci.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,6 +1624,7 @@ static int pci_save_pcie_state(struct pci_dev *dev)
16241624
pcie_capability_read_word(dev, PCI_EXP_SLTCTL2, &cap[i++]);
16251625

16261626
pci_save_aspm_l1ss_state(dev);
1627+
pci_save_ltr_state(dev);
16271628

16281629
return 0;
16291630
}
@@ -1634,6 +1635,12 @@ static void pci_restore_pcie_state(struct pci_dev *dev)
16341635
struct pci_cap_saved_state *save_state;
16351636
u16 *cap, lnkctl;
16361637

1638+
/*
1639+
* Restore max latencies (in the LTR capability) before enabling
1640+
* LTR itself in PCI_EXP_DEVCTL2.
1641+
*/
1642+
pci_restore_ltr_state(dev);
1643+
16371644
save_state = pci_find_saved_cap(dev, PCI_CAP_ID_EXP);
16381645
if (!save_state)
16391646
return;
@@ -1726,7 +1733,6 @@ int pci_save_state(struct pci_dev *dev)
17261733
if (i != 0)
17271734
return i;
17281735

1729-
pci_save_ltr_state(dev);
17301736
pci_save_dpc_state(dev);
17311737
pci_save_aer_state(dev);
17321738
pci_save_ptm_state(dev);
@@ -1827,12 +1833,6 @@ void pci_restore_state(struct pci_dev *dev)
18271833
if (!dev->state_saved)
18281834
return;
18291835

1830-
/*
1831-
* Restore max latencies (in the LTR capability) before enabling
1832-
* LTR itself (in the PCIe capability).
1833-
*/
1834-
pci_restore_ltr_state(dev);
1835-
18361836
pci_restore_pcie_state(dev);
18371837
pci_restore_pasid_state(dev);
18381838
pci_restore_pri_state(dev);

0 commit comments

Comments
 (0)