diff mbox

ASoC: rsnd: need to call nolock_stop if nolock_start was failed

Message ID 878tlv535x.wl%kuninori.morimoto.gx@renesas.com (mailing list archive)
State Accepted
Delegated to: Geert Uytterhoeven
Headers show

Commit Message

Kuninori Morimoto May 17, 2017, 7:59 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

rsnd_dai_call() is counting the called number of start/stop functions.
nolock_stop should be called if nolock_start was failed.
Otherwise, nolock_start doesn't called in 2nd play.
This patch solved this issue.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
---
 sound/soc/sh/rcar/core.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Kuninori Morimoto May 17, 2017, 8:10 a.m. UTC | #1
Hi

> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> rsnd_dai_call() is counting the called number of start/stop functions.
> nolock_stop should be called if nolock_start was failed.
> Otherwise, nolock_start doesn't called in 2nd play.
> This patch solved this issue.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>

This was

Reported-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>

Mark, please let me know if v2 was required

> ---
>  sound/soc/sh/rcar/core.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
> index 8c1f4e2..e16f723 100644
> --- a/sound/soc/sh/rcar/core.c
> +++ b/sound/soc/sh/rcar/core.c
> @@ -766,11 +766,16 @@ static int rsnd_soc_dai_startup(struct snd_pcm_substream *substream,
>  {
>  	struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
>  	struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream);
> +	int ret;
>  
>  	/*
>  	 * call rsnd_dai_call without spinlock
>  	 */
> -	return rsnd_dai_call(nolock_start, io, priv);
> +	ret = rsnd_dai_call(nolock_start, io, priv);
> +	if (ret < 0)
> +		rsnd_dai_call(nolock_stop, io, priv);
> +
> +	return ret;
>  }
>  
>  static void rsnd_soc_dai_shutdown(struct snd_pcm_substream *substream,
> -- 
> 1.9.1
>
diff mbox

Patch

diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 8c1f4e2..e16f723 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -766,11 +766,16 @@  static int rsnd_soc_dai_startup(struct snd_pcm_substream *substream,
 {
 	struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
 	struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream);
+	int ret;
 
 	/*
 	 * call rsnd_dai_call without spinlock
 	 */
-	return rsnd_dai_call(nolock_start, io, priv);
+	ret = rsnd_dai_call(nolock_start, io, priv);
+	if (ret < 0)
+		rsnd_dai_call(nolock_stop, io, priv);
+
+	return ret;
 }
 
 static void rsnd_soc_dai_shutdown(struct snd_pcm_substream *substream,