Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d51af7b authored by Mark Lord's avatar Mark Lord Committed by Jeff Garzik
Browse files

sata_mv: fix MSI irq race condition



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: default avatarMark Lord <mlord@pobox.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 041b6237
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -2218,12 +2218,13 @@ static irqreturn_t mv_interrupt(int irq, void *dev_instance)
		else
		else
			handled = mv_host_intr(host, pending_irqs);
			handled = mv_host_intr(host, pending_irqs);
	}
	}
	spin_unlock(&host->lock);


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


	spin_unlock(&host->lock);

	return IRQ_RETVAL(handled);
	return IRQ_RETVAL(handled);
}
}