Re: [PATCH v2] soundwire: qcom: wait for the link to stop before gating the clock

From: Konrad Dybcio

Date: Tue Dec 01 2026 - 04:42:05 EST


On 11/30/26 8:55 PM, Luke Macken wrote:
> swrm_runtime_suspend() gates hclk after sdw_bus_clk_stop() returns
> without checking that the frame generator has stopped. On the ThinkPad
> T14s Gen 7 (v3.1.0 controller) hclk comes from the LPASS WSA macro, and
> gating it turns off the macro's SoundWire clock. A trace shows that the
> frame generator can still be enabled when sdw_bus_clk_stop() returns.
>
> On this laptop the speakers sometimes stay silent when playback starts
> after a runtime suspend. A failure may leave one or both of these in
> the log:

[...]

> +static void swrm_wait_for_frame_gen_disabled(struct qcom_swrm_ctrl *ctrl)
> +{
> + int retry = SWRM_LINK_STATUS_RETRY_CNT;
> + u32 comp_sts;
> +
> + /*
> + * Downstream only checks the link status from v1.6 on, where HCLK
> + * and MCLK are decoupled.
> + */
> + if (ctrl->version <= SWRM_VERSION_1_5_1)
> + return;

note:

if (!(ctrl->version >= VERSION_1_6)

would be more robust if say v1.5.7 comes around

Konrad