diff mbox

ASoC: rsnd: call rsnd_dai_pointer_update() from outside of lock

Message ID 871twoio27.wl%kuninori.morimoto.gx@renesas.com (mailing list archive)
State Accepted
Commit 836b31fe1a9791d84ed95783ed42ebd5719f7918
Headers show

Commit Message

Kuninori Morimoto April 23, 2014, 5:59 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

rsnd_soc_dai_trigger() will be called
after rsnd_dai_pointer_update() function
which is using rsnd_lock().
Thus, it should be called from outside of rsnd_lock().
Kernel will be hangup without this patch.
Special thanks to Kataoka-san

Reported-by: Ryo Kataoka <ryo.kataoka.wt@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/sh/rcar/core.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Mark Brown April 23, 2014, 11:17 a.m. UTC | #1
On Wed, Apr 23, 2014 at 02:59:12PM +0900, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> rsnd_soc_dai_trigger() will be called
> after rsnd_dai_pointer_update() function
> which is using rsnd_lock().
> Thus, it should be called from outside of rsnd_lock().
> Kernel will be hangup without this patch.
> Special thanks to Kataoka-san

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 1f6981a..964463d 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -197,13 +197,12 @@  static void rsnd_dma_complete(void *data)
 	 * rsnd_dai_pointer_update() will be called twice,
 	 * ant it will breaks io->byte_pos
 	 */
-
-	rsnd_dai_pointer_update(io, io->byte_per_period);
-
 	if (dma->submit_loop)
 		rsnd_dma_continue(dma);
 
 	rsnd_unlock(priv, flags);
+
+	rsnd_dai_pointer_update(io, io->byte_per_period);
 }
 
 static void __rsnd_dma_start(struct rsnd_dma *dma)