Skip to contentSkip to conversation

Revert "PCI/ASPM: Disable only ASPM_STATE_L1 when driver, disables L1"

PATCH Applied Heiner Kallweit 2 participants 2 messages Oct 11, 2023 – Oct 25, 2023 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "PCI/ASPM: Disable only ASPM_STATE_L1 when driver, disables L1"

This reverts commit fb097dcd5a28c0a2325632405c76a66777a6bed9.

After the referenced commit we may see L1 sub-states being active unexpectedly. Following scenario as an example:
r8169 disables L1 because of known hardware issues on a number of systems. Implicitly L1.1 and L1.2 are disabled too.
On my system L1 and L1.1 work fine, but L1.2 causes missed rx packets. Therefore I write 1 to aspm_l1_1.
This removes ASPM_STATE_L1 from the disabled modes and therefore unexpectedly enables also L1.2. So return to the old behavior.

---
Splitted the first version of the patch according to the linked discussion.

---
 drivers/pci/pcie/aspm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pci/pcie/aspm.c +2 -1
index 1bf630059264..530c3bb5708c 100644
@@ -1059,7 +1059,8 @@ static int __pci_disable_link_state(struct pci_dev *pdev, int state, bool sem)
 	if (state & PCIE_LINK_STATE_L0S)
 		link->aspm_disable |= ASPM_STATE_L0S;
 	if (state & PCIE_LINK_STATE_L1)
-		link->aspm_disable |= ASPM_STATE_L1;
+		/* L1 PM substates require L1 */
+		link->aspm_disable |= ASPM_STATE_L1 | ASPM_STATE_L1SS;
 	if (state & PCIE_LINK_STATE_L1_1)
 		link->aspm_disable |= ASPM_STATE_L1_1;
 	if (state & PCIE_LINK_STATE_L1_2)
Signature · 1 line
2.42.0
#1 lore raw
Quoted 11 lines · Heiner Kallweit

This reverts commit fb097dcd5a28c0a2325632405c76a66777a6bed9.

After the referenced commit we may see L1 sub-states being active unexpectedly. Following scenario as an example:
r8169 disables L1 because of known hardware issues on a number of systems. Implicitly L1.1 and L1.2 are disabled too.
On my system L1 and L1.1 work fine, but L1.2 causes missed rx packets. Therefore I write 1 to aspm_l1_1.
This removes ASPM_STATE_L1 from the disabled modes and therefore unexpectedly enables also L1.2. So return to the old behavior.

Quoted 3 lines

Applied to pci/aspm for v6.7, thanks, Heiner!

Quoted 23 lines

---
Splitted the first version of the patch according to the linked discussion.

---
 drivers/pci/pcie/aspm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pci/pcie/aspm.c +2 -1
index 1bf630059264..530c3bb5708c 100644
@@ -1059,7 +1059,8 @@ static int __pci_disable_link_state(struct pci_dev *pdev, int state, bool sem)
 	if (state & PCIE_LINK_STATE_L0S)
 		link->aspm_disable |= ASPM_STATE_L0S;
 	if (state & PCIE_LINK_STATE_L1)
-		link->aspm_disable |= ASPM_STATE_L1;
+		/* L1 PM substates require L1 */
+		link->aspm_disable |= ASPM_STATE_L1 | ASPM_STATE_L1SS;
 	if (state & PCIE_LINK_STATE_L1_1)
 		link->aspm_disable |= ASPM_STATE_L1_1;
 	if (state & PCIE_LINK_STATE_L1_2)
Signature · 1 line
2.42.0