Re: [PATCH 2/2] soundwire: Intel: stop sdw clock in system suspend
From: Richard Fitzgerald
Date: Wed Jul 01 2026 - 08:16:04 EST
On 01/07/2026 12:55 pm, Pierre-Louis Bossart wrote:
If the Manager doesn't send a clock-stop, the peripherals don't get a
notification that they can enter a lower-power mode. The clock suddenly
disappears without warning and without the peripherals being notified
why, so they don't have any information to know what is happening.
that's not quite right, see below.
The Manager should send a clock-stop notification before stopping the
clock.
That's exactly the existing logic in drivers/soundwire/bus.c, the core does notify all peripheral drivers of a clock stop transition.
It's been observed with logic analyzer captures on real hardware
that the clock stop is only being sent in runtime suspends, not
system suspends.
Because of this, if the bus was in a runtime-resumed state when
system suspend started the clock would stop without warning.
Bard - that's the observed behavior this patch is fixing, right?
sdw_slave_clk_stop_callback(slave, SDW_CLK_PRE_PREPARE);
sdw_slave_clk_stop_callback(slave, SDW_CLK_POST_PREPARE);
These pre- and post callback that can be used by the peripheral for imp-def actions.
I am not sure if the POST_PREPARE makes sense, since the clock is already stopped the peripheral cannot be programmed. IIRC it was added for symmetry.
The PRE_PREPARE is most likely what you are looking for in the implementation of the drv->ops->clk_stop callback.
Hope this helps!