mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shawn Guo <shengchao.guo@oss.qualcomm.com>
To: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Cc: Srinivas Kandagatla <srini@kernel.org>,
	Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Mohit Sharma <mohit.sharma@oss.qualcomm.com>,
	Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>,
	Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>,
	linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] ASoC: qcom: q6dsp-lpass-clocks: Restore clocks after a DSP restart
Date: Mon, 30 Nov 2026 13:15:14 +0800	[thread overview]
Message-ID: <aw0GYlwkgaoTuDZZ@QCOM-aGQu4IUr3Y> (raw)
In-Reply-To: <c0a37fa2-902b-44c6-90bd-bbcce34a160b@oss.qualcomm.com>

On Sun, Nov 15, 2026 at 09:56:16AM +0000, Srinivas Kandagatla wrote:
> On 11/15/26 3:20 AM, Shawn Guo wrote:
> > The DSP forgets all clock requests and votes when it stops. A consumer
> > that still holds a clock prepared across a DSP restart then holds a
> > clock that the DSP no longer provides, and its later unprepare releases
> > a request the DSP never saw.
> > 
> > Track which clocks are prepared, and add q6dsp_clock_dsp_down() and
> > q6dsp_clock_dsp_up() for the DSP service driver to call when the DSP
> > goes away and comes back. dsp_down() marks the prepared clocks as lost.
> > dsp_up() requests them again at their current rate, or votes for them
> > again. Unpreparing a lost clock skips the release, since the DSP holds
> > nothing for it.
> > 
> > Fold the prepare/unprepare ops of rate and vote clocks into one pair,
> > so both kinds share the request/release helpers used by the restore
> > path. A mutex serializes prepare/unprepare against dsp_down/up.
> > 
> > This patch does not change behaviour on its own: no driver calls the
> > new functions yet.
> 
> Looks like you are hitting the devlink issue that decides to create
> provider link between remoteproc to clk consumer instead of prm clk
> controller to clk consumer.

Right, I see the same on here: pcm1681 has an active device link to
4c00000.remoteproc and none to the q6prm clock controller. The
controller's node has no device when the remoteproc binds, so
fw_devlink_pickup_dangling_consumers() moves its consumers up to the
remoteproc.

But fixing the supplier alone doesn't help. I hacked in the link
fw_devlink should have made (clock controller -> pcm1681, fw_devlink
flags). On ADSP stop the driver core unbinds pcm1681 as expected, but
nothing probes it again after the ADSP comes back: fw_devlink has
already consumed the fwnode link, so no new link is made to the new
controller device, and nothing re-probes a consumer whose supplier was
deleted and added again. The card never comes back, which is worse
than today. Only with the link re-added and pcm1681 attached by hand
does the card return.

So a devlink fix would need to re-create links and re-probe consumers
on every DSP restart, and would still tear down every codec that uses
a DSP clock. Keeping the controller across the restart and restoring
the clocks the DSP forgot is the smaller change, so v2 keeps that
approach. I'll add the devlink analysis to the commit message of
patch 3.

Shawn

  reply	other threads:[~2026-11-30  5:15 UTC|newest]

Thread overview: 8+ 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:20 ` [PATCH 2/3] ASoC: qcom: q6dsp-lpass-clocks: Restore clocks after a DSP restart Shawn Guo
2026-11-15  9:56   ` Srinivas Kandagatla
2026-11-30  5:15     ` Shawn Guo [this message]
2026-11-26 15:03   ` Mark Brown
2026-11-30  5:17     ` Shawn Guo
2026-11-15  3:20 ` [PATCH 3/3] ASoC: qcom: q6prm: Keep the clock controller across DSP restarts Shawn Guo

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=aw0GYlwkgaoTuDZZ@QCOM-aGQu4IUr3Y \
    --to=shengchao.guo@oss.qualcomm.com \
    --cc=ajay.nandam@oss.qualcomm.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=mohit.sharma@oss.qualcomm.com \
    --cc=perex@perex.cz \
    --cc=prasad.kumpatla@oss.qualcomm.com \
    --cc=srini@kernel.org \
    --cc=srinivas.kandagatla@oss.qualcomm.com \
    --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®