Re: [PATCH] ASoC: codecs: lpass-macro: release macro and dcodec clocks in runtime suspend
From: Val Packett
Date: Sat Oct 24 2026 - 18:58:55 EST
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 theirAdvertisements 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").
"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
[..]
--- 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