[PATCH] cbus-retu: Add locking around register access in irq handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This adds locking around the register access in the
interrupt service routine.

Signed-off-by: Michael Buesch <mb@xxxxxxxxx>
Reported-by: Felipe Balbi <balbi@xxxxxx>

---

Index: linux-omap-2.6/drivers/cbus/retu.c
===================================================================
--- linux-omap-2.6.orig/drivers/cbus/retu.c	2011-02-28 16:59:10.767302605 +0100
+++ linux-omap-2.6/drivers/cbus/retu.c	2011-02-28 16:59:58.629389762 +0100
@@ -198,10 +198,12 @@ static irqreturn_t retu_irq_handler(int
 	u16			idr;
 	u16			imr;
 
+	mutex_lock(&retu->mutex);
 	idr = __retu_read_reg(retu, RETU_REG_IDR);
 	imr = __retu_read_reg(retu, RETU_REG_IMR);
-	idr &= ~imr;
+	mutex_unlock(&retu->mutex);
 
+	idr &= ~imr;
 	if (!idr) {
 		dev_vdbg(retu->dev, "No IRQ, spurious?\n");
 		return IRQ_NONE;


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux