Skip to content

Commit 8e37372

Browse files
hkallweitbjorn-helgaas
authored andcommitted
PCI/ASPM: Fix L1 substate handling in aspm_attr_store_common()
aspm_attr_store_common(), which handles sysfs control of ASPM, has the same problem as fb097dc ("PCI/ASPM: Disable only ASPM_STATE_L1 when driver disables L1"): disabling L1 adds only ASPM_L1 (but not any of the L1.x substates) to the "aspm_disable" mask. Enabling one substate, e.g., L1.1, via sysfs removes ASPM_L1 from the disable mask. Since disabling L1 via sysfs doesn't add any of the substates to the disable mask, enabling L1.1 actually enables *all* the substates. In this scenario: - Write 0 to "l1_aspm" to disable L1 - Write 1 to "l1_1_aspm" to enable L1.1 the intention is to disable L1 and all L1.x substates, then enable just L1.1, but in fact, *all* L1.x substates are enabled. Fix this by explicitly disabling all the L1.x substates when disabling L1. Fixes: 72ea91a ("PCI/ASPM: Add sysfs attributes for controlling ASPM link states") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Heiner Kallweit <[email protected]> [bhelgaas: commit log] Signed-off-by: Bjorn Helgaas <[email protected]> Cc: [email protected]
1 parent 3cb4f53 commit 8e37372

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/pci/pcie/aspm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,6 +1255,8 @@ static ssize_t aspm_attr_store_common(struct device *dev,
12551255
link->aspm_disable &= ~ASPM_STATE_L1;
12561256
} else {
12571257
link->aspm_disable |= state;
1258+
if (state & ASPM_STATE_L1)
1259+
link->aspm_disable |= ASPM_STATE_L1SS;
12581260
}
12591261

12601262
pcie_config_aspm_link(link, policy_to_aspm_state(link));

0 commit comments

Comments
 (0)