soundwire: Intel: Always issue bus-reset after clock stop #5591
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.
Always issue a bus reset when coming out of clock stop mode. This reverts commit 08abad9 ("soundwire: intel: refine runtime pm for SDW_INTEL_CLK_STOP_BUS_RESET").
When entering clock stop the bus link is actually powered-down to save more power. The SoundWire specification allows this but requires that the manager sends a bus reset on wakeup.
On Intel hardware before Lunarlake the audio controller can only power- down if all links are powered-down. Commit 08abad9 ("soundwire: intel: refine runtime pm for SDW_INTEL_CLK_STOP_BUS_RESET") added a special case to skip the bus reset and do a normal exit from clock stop if the link was not fully powered-down.
However, this shortcut is not safe. When powering the link up again there will be false edges on SCLK, which will cause the peripherals to clock in one or two false data bits. This causes the peripherals to lose sync and they will drop off the bus, as required by the SoundWire specification. It will take at least 17 frames for the peripherals to regain sync, and they are likely to need re-enumeration. But the core SoundWire code was told that this is an exit from clock stop 0, and unattach_request is not set, so the core code and the drivers are expecting to be able to talk to the peripherals immediately. This will cause read/write errors.
This is quite likely to occur when there are different types of peripheral on the links. For example, a headphone codec on one link and amplifiers on another link. While audio is playing to the headphones the amplifiers can runtime-suspend and the link can clock stop. This leaves one link (amps) stopped and the other (headphones) still active, creating the situation where resuming the amps would skip the bus reset because the active headphone link stops the audio controller from fully powering down.
On Lunarlake the links can power-down independently. So this shortcut situation does not occur and a bus reset was always sent when the link powers-up.
Fixes: 08abad9 ("soundwire: intel: refine runtime pm for SDW_INTEL_CLK_STOP_BUS_RESET")
Closes: #5495