public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cbus-retu: Add locking around register access in irq handler
@ 2011-02-28 16:06 Michael Buesch
  2011-02-28 19:09 ` Felipe Balbi
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Buesch @ 2011-02-28 16:06 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Felipe Balbi, linux-omap

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;



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cbus-retu: Add locking around register access in irq handler
  2011-02-28 16:06 [PATCH] cbus-retu: Add locking around register access in irq handler Michael Buesch
@ 2011-02-28 19:09 ` Felipe Balbi
  2011-03-01 23:11   ` Tony Lindgren
  0 siblings, 1 reply; 3+ messages in thread
From: Felipe Balbi @ 2011-02-28 19:09 UTC (permalink / raw)
  To: Michael Buesch; +Cc: Tony Lindgren, Felipe Balbi, linux-omap

On Mon, Feb 28, 2011 at 05:06:08PM +0100, Michael Buesch wrote:
> 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>

Fine by me. Tony, you can apply.

-- 
balbi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cbus-retu: Add locking around register access in irq handler
  2011-02-28 19:09 ` Felipe Balbi
@ 2011-03-01 23:11   ` Tony Lindgren
  0 siblings, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2011-03-01 23:11 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: Michael Buesch, linux-omap

* Felipe Balbi <balbi@ti.com> [110228 11:07]:
> On Mon, Feb 28, 2011 at 05:06:08PM +0100, Michael Buesch wrote:
> > 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>
> 
> Fine by me. Tony, you can apply.

Only applied the first two to add the register defines because of:

BUG: sleeping function called from invalid context at kernel/mutex.c:278
in_atomic(): 1, irqs_disabled(): 0, pid: 0, name: swapper
INFO: lockdep is turned off.
[<c0063c24>] (unwind_backtrace+0x0/0xec) from [<c0402f98>] (mutex_lock_nested+0x24/0x340)
[<c0402f98>] (mutex_lock_nested+0x24/0x340) from [<c032b4e4>] (retu_write_reg+0x20/0x3c)
[<c032b4e4>] (retu_write_reg+0x20/0x3c) from [<c032bc4c>] (_retu_modify_counter+0x28/0x34)
[<c032bc4c>] (_retu_modify_counter+0x28/0x34) from [<c032be48>] (retu_wdt_set_ping_timer+0x10/0x50)
[<c032be48>] (retu_wdt_set_ping_timer+0x10/0x50) from [<c00a2000>] (run_timer_softirq+0x260/0x368)
[<c00a2000>] (run_timer_softirq+0x260/0x368) from [<c009bdb8>] (__do_softirq+0xe8/0x1e0)
[<c009bdb8>] (__do_softirq+0xe8/0x1e0) from [<c009bf04>] (irq_exit+0x54/0xa0)
[<c009bf04>] (irq_exit+0x54/0xa0) from [<c0052090>] (asm_do_IRQ+0x90/0xcc)
[<c0052090>] (asm_do_IRQ+0x90/0xcc) from [<c0404adc>] (__irq_svc+0x3c/0x100)

Tony

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-01 23:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-28 16:06 [PATCH] cbus-retu: Add locking around register access in irq handler Michael Buesch
2011-02-28 19:09 ` Felipe Balbi
2011-03-01 23:11   ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox