mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Luca Weiss" <luca.weiss@fairphone.com>
To: "Srinivas Kandagatla" <srinivas.kandagatla@linaro.org>,
	<broonie@kernel.org>
Cc: <lgirdwood@gmail.com>, <perex@perex.cz>, <tiwai@suse.com>,
	<alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>,
	<steev@kali.org>, <johan+linaro@kernel.org>,
	<quic_bjorande@quicinc.com>
Subject: Re: [PATCH 5/8] ASoC: codecs: lpass: register mclk after runtime pm
Date: Fri, 31 Mar 2023 13:42:37 +0200	[thread overview]
Message-ID: <CRKJIAFM4FQS.CLF4S9AUEBBX@otso> (raw)
In-Reply-To: <e782e78c-422f-fbf9-94a3-3557c9f7fc7e@linaro.org>

On Fri Mar 24, 2023 at 2:40 PM CET, Srinivas Kandagatla wrote:
> Hi Luca,
>
> On 24/03/2023 11:22, Luca Weiss wrote:
> > Hi Srinivas,
> > 
> > On Thu Feb 9, 2023 at 1:28 PM CET, Srinivas Kandagatla wrote:
> >> move mclk out registration after runtime pm is enabled so that the
> >> clk framework can resume the codec if it requires to enable the mclk out.
> >>
> >> Fixes: c96baa2949b2 ("ASoC: codecs: wsa-macro: add runtime pm support")
> >> Fixes: 72ad25eabda0 ("ASoC: codecs: va-macro: add runtime pm support")
> >> Fixes: 366ff79ed539 ("ASoC: codecs: rx-macro: add runtime pm support")
> >> Fixes: 1fb83bc5cf64 ("ASoC: codecs: tx-macro: add runtime pm support")
> >> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> > 
> > I see the following remoteproc crash with this patch in on
> > sm6350/sm7225-fairphone-fp4.
> > 
> > To be clear, all the audio parts for that SoC are not upstream (yet) and
> > there's still many issues to solve so not sure if it's actually my fault.
> > 
>
> please try this patch Amit did report this issue before
>
> https://lore.kernel.org/lkml/20230323110125.23790-1-srinivas.kandagatla@linaro.org/

Right, that fixes it on sm6350/sm7225 also. Thanks!

Regards
Luca

