]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: rsnd: no more SRC restart when unusual situation
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 19 Mar 2015 04:14:04 +0000 (04:14 +0000)
committerMark Brown <broonie@kernel.org>
Sun, 22 Mar 2015 18:12:16 +0000 (18:12 +0000)
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>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sh/rcar/src.c

index 6ce8985757c12ba7f5928b74b9acdbe84cc7f1b1..cc93f32b0de02f39bae844e46bbdce064426503e 100644 (file)
@@ -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;