All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Shawn Guo" <shengchao.guo@oss.qualcomm.com>
Cc: linux-sound@vger.kernel.org
Subject: Re: [PATCH 3/3] ASoC: qcom: q6prm: Keep the clock controller across DSP restarts
Date: Sun, 15 Nov 2026 03:35:55 +0000	[thread overview]
Message-ID: <sashiko-outbox-215203@kernel.org> (raw)
In-Reply-To: <20261115032027.414953-4-shengchao.guo@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] ASoC: qcom: q6prm: clock restore in prm_probe() times out
  before callback setup
--

commit 02c1625331bd9fcb6147637d9b08efb05abcc888
Author: Shawn Guo <shengchao.guo@oss.qualcomm.com>

ASoC: qcom: q6prm: Keep the clock controller across DSP restarts

This commit keeps the q6prm LPASS clock controller platform device alive
across DSP restarts and restores prepared clocks when the q6prm GPR device
probes again.

> diff --git a/sound/soc/qcom/qdsp6/q6prm.c b/sound/soc/qcom/qdsp6/q6prm.c
> index 73b5a96e83119..861d48bdb5eaf 100644
> --- a/sound/soc/qcom/qdsp6/q6prm.c
> +++ b/sound/soc/qcom/qdsp6/q6prm.c
[ ... ]
> @@ -230,7 +350,29 @@ static int prm_probe(gpr_device_t *gdev)
>  	if (!q6apm_is_adsp_ready())
>  		return -EPROBE_DEFER;
>  
> -	return devm_of_platform_populate(dev);
> +	ret = q6prm_clkctl_attach(cc);
> +	if (ret)
> +		return ret;
> +
> +	if (cc->clkctl)
> +		q6dsp_clock_dsp_up(&cc->clkctl->pdev->dev);
> +
> +	return 0;
> +}

[Severity: High]
Will q6dsp_clock_dsp_up() always time out when restoring lost clocks inside
prm_probe()?

apr_device_probe() only installs adrv->gpr_callback into adev->svc.callback
after adrv->probe() returns 0:

drivers/soc/qcom/apr.c:apr_device_probe() {
    ...
	ret = adrv->probe(adev);
	if (!ret)
		adev->svc.callback = adrv->gpr_callback;
    ...
}

When q6dsp_clock_dsp_up() sends PRM_CMD_REQUEST_HW_RSC via
q6prm_send_cmd_sync() -> audioreach_send_cmd_sync() and waits on prm->wait,
gdev->svc.callback is still NULL, so gpr_do_rx_callback() drops the DSP
response without calling prm_callback(). Every lost clock waits 5 seconds
and fails with -ETIMEDOUT, leaving clk->lost set. The same happens if a
consumer requests a clock after q6prm_clkctl_attach() sets ctl->prm and
calls of_platform_device_create() before prm_probe() returns.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261115032027.414953-1-shengchao.guo@oss.qualcomm.com?part=3

      reply	other threads:[~2026-11-15  3:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-15  3:20 [PATCH 0/3] ASoC: qcom: qdsp6: Fix audio after an ADSP restart Shawn Guo
2026-11-15  3:20 ` [PATCH 1/3] ASoC: qcom: q6apm: Wait for SPF to be ready before registering Shawn Guo
2026-11-15  3:42   ` sashiko-bot
2026-11-15  3:20 ` [PATCH 2/3] ASoC: qcom: q6dsp-lpass-clocks: Restore clocks after a DSP restart Shawn Guo
2026-11-15  3:20 ` [PATCH 3/3] ASoC: qcom: q6prm: Keep the clock controller across DSP restarts Shawn Guo
2026-11-15  3:35   ` sashiko-bot [this message]

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=sashiko-outbox-215203@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=shengchao.guo@oss.qualcomm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.