diff mbox series

[RFC,v1,2/2] PCI/ASPM: Never enable CLKPM for insane devices

Message ID 20211106175621.28250-3-refactormyself@gmail.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show
Series Keep insane devices disabled | expand

Commit Message

Saheed O. Bolarinwa Nov. 6, 2021, 5:56 p.m. UTC
clkpm_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().

Signed-off-by: Saheed O. Bolarinwa <refactormyself@gmail.com>
---
 drivers/pci/pcie/aspm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
index 72cb17489e88..c81b0ef32229 100644
--- a/drivers/pci/pcie/aspm.c
+++ b/drivers/pci/pcie/aspm.c
@@ -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);