All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Buesch <mb@bu3sch.de>
To: Tony Lindgren <tony@atomide.com>
Cc: Felipe Balbi <balbi@ti.com>, linux-omap <linux-omap@vger.kernel.org>
Subject: [PATCH] cbus-retu: Add locking around register access in irq handler
Date: Mon, 28 Feb 2011 17:06:08 +0100	[thread overview]
Message-ID: <1298909168.16391.6.camel@marge> (raw)

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

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Reported-by: Felipe Balbi <balbi@ti.com>

---

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;



             reply	other threads:[~2011-02-28 16:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-28 16:06 Michael Buesch [this message]
2011-02-28 19:09 ` [PATCH] cbus-retu: Add locking around register access in irq handler Felipe Balbi
2011-03-01 23:11   ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1298909168.16391.6.camel@marge \
    --to=mb@bu3sch.de \
    --cc=balbi@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.