From: Keith Busch <keith.busch@intel.com>
To: Linux PCI <linux-pci@vger.kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>
Cc: Keith Busch <keith.busch@intel.com>, Oza Pawandeep <poza@codeaurora.org>
Subject: [PATCH] PCI/AER: Prevent runtime power management during recovery
Date: Mon, 11 Jun 2018 16:29:18 -0600 [thread overview]
Message-ID: <20180611222918.1708-1-keith.busch@intel.com> (raw)
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
next reply other threads:[~2018-06-11 22:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-11 22:29 Keith Busch [this message]
2018-06-12 4:40 ` [PATCH] PCI/AER: Prevent runtime power management during recovery 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180611222918.1708-1-keith.busch@intel.com \
--to=keith.busch@intel.com \
--cc=bhelgaas@google.com \
--cc=linux-pci@vger.kernel.org \
--cc=poza@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).