linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v1 0/2] Keep insane devices disabled
@ 2021-11-06 17:56 Saheed O. Bolarinwa
  2021-11-06 17:56 ` [RFC PATCH v1 1/2] PCI/ASPM: Never enable ASPM for insane devices Saheed O. Bolarinwa
  2021-11-06 17:56 ` [RFC PATCH v1 2/2] PCI/ASPM: Never enable CLKPM " Saheed O. Bolarinwa
  0 siblings, 2 replies; 3+ messages in thread
From: Saheed O. Bolarinwa @ 2021-11-06 17:56 UTC (permalink / raw)
  To: helgaas; +Cc: Saheed O. Bolarinwa, linux-pci, linux-kernel

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(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [RFC PATCH v1 1/2] PCI/ASPM: Never enable ASPM for insane devices
  2021-11-06 17:56 [RFC PATCH v1 0/2] Keep insane devices disabled Saheed O. Bolarinwa
@ 2021-11-06 17:56 ` Saheed O. Bolarinwa
  2021-11-06 17:56 ` [RFC PATCH v1 2/2] PCI/ASPM: Never enable CLKPM " Saheed O. Bolarinwa
  1 sibling, 0 replies; 3+ messages in thread
From: Saheed O. Bolarinwa @ 2021-11-06 17:56 UTC (permalink / raw)
  To: helgaas; +Cc: Saheed O. Bolarinwa, linux-pci, linux-kernel

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.

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 013a47f587ce..72cb17489e88 100644
--- a/drivers/pci/pcie/aspm.c
+++ b/drivers/pci/pcie/aspm.c
@@ -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)
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [RFC PATCH v1 2/2] PCI/ASPM: Never enable CLKPM for insane devices
  2021-11-06 17:56 [RFC PATCH v1 0/2] Keep insane devices disabled Saheed O. Bolarinwa
  2021-11-06 17:56 ` [RFC PATCH v1 1/2] PCI/ASPM: Never enable ASPM for insane devices Saheed O. Bolarinwa
@ 2021-11-06 17:56 ` Saheed O. Bolarinwa
  1 sibling, 0 replies; 3+ messages in thread
From: Saheed O. Bolarinwa @ 2021-11-06 17:56 UTC (permalink / raw)
  To: helgaas; +Cc: Saheed O. Bolarinwa, linux-pci, linux-kernel

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-06 17:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-06 17:56 [RFC PATCH v1 0/2] Keep insane devices disabled Saheed O. Bolarinwa
2021-11-06 17:56 ` [RFC PATCH v1 1/2] PCI/ASPM: Never enable ASPM for insane devices Saheed O. Bolarinwa
2021-11-06 17:56 ` [RFC PATCH v1 2/2] PCI/ASPM: Never enable CLKPM " Saheed O. Bolarinwa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).