lkml.org 
[lkml]   [2021]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH v1 2/2] PCI/ASPM: Never enable CLKPM for insane devices
Date
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 --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);
--
2.20.1
\
 
 \ /
  Last update: 2021-11-06 18:57    [W:0.381 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site