public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cbus-retu: Acquire mutex on write operation
@ 2011-02-26 23:34 Michael Buesch
  2011-02-28  8:33 ` Felipe Balbi
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Buesch @ 2011-02-26 23:34 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap, Felipe Balbi

The mutex has to be acquired on register write to avoid interference
with a simultaneous retu_set_clear_reg_bits operation.

Signed-off-by: Michael Buesch <mb@bu3sch.de>

---

Tested on n810.


Index: linux-omap-2.6/drivers/cbus/retu.c
===================================================================
--- linux-omap-2.6.orig/drivers/cbus/retu.c	2011-02-23 23:32:26.388763324 +0100
+++ linux-omap-2.6/drivers/cbus/retu.c	2011-02-26 23:27:08.772462280 +0100
@@ -120,7 +120,9 @@
 {
 	struct retu		*retu = dev_get_drvdata(child->parent);
 
+	mutex_lock(&retu->mutex);
 	__retu_write_reg(retu, reg, val);
+	mutex_unlock(&retu->mutex);
 }
 EXPORT_SYMBOL_GPL(retu_write_reg);
 





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

end of thread, other threads:[~2011-02-28 14:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-26 23:34 [PATCH] cbus-retu: Acquire mutex on write operation Michael Buesch
2011-02-28  8:33 ` Felipe Balbi
2011-02-28 14:10   ` Michael Büsch

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