[PATCH 1/3] pciehp: fix possible endless loop in pcie_isr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix possible endless loop in pcie_isr.

Current pcie_isr function (interrupt service routine of pciehp) has a
possibility to get into endless loop in the case that bits in Slot
Status register is set again immediately after cleared. According to
the past discussion (see below URL) in the following pcihpd-discuss
ML, this case can happen power fault detected bit.

http://sourceforge.net/mailarchive/message.php?msg_id=20051130135409.A14918%40unix-os.sc.intel.com

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@xxxxxxxxxxxxxx>

---
 drivers/pci/hotplug/pciehp_hpc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: 20090130/drivers/pci/hotplug/pciehp_hpc.c
===================================================================
--- 20090130.orig/drivers/pci/hotplug/pciehp_hpc.c
+++ 20090130/drivers/pci/hotplug/pciehp_hpc.c
@@ -672,10 +672,11 @@ static irqreturn_t pcie_isr(int irq, voi
 		detected &= (PCI_EXP_SLTSTA_ABP | PCI_EXP_SLTSTA_PFD |
 			     PCI_EXP_SLTSTA_MRLSC | PCI_EXP_SLTSTA_PDC |
 			     PCI_EXP_SLTSTA_CC);
+		detected &= ~intr_loc;
 		intr_loc |= detected;
 		if (!intr_loc)
 			return IRQ_NONE;
-		if (detected && pciehp_writew(ctrl, PCI_EXP_SLTSTA, detected)) {
+		if (detected && pciehp_writew(ctrl, PCI_EXP_SLTSTA, intr_loc)) {
 			ctrl_err(ctrl, "%s: Cannot write to SLOTSTATUS\n",
 				 __func__);
 			return IRQ_NONE;

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux