Repository navigation
qcom: audio: Allow CX/DDR collapse in s2idle - #1392
Open
Gopi Chandra Sekhar Reddy Kanala (gkanala-qc) wants to merge 4 commits into
Open
Gopi Chandra Sekhar Reddy Kanala (gkanala-qc) wants to merge 4 commits into
Gopi Chandra Sekhar Reddy Kanala (gkanala-qc) wants to merge 4 commits into
Conversation
Test Matrix
|
Test jobs on 541d9ea |
On controllers borrowing DATA lanes, the lane provider has no bus of its own and no runtime PM, so the hclk enabled at probe stays on even when the consumer has suspended and the link is idle. Give the provider minimal runtime PM callbacks that only gate its hclk. Mark it active and enable runtime PM before advertising it as ready. Add DL_FLAG_PM_RUNTIME and DL_FLAG_RPM_ACTIVE to the consumer-to-provider device link, so the provider resumes before the consumer accesses its registers and suspends after the consumer stops the bus clock. In remove(), disable runtime PM on the provider and drop hclk if it is still active. Resume the provider around the consumer's final register writes that disable it, then clear the cross-pointers. Restore the provider's MM_SYNC configuration when the consumer resumes the link. Adapted to this tree's lane-provider/consumer implementation. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
…time PM The rx, tx, wsa and va macros register their output clock (SWR clock gate or fsgen) after enabling runtime PM. The clk core then marks each macro as a runtime PM managed provider, and clk_summary resumes it through clk_pm_runtime_get_all() before walking the tree. Resuming the macro enables its macro, dcodec, mclk, npl and fsgen clocks, so the summary always shows them enabled even when audio is idle. The clk core doesn't need to resume these providers. The gate prepare/unprepare callbacks already take and drop runtime PM themselves. is_enabled reads a cached, non-volatile register, so it never touches the hardware. Register the clk_hw before devm_pm_runtime_enable(). Keep adding the OF provider at the end of probe, so a consumer can't prepare the gate before runtime PM is enabled. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
The controller only implements runtime PM callbacks and relies on runtime suspend to stop the bus clock and release hclk. That is not enough across system suspend: from the prepare phase until complete the PM core holds a runtime PM usage count on every device, so a controller that is runtime active at that point, or that one of its peripherals resumes from its own system suspend callback, stays active until the system resumes. This happens on Glymur CRD with the WCD9378 SDCA codec. The SDCA class function's system suspend callback resumes the function to quiesce its interrupts, which resumes the codec, the SoundWire bus master and, through runtime PM device links, the lane provider controller, the RX/TX macros and the LPASS LPI pin controller. Nothing suspends them again, so their LPASS clock votes are held for the whole suspend and CX and DDR never collapse. Use pm_runtime_force_suspend() and pm_runtime_force_resume() as the system sleep callbacks, so the runtime suspend path (clock stop, hclk off, wake IRQ armed) always runs at system suspend and is undone on resume. Peripherals are children of the bus and suspend before it. The lane provider is a device link supplier of its consumer, so it suspends after the consumer has stopped the bus and resumes before the consumer restarts it, which is the order the runtime callbacks already expect. Signed-off-by: Gopi Chandra Sekhar Reddy Kanala <gopi.kanala@oss.qualcomm.com>
…stem sleep The LPASS LPI pin controller votes for the LPASS HW_MACRO and HW_DCODEC clocks through pm_clk and only has runtime PM callbacks. Its consumers, such as the SoundWire controllers, keep it runtime active through their device links. If a consumer is active when system suspend starts, or is resumed during it, the usage count the PM core holds from the prepare phase keeps the pin controller from runtime suspending, and both votes are held for the whole suspend. On Glymur CRD this keeps CX and DDR from collapsing. Use pm_runtime_force_suspend() and pm_runtime_force_resume() as the system sleep callbacks so the clocks are always released at system suspend. Consumers are suspended before their suppliers, so the pin controller is the last of them to go down and the first to come back. Signed-off-by: Gopi Chandra Sekhar Reddy Kanala <gopi.kanala@oss.qualcomm.com>
Gopi Chandra Sekhar Reddy Kanala (gkanala-qc)
force-pushed
the
qcom-7.3
branch
from
November 6, 2026 06:42
541d9ea to
a43156f
Compare
Test Matrix
|
Test jobs on a43156f |
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.
Glymur CRD: release LPASS audio votes so CX/DDR can collapse in s2idle
On Glymur CRD, the audio stack held LPASS clock votes while system idle and during
s2idle, so CX, DDR and AOSS never collapsed (qcom_stats cxsd/ddr/aosd Count
stayed 0).
Idle fixes
soundwire: qcom: gate dependent controller hclk with runtime PM
The lane provider controller (swr1, which supplies data lanes to swr2) turned
its hclk on at probe and never turned it off. It now gets runtime PM through
a device link to its consumer, so hclk is gated whenever the link is idle.
ASoC: codecs: lpass-macro: register output clocks before runtime PM
The rx/tx/va/wsa macros registered their output clock after enabling runtime
PM. The clk core then woke each macro whenever clk_summary was read, so the
macro clocks always looked enabled. The clock is now registered before
runtime PM is enabled.
Suspend fixes
During system suspend, the WCD9378 SDCA suspend callback wakes the codec,
and that wake propagates to the SoundWire controllers and the LPI pin
controller. Both had only runtime PM callbacks, so once woken they stayed
on, with their clock votes, for the whole suspend.
soundwire: qcom: force runtime suspend across system sleep
pinctrl: qcom: sm8650-lpass-lpi: Force runtime suspend on system sleep
Both now use pm_runtime_force_suspend()/pm_runtime_force_resume() as their
system sleep callbacks, the same way the lpass macros already do. Glymur
binds the sm8650 LPI driver through its fallback compatible.
Jira ticket: https://jira-dc.qualcomm.com/jira/browse/QLIJIRA-208
Backport: qualcomm-linux/kernel-topics#2177