All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: rsnd: Protect register accesses with a spinlock instead of a mutex
@ 2014-07-23 21:19 ` Laurent Pinchart
  0 siblings, 0 replies; 16+ messages in thread
From: Laurent Pinchart @ 2014-07-23 21:19 UTC (permalink / raw)
  To: alsa-devel; +Cc: linux-sh, Kuninori Morimoto

The hardware registers are accessed from atomic contexts (the
rsnd_soc_dai_trigger function, for instance, is called with the PCM
substream spinlock held). They thus can't be protected by a mutex.

Protect regmap register accesses with a spinlock instead of a mutex by
setting the fast_io flag.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 sound/soc/sh/rcar/gen.c | 1 +
 1 file changed, 1 insertion(+)

An even better solution might be to use regmap-mmio instead of a custom bus.
Morimoto-san, is there anything that would prevent the driver from switching
to regmap-mmio ?

diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
index 73ce4c9..ec9ac5e 100644
--- a/sound/soc/sh/rcar/gen.c
+++ b/sound/soc/sh/rcar/gen.c
@@ -66,6 +66,7 @@ static int rsnd_regmap_read32(void *context,
 }
 
 static struct regmap_bus rsnd_regmap_bus = {
+	.fast_io			= true,
 	.write				= rsnd_regmap_write32,
 	.read				= rsnd_regmap_read32,
 	.reg_format_endian_default	= REGMAP_ENDIAN_NATIVE,
-- 
Regards,

Laurent Pinchart


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

end of thread, other threads:[~2014-07-28  8:33 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-23 21:19 [PATCH] ASoC: rsnd: Protect register accesses with a spinlock instead of a mutex Laurent Pinchart
2014-07-23 21:19 ` Laurent Pinchart
2014-07-24  0:15 ` [alsa-devel] " Kuninori Morimoto
2014-07-24  0:15   ` Kuninori Morimoto
2014-07-24  2:16   ` Kuninori Morimoto
2014-07-24  2:16     ` Kuninori Morimoto
2014-07-28  5:59     ` Lars-Peter Clausen
2014-07-28  5:59       ` Lars-Peter Clausen
2014-07-28  7:40       ` Kuninori Morimoto
2014-07-28  7:40         ` Kuninori Morimoto
2014-07-28  8:03         ` Lars-Peter Clausen
2014-07-28  8:03           ` Lars-Peter Clausen
2014-07-28  8:33           ` Kuninori Morimoto
2014-07-28  8:33             ` Kuninori Morimoto
2014-07-27 10:36 ` Ben Dooks
2014-07-27 10:36   ` Ben Dooks

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.