From: Keith Busch <keith.busch@intel.com>
To: linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>
Cc: Jon Derrick <jonathan.derrick@intel.com>,
Keith Busch <keith.busch@intel.com>
Subject: [PATCH] pci: Don't set power fault if controller not present
Date: Tue, 11 Oct 2016 15:39:07 -0400 [thread overview]
Message-ID: <1476214747-10428-1-git-send-email-keith.busch@intel.com> (raw)
The pciehp control only clears the saved power fault detected if power
controller control is present, but there is no requirement that the
capability exist in order to observe power faults. This means a hot-added
device in a slot that had experienced a power fault at some point would
never be able to add a new device since the power fault detected would
be on permanently.
This patch sets the sticky field only if there is a chance it can
be cleared later.
Signed-off-by: Keith Busch <keith.busch@intel.com>
---
drivers/pci/hotplug/pciehp_hpc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index b57fc6d..b083e1c 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -631,7 +631,8 @@ static irqreturn_t pciehp_isr(int irq, void *dev_id)
/* Check Power Fault Detected */
if ((events & PCI_EXP_SLTSTA_PFD) && !ctrl->power_fault_detected) {
- ctrl->power_fault_detected = 1;
+ if (POWER_CTRL(ctrl))
+ ctrl->power_fault_detected = 1;
ctrl_err(ctrl, "Slot(%s): Power fault\n", slot_name(slot));
pciehp_queue_interrupt_event(slot, INT_POWER_FAULT);
}
--
2.7.2
next reply other threads:[~2016-10-11 19:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-11 19:39 Keith Busch [this message]
2016-10-22 14:44 ` [PATCH] pci: Don't set power fault if controller not present Bjorn Helgaas
2016-10-28 18:33 ` Keith Busch
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=1476214747-10428-1-git-send-email-keith.busch@intel.com \
--to=keith.busch@intel.com \
--cc=bhelgaas@google.com \
--cc=jonathan.derrick@intel.com \
--cc=linux-pci@vger.kernel.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).