Commit a44253d2 authored by Mark Lord's avatar Mark Lord Committed by Jeff Garzik

sata_mv: disregard masked irqs

Part four of simplifying/fixing handling of the main_irq_mask register
to resolve unexpected interrupt issues observed in 2.6.26-rc*.

Ignore masked IRQs in mv_interrupt().
This prevents "unexpected device interrupt while idle" messages.
Signed-off-by: default avatarMark Lord <mlord@pobox.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 88e675e1
...@@ -2200,20 +2200,21 @@ static irqreturn_t mv_interrupt(int irq, void *dev_instance) ...@@ -2200,20 +2200,21 @@ static irqreturn_t mv_interrupt(int irq, void *dev_instance)
struct ata_host *host = dev_instance; struct ata_host *host = dev_instance;
struct mv_host_priv *hpriv = host->private_data; struct mv_host_priv *hpriv = host->private_data;
unsigned int handled = 0; unsigned int handled = 0;
u32 main_irq_cause, main_irq_mask; u32 main_irq_cause, main_irq_mask, pending_irqs;
spin_lock(&host->lock); spin_lock(&host->lock);
main_irq_cause = readl(hpriv->main_irq_cause_addr); main_irq_cause = readl(hpriv->main_irq_cause_addr);
main_irq_mask = readl(hpriv->main_irq_mask_addr); main_irq_mask = readl(hpriv->main_irq_mask_addr);
pending_irqs = main_irq_cause & main_irq_mask;
/* /*
* Deal with cases where we either have nothing pending, or have read * Deal with cases where we either have nothing pending, or have read
* a bogus register value which can indicate HW removal or PCI fault. * a bogus register value which can indicate HW removal or PCI fault.
*/ */
if ((main_irq_cause & main_irq_mask) && (main_irq_cause != 0xffffffffU)) { if (pending_irqs && main_irq_cause != 0xffffffffU) {
if (unlikely((main_irq_cause & PCI_ERR) && HAS_PCI(host))) if (unlikely((pending_irqs & PCI_ERR) && HAS_PCI(host)))
handled = mv_pci_error(host, hpriv->base); handled = mv_pci_error(host, hpriv->base);
else else
handled = mv_host_intr(host, main_irq_cause); handled = mv_host_intr(host, pending_irqs);
} }
spin_unlock(&host->lock); spin_unlock(&host->lock);
return IRQ_RETVAL(handled); return IRQ_RETVAL(handled);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment