Skip to contentSkip to conversation

pcie: Restore ACS configuration as part of pci_restore_state

PATCH Applied Alexander Duyck 2 participants 2 messages Jul 7, 2015 – Jul 21, 2015 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pcie: Restore ACS configuration as part of pci_restore_state

This change is meant to address the fact that ACS state was not being restored as a part of the PCI configuration restoration following a PCIe reset. Without this patch it is not possible to reassign interfaces behind ACS enabled switches following a system suspend as all of the ACS functionality is disabled due to the D0->D3->D0 state transition cycle clearing the configuration state and the fact that the ACS logic was only initialized in probe.

Cc Allen Kay <[email protected]>
Cc Chris Wright <[email protected]>
Cc Alex Williamson <[email protected]>
---
 drivers/pci/pci.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/pci/pci.c +3 -0
index 0008c950452c..9bd9526f3388 100644
@@ -1092,6 +1092,9 @@ void pci_restore_state(struct pci_dev *dev)
 
 	pci_restore_pcix_state(dev);
 	pci_restore_msi_state(dev);
+
+	/* Restore ACS and IOV configuration state */
+	pci_enable_acs(dev);
 	pci_restore_iov_state(dev);
 
 	dev->state_saved = false;
maintainer Applied
#1 lore raw
Quoted 8 lines · Alexander Duyck

This change is meant to address the fact that ACS state was not being restored as a part of the PCI configuration restoration following a PCIe reset. Without this patch it is not possible to reassign interfaces behind ACS enabled switches following a system suspend as all of the ACS functionality is disabled due to the D0->D3->D0 state transition cycle clearing the configuration state and the fact that the ACS logic was only initialized in probe.

Quoted 4 lines
Cc Allen Kay <[email protected]>
Cc Chris Wright <[email protected]>
Cc Alex Williamson <[email protected]>

Applied to pci/virtualization for v4.3 with changelog as follows, thanks!

commit ccbc175aad819e1d4b6af6246b12d55b13d97815

Author: Alexander Duyck <[email protected]>
Date:   Tue Jul 7 12:24:35 2015 -0700

PCI: Restore ACS configuration as part of pci_restore_state()

Previously we did not restore ACS state after a PCIe reset. This meant that we could not reassign interfaces after a system suspend because the D0->D3 transition disabled ACS, and we didn't restore it when going back to D0.

Restore ACS configuration in pci_restore_state().

[bhelgaas: changelog]
CC Allen Kay <[email protected]>
CC Chris Wright <[email protected]>
CC Alex Williamson <[email protected]>
drivers/pci/pci.c +3 -0
index 0008c95..9bd9526f 100644
@@ -1092,6 +1092,9 @@ void pci_restore_state(struct pci_dev *dev)
 
 	pci_restore_pcix_state(dev);
 	pci_restore_msi_state(dev);
+
+	/* Restore ACS and IOV configuration state */
+	pci_enable_acs(dev);
 	pci_restore_iov_state(dev);
 
 	dev->state_saved = false;