summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@nxp.com>2021-06-18 14:38:33 +0200
committerMark Brown <broonie@kernel.org>2021-06-21 14:06:28 +0200
commitea837090b388245744988083313f6e9c7c9b9699 (patch)
tree45578f5ba642a6a0f395c2018cc3cd73493558d6
parentASoC: tegra: Fix a NULL vs IS_ERR() check (diff)
downloadlinux-ea837090b388245744988083313f6e9c7c9b9699.tar.xz
linux-ea837090b388245744988083313f6e9c7c9b9699.zip
ASoC: fsl_xcvr: disable all interrupts when suspend happens
There is an unhandled interrupt after suspend, which cause endless interrupt when system resume, so system may hang. Disable all interrupts in runtime suspend callback to avoid above issue. Fixes: 28564486866f ("ASoC: fsl_xcvr: Add XCVR ASoC CPU DAI driver") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Fabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/1624019913-3380-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/fsl/fsl_xcvr.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c
index df7c189d97dd..92dd99258edf 100644
--- a/sound/soc/fsl/fsl_xcvr.c
+++ b/sound/soc/fsl/fsl_xcvr.c
@@ -1233,6 +1233,16 @@ static __maybe_unused int fsl_xcvr_runtime_suspend(struct device *dev)
struct fsl_xcvr *xcvr = dev_get_drvdata(dev);
int ret;
+ /*
+ * Clear interrupts, when streams starts or resumes after
+ * suspend, interrupts are enabled in prepare(), so no need
+ * to enable interrupts in resume().
+ */
+ ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_IER0,
+ FSL_XCVR_IRQ_EARC_ALL, 0);
+ if (ret < 0)
+ dev_err(dev, "Failed to clear IER0: %d\n", ret);
+
/* Assert M0+ reset */
ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL,
FSL_XCVR_EXT_CTRL_CORE_RESET,