diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2009-02-03 01:06:13 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@hobbes.lan> | 2009-03-19 22:29:28 -0400 |
commit | 81b840cd27e3ee9af67b6e05a4847868f74fce69 (patch) | |
tree | 35a88cc6fbf67273c61f053fa5375a0a01f3c181 | |
parent | 0b3e7388e3b438500aaa0630879ce536747a47ca (diff) |
PCI: pciehp: fix possible endless loop in pcie_isr
Fix possible endless loop in pcie_isr.
Currently, pcie_isr() (interrupt service routine of pciehp) can end up in an
endless loop if the Slot Status register is set again immediately after being
cleared. According to the past discussion (see below URL) this case can happen
if the power fault detected bit is set during handling.
http://sourceforge.net/mailarchive/message.php?msg_id=20051130135409.A14918%40unix-os.sc.intel.com
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r-- | drivers/pci/hotplug/pciehp_hpc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 7a16c6897bb9..c1a312f24060 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c | |||
@@ -672,10 +672,11 @@ static irqreturn_t pcie_isr(int irq, void *dev_id) | |||
672 | detected &= (PCI_EXP_SLTSTA_ABP | PCI_EXP_SLTSTA_PFD | | 672 | detected &= (PCI_EXP_SLTSTA_ABP | PCI_EXP_SLTSTA_PFD | |
673 | PCI_EXP_SLTSTA_MRLSC | PCI_EXP_SLTSTA_PDC | | 673 | PCI_EXP_SLTSTA_MRLSC | PCI_EXP_SLTSTA_PDC | |
674 | PCI_EXP_SLTSTA_CC); | 674 | PCI_EXP_SLTSTA_CC); |
675 | detected &= ~intr_loc; | ||
675 | intr_loc |= detected; | 676 | intr_loc |= detected; |
676 | if (!intr_loc) | 677 | if (!intr_loc) |
677 | return IRQ_NONE; | 678 | return IRQ_NONE; |
678 | if (detected && pciehp_writew(ctrl, PCI_EXP_SLTSTA, detected)) { | 679 | if (detected && pciehp_writew(ctrl, PCI_EXP_SLTSTA, intr_loc)) { |
679 | ctrl_err(ctrl, "%s: Cannot write to SLOTSTATUS\n", | 680 | ctrl_err(ctrl, "%s: Cannot write to SLOTSTATUS\n", |
680 | __func__); | 681 | __func__); |
681 | return IRQ_NONE; | 682 | return IRQ_NONE; |