diff options
-rw-r--r-- | drivers/ata/sata_mv.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 47dae7a2fbf4..eb7f3dafb502 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -2200,20 +2200,21 @@ static irqreturn_t mv_interrupt(int irq, void *dev_instance) | |||
2200 | struct ata_host *host = dev_instance; | 2200 | struct ata_host *host = dev_instance; |
2201 | struct mv_host_priv *hpriv = host->private_data; | 2201 | struct mv_host_priv *hpriv = host->private_data; |
2202 | unsigned int handled = 0; | 2202 | unsigned int handled = 0; |
2203 | u32 main_irq_cause, main_irq_mask; | 2203 | u32 main_irq_cause, main_irq_mask, pending_irqs; |
2204 | 2204 | ||
2205 | spin_lock(&host->lock); | 2205 | spin_lock(&host->lock); |
2206 | main_irq_cause = readl(hpriv->main_irq_cause_addr); | 2206 | main_irq_cause = readl(hpriv->main_irq_cause_addr); |
2207 | main_irq_mask = readl(hpriv->main_irq_mask_addr); | 2207 | main_irq_mask = readl(hpriv->main_irq_mask_addr); |
2208 | pending_irqs = main_irq_cause & main_irq_mask; | ||
2208 | /* | 2209 | /* |
2209 | * Deal with cases where we either have nothing pending, or have read | 2210 | * Deal with cases where we either have nothing pending, or have read |
2210 | * a bogus register value which can indicate HW removal or PCI fault. | 2211 | * a bogus register value which can indicate HW removal or PCI fault. |
2211 | */ | 2212 | */ |
2212 | if ((main_irq_cause & main_irq_mask) && (main_irq_cause != 0xffffffffU)) { | 2213 | if (pending_irqs && main_irq_cause != 0xffffffffU) { |
2213 | if (unlikely((main_irq_cause & PCI_ERR) && HAS_PCI(host))) | 2214 | if (unlikely((pending_irqs & PCI_ERR) && HAS_PCI(host))) |
2214 | handled = mv_pci_error(host, hpriv->base); | 2215 | handled = mv_pci_error(host, hpriv->base); |
2215 | else | 2216 | else |
2216 | handled = mv_host_intr(host, main_irq_cause); | 2217 | handled = mv_host_intr(host, pending_irqs); |
2217 | } | 2218 | } |
2218 | spin_unlock(&host->lock); | 2219 | spin_unlock(&host->lock); |
2219 | return IRQ_RETVAL(handled); | 2220 | return IRQ_RETVAL(handled); |