linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI/AER: Prevent runtime power management during recovery
@ 2018-06-11 22:29 Keith Busch
  2018-06-12  4:40 ` Sinan Kaya
  2018-06-30 19:58 ` Bjorn Helgaas
  0 siblings, 2 replies; 7+ messages in thread
From: Keith Busch @ 2018-06-11 22:29 UTC (permalink / raw)
  To: Linux PCI, Bjorn Helgaas; +Cc: Keith Busch, Oza Pawandeep

A bridge that supports D3 but not hotplug will be subject to runtime
power management placing it in a non-operation power state if it doesn't
have any devices attached. This patch will prevent this power management
during error recovery so that the rescan at the end may be successful.

Cc: Oza Pawandeep <poza@codeaurora.org>
Signed-off-by: Keith Busch <keith.busch@intel.com>
---
 drivers/pci/pcie/err.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c
index f7ce0cb0b0b7..247b6ce14f0d 100644
--- a/drivers/pci/pcie/err.c
+++ b/drivers/pci/pcie/err.c
@@ -16,6 +16,7 @@
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/aer.h>
+#include <linux/pm_runtime.h>
 #include "portdrv.h"
 #include "../pci.h"
 
@@ -294,6 +295,7 @@ void pcie_do_fatal_recovery(struct pci_dev *dev, u32 service)
 		udev = dev->bus->self;
 
 	parent = udev->subordinate;
+	pm_runtime_forbid(&udev->dev);
 	pci_lock_rescan_remove();
 	list_for_each_entry_safe_reverse(pdev, temp, &parent->devices,
 					 bus_list) {
@@ -329,6 +331,7 @@ void pcie_do_fatal_recovery(struct pci_dev *dev, u32 service)
 	}
 
 	pci_unlock_rescan_remove();
+	pm_runtime_allow(&udev->dev);
 }
 
 /**
-- 
2.14.3

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

end of thread, other threads:[~2018-07-01 11:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-11 22:29 [PATCH] PCI/AER: Prevent runtime power management during recovery Keith Busch
2018-06-12  4:40 ` Sinan Kaya
2018-06-12  7:51   ` poza
2018-06-12 14:44     ` Keith Busch
2018-06-12 15:16       ` poza
2018-06-30 19:58 ` Bjorn Helgaas
2018-07-01 11:51   ` Lukas Wunner

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