]> git.hungrycats.org Git - linux/commitdiff
ASoC: rsnd: don't call free_irq() on Parent SSI
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 16 May 2017 01:48:24 +0000 (01:48 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Feb 2018 19:09:37 +0000 (20:09 +0100)
commit 1f8754d4daea5f257370a52a30fcb22798c54516 upstream.

If SSI uses shared pin, some SSI will be used as parent SSI.
Then, normal SSI's remove and Parent SSI's remove
(these are same SSI) will be called when unbind or remove timing.
In this case, free_irq() will be called twice.
This patch solve this issue.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Reported-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: thongsyho <thong.ho.px@rvc.renesas.com>
Signed-off-by: Nhan Nguyen <nhan.nguyen.yb@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/sh/rcar/rsnd.h
sound/soc/sh/rcar/ssi.c

index 08532987852516cea79ed04051bf9b7ba62f3e51..5976e3992dd1c12df4091e4bde4511bf7ef0c741 100644 (file)
@@ -235,6 +235,7 @@ enum rsnd_mod_type {
        RSND_MOD_MIX,
        RSND_MOD_CTU,
        RSND_MOD_SRC,
+       RSND_MOD_SSIP, /* SSI parent */
        RSND_MOD_SSI,
        RSND_MOD_MAX,
 };
@@ -365,6 +366,7 @@ struct rsnd_dai_stream {
 };
 #define rsnd_io_to_mod(io, i)  ((i) < RSND_MOD_MAX ? (io)->mod[(i)] : NULL)
 #define rsnd_io_to_mod_ssi(io) rsnd_io_to_mod((io), RSND_MOD_SSI)
+#define rsnd_io_to_mod_ssip(io) rsnd_io_to_mod((io), RSND_MOD_SSIP)
 #define rsnd_io_to_mod_src(io) rsnd_io_to_mod((io), RSND_MOD_SRC)
 #define rsnd_io_to_mod_ctu(io) rsnd_io_to_mod((io), RSND_MOD_CTU)
 #define rsnd_io_to_mod_mix(io) rsnd_io_to_mod((io), RSND_MOD_MIX)
index c62a2947ac144c6291988933c0ff66ab619cc694..94739b7aca77e413ad058cfee06842650bdd1c0d 100644 (file)
@@ -550,11 +550,16 @@ static int rsnd_ssi_dma_remove(struct rsnd_mod *mod,
                               struct rsnd_priv *priv)
 {
        struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
+       struct rsnd_mod *ssi_parent_mod = rsnd_io_to_mod_ssip(io);
        struct device *dev = rsnd_priv_to_dev(priv);
        int irq = ssi->info->irq;
 
        rsnd_dma_quit(io, rsnd_mod_to_dma(mod));
 
+       /* Do nothing for SSI parent mod */
+       if (ssi_parent_mod == mod)
+               return 0;
+
        /* PIO will request IRQ again */
        devm_free_irq(dev, irq, mod);