mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RESEND PATCH] ASoC: codecs: lpass: fix the order or clks turn off during suspend
@ 2023-03-23 11:01 Srinivas Kandagatla
  2023-03-23 13:56 ` Amit Pundir
  2023-03-23 15:53 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Srinivas Kandagatla @ 2023-03-23 11:01 UTC (permalink / raw)
  To: broonie
  Cc: perex, tiwai, lgirdwood, linux-kernel, alsa-devel,
	Srinivas Kandagatla, Amit Pundir

The order in which clocks are stopped matters as some of the clock
like NPL are derived from MCLK.

Without this patch, Dragonboard RB5 DSP would crash with below error:
 qcom_q6v5_pas 17300000.remoteproc: fatal error received:
 ABT_dal.c:278:ABTimeout: AHB Bus hang is detected,
 Number of bus hang detected := 2 , addr0 = 0x3370000 , addr1 = 0x0!!!

Turn off  fsgen first, followed by npl and then finally mclk, which is exactly
the opposite order of enable sequence.

Fixes: 1dc3459009c3 ("ASoC: codecs: lpass: register mclk after runtime pm")
Reported-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---

Sorry for noise, resending this one, as I missed the asoc mailing list in my previous send.


 sound/soc/codecs/lpass-rx-macro.c  | 4 ++--
 sound/soc/codecs/lpass-tx-macro.c  | 4 ++--
 sound/soc/codecs/lpass-wsa-macro.c | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c
index 9e0a4e8a46c3..372bea8b3525 100644
--- a/sound/soc/codecs/lpass-rx-macro.c
+++ b/sound/soc/codecs/lpass-rx-macro.c
@@ -3668,9 +3668,9 @@ static int __maybe_unused rx_macro_runtime_suspend(struct device *dev)
 	regcache_cache_only(rx->regmap, true);
 	regcache_mark_dirty(rx->regmap);
 
-	clk_disable_unprepare(rx->mclk);
-	clk_disable_unprepare(rx->npl);
 	clk_disable_unprepare(rx->fsgen);
+	clk_disable_unprepare(rx->npl);
+	clk_disable_unprepare(rx->mclk);
 
 	return 0;
 }
diff --git a/sound/soc/codecs/lpass-tx-macro.c b/sound/soc/codecs/lpass-tx-macro.c
index b044c9c6f89b..d9318799f6b7 100644
--- a/sound/soc/codecs/lpass-tx-macro.c
+++ b/sound/soc/codecs/lpass-tx-macro.c
@@ -2096,9 +2096,9 @@ static int __maybe_unused tx_macro_runtime_suspend(struct device *dev)
 	regcache_cache_only(tx->regmap, true);
 	regcache_mark_dirty(tx->regmap);
 
-	clk_disable_unprepare(tx->mclk);
-	clk_disable_unprepare(tx->npl);
 	clk_disable_unprepare(tx->fsgen);
+	clk_disable_unprepare(tx->npl);
+	clk_disable_unprepare(tx->mclk);
 
 	return 0;
 }
diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
index 728f26d12ab0..6484c335bd5d 100644
--- a/sound/soc/codecs/lpass-wsa-macro.c
+++ b/sound/soc/codecs/lpass-wsa-macro.c
@@ -2504,9 +2504,9 @@ static int __maybe_unused wsa_macro_runtime_suspend(struct device *dev)
 	regcache_cache_only(wsa->regmap, true);
 	regcache_mark_dirty(wsa->regmap);
 
-	clk_disable_unprepare(wsa->mclk);
-	clk_disable_unprepare(wsa->npl);
 	clk_disable_unprepare(wsa->fsgen);
+	clk_disable_unprepare(wsa->npl);
+	clk_disable_unprepare(wsa->mclk);
 
 	return 0;
 }
-- 
2.21.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RESEND PATCH] ASoC: codecs: lpass: fix the order or clks turn off during suspend
  2023-03-23 11:01 [RESEND PATCH] ASoC: codecs: lpass: fix the order or clks turn off during suspend Srinivas Kandagatla
@ 2023-03-23 13:56 ` Amit Pundir
  2023-03-23 15:53 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Amit Pundir @ 2023-03-23 13:56 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: broonie, perex, tiwai, lgirdwood, linux-kernel, alsa-devel, stable

On Thu, 23 Mar 2023 at 16:31, Srinivas Kandagatla
<srinivas.kandagatla@linaro.org> wrote:
>
> The order in which clocks are stopped matters as some of the clock
> like NPL are derived from MCLK.
>
> Without this patch, Dragonboard RB5 DSP would crash with below error:
>  qcom_q6v5_pas 17300000.remoteproc: fatal error received:
>  ABT_dal.c:278:ABTimeout: AHB Bus hang is detected,
>  Number of bus hang detected := 2 , addr0 = 0x3370000 , addr1 = 0x0!!!
>
> Turn off  fsgen first, followed by npl and then finally mclk, which is exactly
> the opposite order of enable sequence.
>

