Keep insane devices disabled
cover Keep insane devices disabled
The patches fix issues that allow enabling both CLKPM and ASPM on devices that failed pcie_aspm_sanity_check().
MERGE NOTICE:
These series are based on
» 'commit e4e737bb5c17 ("Linux 5.15-rc2")'
Saheed O. Bolarinwa (2):
PCI/ASPM: Never enable ASPM for insane devices
PCI/ASPM: Never enable CLKPM for insane devices
drivers/pci/pcie/aspm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.20.1
RFC PATCH 1/2 PCI/ASPM: Never enable ASPM for insane devices
aspm_attr_store_common() makes it possible to clear the disable bits even for devices that fails pcie_aspm_sanity_check().
- Extend the if condition in aspm_attr_store_common() to screen out insane devices.
--- drivers/pci/pcie/aspm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pcie/aspm.c +1 -1
@@ -1225,7 +1225,7 @@ static ssize_t aspm_attr_store_common(struct device *dev,down_read (&pci_bus_sem);mutex_lock (&aspm_lock); -if (state_enable) { +if (state_enable && !pcie_aspm_sanity_check (pdev)) { link->aspm_disable &= ~state;/* need to enable L1 for substates */ if (state &ASPM_STATE_L1SS )
Signature · 1 line
2.20.1
RFC PATCH 2/2 PCI/ASPM: Never enable CLKPM for insane devices
In reply to Saheed O. Bolarinwaclkpm_store() makes it possible to turn off link->clkpm_disable for devices that fails pcie_aspm_sanity_check().
- Ceck the result of pcie_aspm_sanity_check() when setting link->clpm_disable within clkpm_store().
--- drivers/pci/pcie/aspm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pcie/aspm.c +1 -1
@@ -1282,7 +1282,7 @@ static ssize_t clkpm_store(struct device *dev,down_read (&pci_bus_sem);mutex_lock (&aspm_lock); - link->clkpm_disable = !state_enable; + link->clkpm_disable = !(state_enable && !pcie_aspm_sanity_check (pdev));pcie_set_clkpm (link,policy_to_clkpm_state (link));mutex_unlock (&aspm_lock);
Signature · 1 line
2.20.1