From bf1fe8fbadafa1be4ba0bf09aa310215d72abaeb Mon Sep 17 00:00:00 2001 From: Meng Wang Date: Wed, 26 Jun 2019 15:39:41 +0800 Subject: [PATCH] asoc: bolero: force bolero runtime suspend during adsp ssr During adsp SSR, bolero runtime suspend is not called and hw vote clks are not reset. Force bolero runtime suspend during adsp SSR to avoid kernel panic. Change-Id: Iff5983ef07f77ecc7f3f344948c013906b4bad60 Signed-off-by: Meng Wang --- asoc/codecs/bolero/rx-macro.c | 2 ++ asoc/codecs/bolero/tx-macro.c | 2 ++ asoc/codecs/bolero/va-macro.c | 4 ++++ asoc/codecs/bolero/wsa-macro.c | 2 ++ 4 files changed, 10 insertions(+) diff --git a/asoc/codecs/bolero/rx-macro.c b/asoc/codecs/bolero/rx-macro.c index 285324d9ad9a..ed820ab7ad62 100644 --- a/asoc/codecs/bolero/rx-macro.c +++ b/asoc/codecs/bolero/rx-macro.c @@ -1224,6 +1224,8 @@ static int rx_macro_event_handler(struct snd_soc_component *component, rx_priv->swr_ctrl_data[0].rx_swr_pdev, SWR_DEVICE_SSR_DOWN, NULL); } + if (!pm_runtime_status_suspended(rx_dev)) + bolero_runtime_suspend(rx_dev); break; case BOLERO_MACRO_EVT_SSR_UP: rx_priv->dev_up = true; diff --git a/asoc/codecs/bolero/tx-macro.c b/asoc/codecs/bolero/tx-macro.c index 908fb3f402fc..bc5b056b03ec 100644 --- a/asoc/codecs/bolero/tx-macro.c +++ b/asoc/codecs/bolero/tx-macro.c @@ -354,6 +354,8 @@ static int tx_macro_event_handler(struct snd_soc_component *component, tx_priv->swr_ctrl_data[0].tx_swr_pdev, SWR_DEVICE_SSR_DOWN, NULL); } + if (!pm_runtime_status_suspended(tx_dev)) + bolero_runtime_suspend(tx_dev); break; case BOLERO_MACRO_EVT_SSR_UP: /* reset swr after ssr/pdr */ diff --git a/asoc/codecs/bolero/va-macro.c b/asoc/codecs/bolero/va-macro.c index a94ca7701203..e96d357b9808 100644 --- a/asoc/codecs/bolero/va-macro.c +++ b/asoc/codecs/bolero/va-macro.c @@ -237,6 +237,10 @@ static int va_macro_event_handler(struct snd_soc_component *component, case BOLERO_MACRO_EVT_CLK_RESET: bolero_rsc_clk_reset(va_dev, VA_CORE_CLK); break; + case BOLERO_MACRO_EVT_SSR_DOWN: + if (!pm_runtime_status_suspended(va_dev)) + bolero_runtime_suspend(va_dev); + break; default: break; } diff --git a/asoc/codecs/bolero/wsa-macro.c b/asoc/codecs/bolero/wsa-macro.c index 3ca5d4c1d55c..fe5811da4b03 100644 --- a/asoc/codecs/bolero/wsa-macro.c +++ b/asoc/codecs/bolero/wsa-macro.c @@ -919,6 +919,8 @@ static int wsa_macro_event_handler(struct snd_soc_component *component, wsa_priv->swr_ctrl_data[0].wsa_swr_pdev, SWR_DEVICE_SSR_DOWN, NULL); } + if (!pm_runtime_status_suspended(wsa_dev)) + bolero_runtime_suspend(wsa_dev); break; case BOLERO_MACRO_EVT_SSR_UP: /* reset swr after ssr/pdr */