Skip to content

ASoC: qcom: lpass macro / soundwire: retry deferred clock acquisition - #1417

Closed
yass27106-hue wants to merge 1 commit into
qualcomm-linux:mainfrom
yass27106-hue:clk-retry-deferred
Closed

yass27106-hue wants to merge 1 commit into
qualcomm-linux:mainfrom
yass27106-hue:clk-retry-deferred

Conversation

@yass27106-hue

Copy link
Copy Markdown

On Qualcomm X1E/X1P laptops the LPASS WSA/RX/TX macro codecs take their "fsgen" clock from the VA macro, and their "mclk"/"macro"/"dcodec" clocks from the q6prm clock controller, which lives under the ADSP's GPR service node. These providers can register a few seconds after the consumers probe, because the ADSP itself boots asynchronously (remoteproc + PD mapper).

Clock-provider registration does not trigger deferred-probe retries, so a macro driver that loses this order race stays deferred forever. On the Asus Vivobook 16 X1607QA (Snapdragon X X1P-42-100) the whole audio chain (SoundWire masters, WSA/RX/TX macros, sound card) freezes on roughly every other boot, depending on ADSP bring-up timing versus driver probe.

Fix by giving the devm_clk_get() calls in these drivers a bounded retry (60 x 500 ms) instead of returning -EPROBE_DEFER into a queue that is never revisited. 30 s covers the observed ADSP boot latency with ample margin; probe context can sleep.

Also applies the same treatment to the "iface" clock of the Qualcomm SoundWire controller, which depends on the same macro clock providers.

Tested on Asus Vivobook 16 X1607QA (Snapdragon X X1P-42-100): audio chain now completes probe on every boot instead of intermittently.

On Qualcomm X1E/X1P laptops the LPASS WSA/RX/TX macro codecs take their
"fsgen" clock from the VA macro, and their "mclk"/"macro"/"dcodec" clocks
from the q6prm clock controller, which lives under the ADSP's GPR service
node. These providers can register a few seconds after the consumers
probe, because the ADSP itself boots asynchronously (remoteproc +
PD mapper).

Clock-provider registration does not trigger deferred-probe retries, so
a macro driver that loses this order race stays deferred forever: on the
Asus Vivobook 16 (X1P-42-100) the whole audio chain (SoundWire masters,
WSA/RX/TX macros, sound card) freezes on roughly every other boot,
depending on ADSP bring-up timing versus driver probe.

Fix by giving the devm_clk_get() calls in these drivers a bounded retry
(60 x 500 ms) instead of returning -EPROBE_DEFER into a queue that is
never revisited. 30 s covers the observed ADSP boot latency with ample
margin, and probe context can sleep.

Also applies the same treatment to the "iface" clock of the Qualcomm
SoundWire controller, which depends on the same macro clock providers.

Tested on Asus Vivobook 16 X1607QA (Snapdragon X X1P-42-100): audio
chain now completes probe on every boot instead of intermittently.

Signed-off-by: kellermanrivero <kellermanrivero@users.noreply.github.com>
@yass27106-hue

Copy link
Copy Markdown
Author

Closing for now: the test claim in the commit message was premature - the patch has not been validated on hardware yet. Will resubmit with real boot logs once tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants