PCI/DPC: Skip DPC event if device is not present
authorKeith Busch <keith.busch@intel.com>
Fri, 28 Apr 2017 16:02:48 +0000 (12:02 -0400)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 22 May 2017 23:42:02 +0000 (18:42 -0500)
The DPC interupt may be executed on a device that is being removed.  Skip
queuing event handling if the status is all 1's, which should be seen only
if the device is not present.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pcie/pcie-dpc.c

index 77d2ca99d2ec20bb0cf2b6b07d9add8cca845e1f..0bf08435723757289abbb26ff61130c0de888b03 100644 (file)
@@ -92,7 +92,7 @@ static irqreturn_t dpc_irq(int irq, void *context)
        pci_read_config_word(pdev, dpc->cap_pos + PCI_EXP_DPC_STATUS, &status);
        pci_read_config_word(pdev, dpc->cap_pos + PCI_EXP_DPC_SOURCE_ID,
                             &source);
-       if (!status)
+       if (!status || status == (u16)(~0))
                return IRQ_NONE;
 
        dev_info(&dpc->dev->device, "DPC containment event, status:%#06x source:%#06x\n",