PCI/ASPM: Fix L1 sub-state handling in aspm_attr_store_common
PATCH 1/1 PCI/ASPM: Fix L1 sub-state handling in aspm_attr_store_common
So far we may see an unexpected behavior regard L1 sub-states. Following scenario:
Write 0 to "l1_aspm" to disable L1
Write 1 to "l1_1_aspm" to enable L1.1
Intention of step 1 is to implicitly disable also L1.1 and L1.2. However after step 2 L1.2 is unexpectedly enabled.
Fix this by explicitly disabling L1 sub-states when disabling L1.
---
Splitted-out part of original patch according to linked discussion.
--- drivers/pci/pcie/aspm.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/pci/pcie/aspm.c +2 -0
@@ -1248,6 +1248,8 @@ static ssize_t aspm_attr_store_common(struct device *dev, link->aspm_disable &= ~ASPM_STATE_L1 ; }else { link->aspm_disable |= state; +if (state &ASPM_STATE_L1 ) + link->aspm_disable |=ASPM_STATE_L1SS ; }pcie_config_aspm_link (link,policy_to_aspm_state (link));
Signature · 1 line
2.42.0
Bjorn Helgaas
AppliedQuoted 9 lines · Heiner Kallweit
So far we may see an unexpected behavior regard L1 sub-states. Following scenario:
Write 0 to "
l1_aspm" to disable L1
Write 1 to "l1_1_aspm" to enable L1.1Intention of step 1 is to implicitly disable also L1.1 and L1.2. However after step 2 L1.2 is unexpectedly enabled.
Quoted 6 lines
Fix this by explicitly disabling L1 sub-states when disabling L1.
Fixes 72ea91afbfb0 ("PCI/ASPM: Add sysfs attributes for controlling ASPM link states")Signed-off-by Heiner Kallweit <[email protected]>
Applied to pci/aspm for v6.7, thanks again.
Quoted 22 lines
---
Splitted-out part of original patch according to linked discussion.--- drivers/pci/pcie/aspm.c | 2 ++ 1 file changed, 2 insertions(+)drivers/pci/pcie/aspm.c +2
-0@@ -1248,6 +1248,8 @@ static ssize_t aspm_attr_store_common(struct device *dev, link->aspm_disable &= ~ASPM_STATE_L1 ; }else { link->aspm_disable |= state; +if (state &ASPM_STATE_L1 ) + link->aspm_disable |=ASPM_STATE_L1SS ; }pcie_config_aspm_link (link,policy_to_aspm_state (link));Signature · 1 line
2.42.0