[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20211106175621.28250-3-refactormyself@gmail.com>
Date: Sat, 6 Nov 2021 18:56:21 +0100
From: "Saheed O. Bolarinwa" <refactormyself@...il.com>
To: helgaas@...nel.org
Cc: "Saheed O. Bolarinwa" <refactormyself@...il.com>,
linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [RFC PATCH v1 2/2] PCI/ASPM: Never enable CLKPM for insane devices
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@...il.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
Powered by blists - more mailing lists