linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pci: Don't set power fault if controller not present
@ 2016-10-11 19:39 Keith Busch
  2016-10-22 14:44 ` Bjorn Helgaas
  0 siblings, 1 reply; 3+ messages in thread
From: Keith Busch @ 2016-10-11 19:39 UTC (permalink / raw)
  To: linux-pci, Bjorn Helgaas; +Cc: Jon Derrick, Keith Busch

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


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

end of thread, other threads:[~2016-10-28 18:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-11 19:39 [PATCH] pci: Don't set power fault if controller not present Keith Busch
2016-10-22 14:44 ` Bjorn Helgaas
2016-10-28 18:33   ` Keith Busch

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