diff mbox

pci-express hotplug

Message ID 4AE7E164.80408@jp.fujitsu.com (mailing list archive)
State RFC, archived
Headers show

Commit Message

Kenji Kaneshige Oct. 28, 2009, 6:15 a.m. UTC
None
diff mbox

Patch

Index: 20091026/drivers/pci/hotplug/pciehp_hpc.c
===================================================================
--- 20091026.orig/drivers/pci/hotplug/pciehp_hpc.c
+++ 20091026/drivers/pci/hotplug/pciehp_hpc.c
@@ -612,6 +612,7 @@  static irqreturn_t pcie_isr(int irq, voi
 	struct controller *ctrl = (struct controller *)dev_id;
 	struct slot *slot = ctrl->slot;
 	u16 detected, intr_loc;
+	static int nr_power_faults = 0;
 
 	/*
 	 * In order to guarantee that all interrupt events are
@@ -664,6 +665,13 @@  static irqreturn_t pcie_isr(int irq, voi
 	if (intr_loc & PCI_EXP_SLTSTA_PDC)
 		pciehp_handle_presence_change(slot);
 
+	if ((intr_loc & PCI_EXP_SLTSTA_PFD) && (++nr_power_faults > 100)) {
+		u16 reg16;
+		pciehp_readw(ctrl, PCI_EXP_SLTCTL, &reg16);
+		reg16 &= ~PCI_EXP_SLTCTL_PFDE;
+		pciehp_writew(ctrl, PCI_EXP_SLTCTL, reg16);
+	}
+
 	/* Check Power Fault Detected */
 	if ((intr_loc & PCI_EXP_SLTSTA_PFD) && !ctrl->power_fault_detected) {
 		ctrl->power_fault_detected = 1;