LPASS codec macros: switch to explicit clock management in runtime PM - #1945
Merged
Merged
Conversation
added 5 commits
September 30, 2026 15:38
Replace PM clock framework usage with explicit clock prepare/enable and disable/unprepare operations from runtime PM callbacks. This keeps the RX macro clock prepare state tied to the runtime PM active state, so idle suspend can release parent clock votes. Use DEFINE_RUNTIME_DEV_PM_OPS() so system suspend forces the same runtime suspend path for an active device. Link: https://lore.kernel.org/all/20260928-xo-sd-runtimepm-v1-final-v1-1-e3ebade3aeb7@oss.qualcomm.com/ Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com> Signed-off-by: Aiyaz Patel <aiyapate@qti.qualcomm.com>
Replace PM clock framework usage with explicit clock prepare/enable and disable/unprepare operations from runtime PM callbacks. This keeps the TX macro clock prepare state tied to the runtime PM active state, so idle suspend can release parent clock votes. Use DEFINE_RUNTIME_DEV_PM_OPS() so system suspend forces the same runtime suspend path for an active device. Link: https://lore.kernel.org/all/20260928-xo-sd-runtimepm-v1-final-v1-2-e3ebade3aeb7@oss.qualcomm.com/ Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com> Signed-off-by: Aiyaz Patel <aiyapate@qti.qualcomm.com>
Replace PM clock framework usage with explicit clock prepare/enable and disable/unprepare operations from runtime PM callbacks. This keeps the VA macro clock prepare state tied to the runtime PM active state, so idle suspend can release parent clock votes. Use DEFINE_RUNTIME_DEV_PM_OPS() so system suspend forces the same runtime suspend path for an active device. Link: https://lore.kernel.org/all/20260928-xo-sd-runtimepm-v1-final-v1-3-e3ebade3aeb7@oss.qualcomm.com/ Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com> Signed-off-by: Aiyaz Patel <aiyapate@qti.qualcomm.com>
Replace PM clock framework usage with explicit clock prepare/enable and disable/unprepare operations from runtime PM callbacks. This keeps the WSA macro clock prepare state tied to the runtime PM active state, so idle suspend can release parent clock votes. Use DEFINE_RUNTIME_DEV_PM_OPS() so system suspend forces the same runtime suspend path for an active device. Link: https://lore.kernel.org/all/20260928-xo-sd-runtimepm-v1-final-v1-4-e3ebade3aeb7@oss.qualcomm.com/ Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com> Signed-off-by: Aiyaz Patel <aiyapate@qti.qualcomm.com>
The LPASS macro codec drivers no longer use PM clock framework helpers after moving clock handling into runtime PM callbacks. Drop the PM_CLK dependency from RX, TX, VA and WSA macro Kconfig symbols. Link: https://lore.kernel.org/all/20260928-xo-sd-runtimepm-v1-final-v1-5-e3ebade3aeb7@oss.qualcomm.com/ Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com> Signed-off-by: Aiyaz Patel <aiyapate@qti.qualcomm.com>
qcomlnxci
requested review from
a team,
PrasadKumpatla and
mohsRafi
and removed request for
a team
September 30, 2026 11:14
mohsRafi
approved these changes
Oct 1, 2026
mohsRafi
merged commit Oct 1, 2026
277113f
into
qualcomm-linux:tech/mm/audio/all
4 of 6 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The LPASS macro codec drivers currently rely on the PM clock framework
to manage their clocks. The PM clock framework is useful for the common
case where drivers only need clocks enabled while the device is active,
but its lifecycle is not a good fit for these codec clocks.
The PM clock framework separates the prepare and enable lifetimes:
of_pm_clk_add_clks() adds the DT clocks to the device PM clock list.
pm_clk_acquire() is called while adding each clock.
for normal clocks, pm_clk_acquire() calls clk_prepare() immediately
and marks the clock as PCE_STATUS_PREPARED.
runtime resume calls pm_clk_resume(), which calls clk_enable() for
clocks already in PCE_STATUS_PREPARED.
runtime suspend calls pm_clk_suspend(), which calls clk_disable() and
returns the clock to PCE_STATUS_PREPARED.
clk_unprepare() is not called on normal runtime suspend; it happens
when the PM clock entry is removed/destroyed. For a codec device this
usually means driver remove or reboot, not the end of an audio use
case.
PM-clk does have a different runtime suspend path for clocks that report
clk_is_enabled_when_prepared(), where suspend uses
clk_disable_unprepare(). The issue described here is for normal clocks
with separate enable/disable operations, which remain prepared across
runtime suspend.
That prepare/enable split is problematic for platforms where the audio
macro clocks are sourced from an XO-backed clock tree. Preparing a child
clock walks the parent tree. If the parent path reaches an RPM/RPMh
managed XO clock, the provider may vote for the XO resource during
prepare. Therefore a non-zero prepare count can be sufficient to keep
the XO resource voted at the provider level, even when the corresponding
enable count is zero.
In other words, after the codec runtime suspends, PM-clk has disabled the
LPASS macro clocks, but it has intentionally kept them prepared. On
XO-backed clock trees that remaining prepared state can still hold the
parent XO vote and prevent XO shutdown. This is expected behaviour from
the PM clock framework, but it does not match the power requirement for
these audio macro clocks.
For the LPASS macro drivers the required clock lifetime is simpler: the
macro register block needs these clocks only while the device is runtime
active. Move RX, TX, VA and WSA macro clock handling into the existing
runtime PM callbacks using clk_prepare_enable() on runtime resume and
clk_disable_unprepare() on runtime suspend. This makes both prepare and
enable counts follow the device runtime PM active state and releases
parent XO votes when the macro runtime suspends.
Each macro driver is converted independently so the series remains
bisectable. The final patch drops the now-unused PM_CLK dependency from
the LPASS macro Kconfig symbols.
CRs-Fixed: 4649922