Tested-by: Amit Pundir <amit.pundir@linaro.org>
CC: stable@vger.kernel.org # v6.1.y


> Fixes: 1dc3459009c3 ("ASoC: codecs: lpass: register mclk after runtime pm")
> Reported-by: Amit Pundir <amit.pundir@linaro.org>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>
> Sorry for noise, resending this one, as I missed the asoc mailing list in my previous send.
>
>
>  sound/soc/codecs/lpass-rx-macro.c  | 4 ++--
>  sound/soc/codecs/lpass-tx-macro.c  | 4 ++--
>  sound/soc/codecs/lpass-wsa-macro.c | 4 ++--
>  3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c
> index 9e0a4e8a46c3..372bea8b3525 100644
> --- a/sound/soc/codecs/lpass-rx-macro.c
> +++ b/sound/soc/codecs/lpass-rx-macro.c
> @@ -3668,9 +3668,9 @@ static int __maybe_unused rx_macro_runtime_suspend(struct device *dev)
>         regcache_cache_only(rx->regmap, true);
>         regcache_mark_dirty(rx->regmap);
>
> -       clk_disable_unprepare(rx->mclk);
> -       clk_disable_unprepare(rx->npl);
>         clk_disable_unprepare(rx->fsgen);
> +       clk_disable_unprepare(rx->npl);
> +       clk_disable_unprepare(rx->mclk);
>
>         return 0;
>  }
> diff --git a/sound/soc/codecs/lpass-tx-macro.c b/sound/soc/codecs/lpass-tx-macro.c
> index b044c9c6f89b..d9318799f6b7 100644
> --- a/sound/soc/codecs/lpass-tx-macro.c
> +++ b/sound/soc/codecs/lpass-tx-macro.c
> @@ -2096,9 +2096,9 @@ static int __maybe_unused tx_macro_runtime_suspend(struct device *dev)
>         regcache_cache_only(tx->regmap, true);
>         regcache_mark_dirty(tx->regmap);
>
> -       clk_disable_unprepare(tx->mclk);
> -       clk_disable_unprepare(tx->npl);
>         clk_disable_unprepare(tx->fsgen);
> +       clk_disable_unprepare(tx->npl);
> +       clk_disable_unprepare(tx->mclk);
>
>         return 0;
>  }
> diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
> index 728f26d12ab0..6484c335bd5d 100644
> --- a/sound/soc/codecs/lpass-wsa-macro.c
> +++ b/sound/soc/codecs/lpass-wsa-macro.c
> @@ -2504,9 +2504,9 @@ static int __maybe_unused wsa_macro_runtime_suspend(struct device *dev)
>         regcache_cache_only(wsa->regmap, true);
>         regcache_mark_dirty(wsa->regmap);
>
> -       clk_disable_unprepare(wsa->mclk);
> -       clk_disable_unprepare(wsa->npl);
>         clk_disable_unprepare(wsa->fsgen);
> +       clk_disable_unprepare(wsa->npl);
> +       clk_disable_unprepare(wsa->mclk);
>
>         return 0;
>  }
> --
> 2.21.0
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RESEND PATCH] ASoC: codecs: lpass: fix the order or clks turn off during suspend
  2023-03-23 11:01 [RESEND PATCH] ASoC: codecs: lpass: fix the order or clks turn off during suspend Srinivas Kandagatla
  2023-03-23 13:56 ` Amit Pundir
@ 2023-03-23 15:53 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2023-03-23 15:53 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: perex, tiwai, lgirdwood, linux-kernel, alsa-devel, Amit Pundir

On Thu, 23 Mar 2023 11:01:25 +0000, Srinivas Kandagatla wrote:
> The order in which clocks are stopped matters as some of the clock
> like NPL are derived from MCLK.
> 
> Without this patch, Dragonboard RB5 DSP would crash with below error:
>  qcom_q6v5_pas 17300000.remoteproc: fatal error received:
>  ABT_dal.c:278:ABTimeout: AHB Bus hang is detected,
>  Number of bus hang detected := 2 , addr0 = 0x3370000 , addr1 = 0x0!!!
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: codecs: lpass: fix the order or clks turn off during suspend
      commit: a4a3203426f4b67535d6442ddc5dca8878a0678f

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-23 15:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-23 11:01 [RESEND PATCH] ASoC: codecs: lpass: fix the order or clks turn off during suspend Srinivas Kandagatla
2023-03-23 13:56 ` Amit Pundir
2023-03-23 15:53 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®