From: Val Packett <val@packett.cool>
To: "Ramón Jesús Miranda" <ramonjesusmiranda@gmail.com>,
"Srinivas Kandagatla" <srini@kernel.org>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Mark Brown" <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: codecs: lpass-macro: release macro and dcodec clocks in runtime suspend
Date: Sat, 24 Oct 2026 19:58:33 -0300 [thread overview]
Message-ID: <f17f962d-22d7-4a88-bdcc-9be6556040f1@packett.cool> (raw)
In-Reply-To: <20261023173216.6245-1-ramonjesusmiranda@gmail.com>
On 10/23/26 2:32 PM, Ramón Jesús Miranda wrote:
> The LPASS rx, tx, wsa, and va macro codec drivers prepare and enable their
> "macro" and "dcodec" clocks (which correspond to q6prm LPASS_HW_MACRO and
> LPASS_HW_DCODEC clock votes to the ADSP) in probe() and only release them
> in remove(). Their runtime PM callbacks only toggle mclk, npl, and fsgen.
>
> On Qualcomm X1E80100 systems where the ADSP is booted by Linux (such as
> running at EL2 on the Microsoft Surface Pro 11), keeping the LPASS_HW_MACRO
> and LPASS_HW_DCODEC votes active while audio is idle prevents the ADSP from
> entering low-power sleep during s2idle, which in turn blocks the SoC from
> reaching CX collapse (CXSD) and AOSS sleep (AOSD) (both counters remain at
> 0). Also, calling clk_disable_unprepare() unconditionally in remove() on
> clocks already disabled by runtime_suspend() causes clock enable count
> underflows if the driver is unloaded while runtime-suspended.
>
> Disable "dcodec" and "macro" in runtime_suspend(), re-enable them in
> runtime_resume(), and guard the clock teardown in remove() with
> !pm_runtime_status_suspended(). With this change, ADSP, CXSD, and AOSD
> reach >99.9% residency during s2idle (~0.20 W system sleep power on a
> Microsoft Surface Pro 11 OLED).
>
> Assisted-by: Claude:claude-opus-5-5
> Assisted-by: Antigravity:gemini-2.5-pro
Advertisements for particular slop-generators are discouraged since
816d9992d9ed ("coding-assistants: simplify attribution") btw, and the
tag is no longer required since 1e035297ffda ("docs: remove Assisted-by
references").
> [..]
> --- a/sound/soc/codecs/lpass-tx-macro.c
> +++ b/sound/soc/codecs/lpass-tx-macro.c
> @@ -2390,11 +2390,13 @@ static void tx_macro_remove(struct platform_device *pdev)
> {
> struct tx_macro *tx = dev_get_drvdata(&pdev->dev);
>
> - clk_disable_unprepare(tx->macro);
> - clk_disable_unprepare(tx->dcodec);
> - clk_disable_unprepare(tx->mclk);
> - clk_disable_unprepare(tx->npl);
> - clk_disable_unprepare(tx->fsgen);
> + if (!pm_runtime_status_suspended(&pdev->dev)) {
> + clk_disable_unprepare(tx->macro);
> + clk_disable_unprepare(tx->dcodec);
> + clk_disable_unprepare(tx->mclk);
> + clk_disable_unprepare(tx->npl);
> + clk_disable_unprepare(tx->fsgen);
> + }
>
> lpass_macro_pds_exit(tx->pds);
> }
> [..]
You're working with a tree that's months out of date! This does not
apply to linux-next at all.
Commit a5ee3180a2a7 ("ASoC: codecs: lpass-{tx,rx}-macro: switch to PM
clock framework") back in July removed all of these calls, and the
clocks are now automatically managed by the framework, which has solved
the issue.
Several people in #aarch64-laptops have gotten CXSD state working
recently, and no one touched sound/soc/codecs.
~val
next prev parent reply other threads:[~2026-10-24 22:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 17:32 Ramón Jesús Miranda
2026-10-24 22:58 ` Val Packett [this message]
2026-10-25 12:53 ` Ramón Jesús Miranda
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=f17f962d-22d7-4a88-bdcc-9be6556040f1@packett.cool \
--to=val@packett.cool \
--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=perex@perex.cz \
--cc=ramonjesusmiranda@gmail.com \
--cc=srini@kernel.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®