>
>
> thanks,
> srini
> > Anyways, getting this crash after starting adsp.
> > 
> > [   97.212943] qcom_q6v5_pas 3000000.remoteproc: fatal error received: ABT_dal.c:287:ABTimeout: AHB Bus hang is detected, Number of bus hang detected := 1 , addr0 = 0x3370000 , addr1 = 0x0!!!
> > [   97.212995] remoteproc remoteproc0: crash detected in 3000000.remoteproc: type fatal error
> > [   97.213015] remoteproc remoteproc0: handling crash #1 in 3000000.remoteproc
> > [   97.213022] remoteproc remoteproc0: recovering 3000000.remoteproc
> > 
> > This happens just after some clocks on the adsp get disabled, this is
> > from my own debug prints:
> > [   97.189097] q6afe_set_lpass_clock: clk_id=780, attri=1, clk_root=0, freq=0
> > [   97.189426] q6afe_set_lpass_clock: clk_id=781, attri=1, clk_root=0, freq=0
> > 
> > And then a couple of seconds later the whole phone just crashes into the
> > 900e mode.
> > 
> > Regards
> > Luca
> > 
> > 
> >> ---
> >>   sound/soc/codecs/lpass-rx-macro.c  |  8 ++++----
> >>   sound/soc/codecs/lpass-tx-macro.c  |  8 ++++----
> >>   sound/soc/codecs/lpass-va-macro.c  | 20 ++++++++++----------
> >>   sound/soc/codecs/lpass-wsa-macro.c |  9 ++++-----
> >>   4 files changed, 22 insertions(+), 23 deletions(-)
> >>
> >> diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c
> >> index a9ef9d5ffcc5..dd6970d5eb8d 100644
> >> --- a/sound/soc/codecs/lpass-rx-macro.c
> >> +++ b/sound/soc/codecs/lpass-rx-macro.c
> >> @@ -3601,10 +3601,6 @@ static int rx_macro_probe(struct platform_device *pdev)
> >>   	if (ret)
> >>   		goto err_fsgen;
> >>   
> >> -	ret = rx_macro_register_mclk_output(rx);
> >> -	if (ret)
> >> -		goto err_clkout;
> >> -
> >>   	ret = devm_snd_soc_register_component(dev, &rx_macro_component_drv,
> >>   					      rx_macro_dai,
> >>   					      ARRAY_SIZE(rx_macro_dai));
> >> @@ -3618,6 +3614,10 @@ static int rx_macro_probe(struct platform_device *pdev)
> >>   	pm_runtime_set_active(dev);
> >>   	pm_runtime_enable(dev);
> >>   
> >> +	ret = rx_macro_register_mclk_output(rx);
> >> +	if (ret)
> >> +		goto err_clkout;
> >> +
> >>   	return 0;
> >>   
> >>   err_clkout:
> >> diff --git a/sound/soc/codecs/lpass-tx-macro.c b/sound/soc/codecs/lpass-tx-macro.c
> >> index 2ef62d6edc30..b9475ba55e20 100644
> >> --- a/sound/soc/codecs/lpass-tx-macro.c
> >> +++ b/sound/soc/codecs/lpass-tx-macro.c
> >> @@ -2036,10 +2036,6 @@ static int tx_macro_probe(struct platform_device *pdev)
> >>   	if (ret)
> >>   		goto err_fsgen;
> >>   
> >> -	ret = tx_macro_register_mclk_output(tx);
> >> -	if (ret)
> >> -		goto err_clkout;
> >> -
> >>   	ret = devm_snd_soc_register_component(dev, &tx_macro_component_drv,
> >>   					      tx_macro_dai,
> >>   					      ARRAY_SIZE(tx_macro_dai));
> >> @@ -2052,6 +2048,10 @@ static int tx_macro_probe(struct platform_device *pdev)
> >>   	pm_runtime_set_active(dev);
> >>   	pm_runtime_enable(dev);
> >>   
> >> +	ret = tx_macro_register_mclk_output(tx);
> >> +	if (ret)
> >> +		goto err_clkout;
> >> +
> >>   	return 0;
> >>   
> >>   err_clkout:
> >> diff --git a/sound/soc/codecs/lpass-va-macro.c b/sound/soc/codecs/lpass-va-macro.c
> >> index b0b6cf29cba3..1623ba78ddb3 100644
> >> --- a/sound/soc/codecs/lpass-va-macro.c
> >> +++ b/sound/soc/codecs/lpass-va-macro.c
> >> @@ -1524,16 +1524,6 @@ static int va_macro_probe(struct platform_device *pdev)
> >>   	if (ret)
> >>   		goto err_mclk;
> >>   
> >> -	ret = va_macro_register_fsgen_output(va);
> >> -	if (ret)
> >> -		goto err_clkout;
> >> -
> >> -	va->fsgen = clk_hw_get_clk(&va->hw, "fsgen");
> >> -	if (IS_ERR(va->fsgen)) {
> >> -		ret = PTR_ERR(va->fsgen);
> >> -		goto err_clkout;
> >> -	}
> >> -
> >>   	if (va->has_swr_master) {
> >>   		/* Set default CLK div to 1 */
> >>   		regmap_update_bits(va->regmap, CDC_VA_TOP_CSR_SWR_MIC_CTL0,
> >> @@ -1560,6 +1550,16 @@ static int va_macro_probe(struct platform_device *pdev)
> >>   	pm_runtime_set_active(dev);
> >>   	pm_runtime_enable(dev);
> >>   
> >> +	ret = va_macro_register_fsgen_output(va);
> >> +	if (ret)
> >> +		goto err_clkout;
> >> +
> >> +	va->fsgen = clk_hw_get_clk(&va->hw, "fsgen");
> >> +	if (IS_ERR(va->fsgen)) {
> >> +		ret = PTR_ERR(va->fsgen);
> >> +		goto err_clkout;
> >> +	}
> >> +
> >>   	return 0;
> >>   
> >>   err_clkout:
> >> diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
> >> index 5cfe96f6e430..c0b86d69c72e 100644
> >> --- a/sound/soc/codecs/lpass-wsa-macro.c
> >> +++ b/sound/soc/codecs/lpass-wsa-macro.c
> >> @@ -2451,11 +2451,6 @@ static int wsa_macro_probe(struct platform_device *pdev)
> >>   	if (ret)
> >>   		goto err_fsgen;
> >>   
> >> -	ret = wsa_macro_register_mclk_output(wsa);
> >> -	if (ret)
> >> -		goto err_clkout;
> >> -
> >> -
> >>   	ret = devm_snd_soc_register_component(dev, &wsa_macro_component_drv,
> >>   					      wsa_macro_dai,
> >>   					      ARRAY_SIZE(wsa_macro_dai));
> >> @@ -2468,6 +2463,10 @@ static int wsa_macro_probe(struct platform_device *pdev)
> >>   	pm_runtime_set_active(dev);
> >>   	pm_runtime_enable(dev);
> >>   
> >> +	ret = wsa_macro_register_mclk_output(wsa);
> >> +	if (ret)
> >> +		goto err_clkout;
> >> +
> >>   	return 0;
> >>   
> >>   err_clkout:
> >> -- 
> >> 2.21.0
> > 


  reply	other threads:[~2023-03-31 11:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09 12:27 [PATCH 0/8] ASoC: qcom: q6dsp and lpass codec stablity fixes Srinivas Kandagatla
2023-02-09 12:27 ` [PATCH 1/8] ASoC: qcom: q6apm-lpass-dai: unprepare stream if its already prepared Srinivas Kandagatla
2023-02-09 12:28 ` [PATCH 2/8] ASoC: qcom: q6apm-dai: fix race condition while updating the position pointer Srinivas Kandagatla
2023-02-09 12:28 ` [PATCH 3/8] ASoC: qcom: q6apm-dai: Add SNDRV_PCM_INFO_BATCH flag Srinivas Kandagatla
2023-02-09 12:28 ` [PATCH 4/8] ASoC: qcom: audioreach: fix ADSP ready check Srinivas Kandagatla
2023-02-09 12:28 ` [PATCH 5/8] ASoC: codecs: lpass: register mclk after runtime pm Srinivas Kandagatla
2023-03-24 11:22   ` Luca Weiss
2023-03-24 13:40     ` Srinivas Kandagatla
2023-03-31 11:42       ` Luca Weiss [this message]
2023-02-09 12:28 ` [PATCH 6/8] ASoC: codecs: lpass: fix incorrect mclk rate Srinivas Kandagatla
2023-02-09 12:28 ` [PATCH 7/8] ASoC: codecs: lpass: do not reset soundwire block on clk enable Srinivas Kandagatla
2023-02-09 12:28 ` [PATCH 8/8] ASoC: codecs: lpass: remove not so useful verbose log Srinivas Kandagatla
2023-02-09 18:36 ` [PATCH 0/8] ASoC: qcom: q6dsp and lpass codec stablity fixes Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CRKJIAFM4FQS.CLF4S9AUEBBX@otso \
    --to=luca.weiss@fairphone.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=johan+linaro@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=quic_bjorande@quicinc.com \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=steev@kali.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®