Skip to content

Commit

Permalink
sata_mv: fix MSI irq race condition
Browse files Browse the repository at this point in the history
Fix a (rare) race condition in mv_interrupt() when using MSI.

The value of hpriv->main_irq_mask_addr can change on on the fly,
and without this patch we could end up writing back a stale copy
to the hardware.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Mark Lord authored and Jeff Garzik committed Mar 13, 2009
1 parent 041b623 commit 9d51af7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/ata/sata_mv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2218,12 +2218,13 @@ static irqreturn_t mv_interrupt(int irq, void *dev_instance)
else
handled = mv_host_intr(host, pending_irqs);
}
spin_unlock(&host->lock);

/* for MSI: unmask; interrupt cause bits will retrigger now */
if (using_msi)
writel(hpriv->main_irq_mask, hpriv->main_irq_mask_addr);

spin_unlock(&host->lock);

return IRQ_RETVAL(handled);
}

Expand Down

0 comments on commit 9d51af7

Please sign in to comment.