diff mbox

[05/10,v3] ASoC: rsnd: no more SRC restart when unusual situation

Message ID 87fv91eia6.wl%kuninori.morimoto.gx@renesas.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kuninori Morimoto March 19, 2015, 4:14 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

It will be SRC interrupt endless loop f unusual situation happen.
This patch adds restart limit for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - no change

 sound/soc/sh/rcar/src.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Mark Brown March 22, 2015, 6:12 p.m. UTC | #1
On Thu, Mar 19, 2015 at 04:14:04AM +0000, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> It will be SRC interrupt endless loop f unusual situation happen.
> This patch adds restart limit for it.

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c
index 6ce8985..cc93f32 100644
--- a/sound/soc/sh/rcar/src.c
+++ b/sound/soc/sh/rcar/src.c
@@ -620,13 +620,17 @@  static irqreturn_t rsnd_src_interrupt_gen2(int irq, void *data)
 
 	if (rsnd_src_error_record_gen2(mod)) {
 		struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+		struct rsnd_src *src = rsnd_mod_to_src(mod);
 		struct device *dev = rsnd_priv_to_dev(priv);
 
-		_rsnd_src_stop_gen2(mod);
-		_rsnd_src_start_gen2(mod);
-
 		dev_dbg(dev, "%s[%d] restart\n",
 			rsnd_mod_name(mod), rsnd_mod_id(mod));
+
+		_rsnd_src_stop_gen2(mod);
+		if (src->err < 1024)
+			_rsnd_src_start_gen2(mod);
+		else
+			dev_warn(dev, "no more SRC restart\n");
 	}
 
 	return IRQ_HANDLED;