soundwire: bus: handle -ENODATA errors in clock stop/start sequences
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tue, 11 May 2021 03:00:47 +0000 (11:00 +0800)
committerVinod Koul <vkoul@kernel.org>
Tue, 11 May 2021 12:20:32 +0000 (17:50 +0530)
commitb50bb8ba369cdc8814e82558117711c12ef3af3d
tree6972069dc5c8bc9289c318c2fb5d096efb638294
parent448df2d8fcab6cc50e0de4679ce3afe2ece282f2
soundwire: bus: handle -ENODATA errors in clock stop/start sequences

If a device lost sync and can no longer ACK a command, it may not be
able to enter a lower-power state but it will still be able to resync
when the clock restarts. In those cases, we want to continue with the
clock stop sequence.

This patch modifies the behavior during clock stop sequences to only
log errors unrelated to -ENODATA/Command_Ignored. The flow is also
modified so that loops continue to prepare/deprepare other devices
even when one seems to have lost sync.

When resuming the clocks, all issues are logged with a dev_warn(),
previously only some of them were checked. This is the only part that
now differs between the clock stop entry and clock stop exit
sequences: while we don't want to stop the suspend flow, we do want
information on potential issues while resuming, as they may have
ripple effects.

For consistency the log messages are also modified to be unique and
self-explanatory. Errors in sdw_slave_clk_stop_callback() were
removed, they are now handled in the caller.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20210511030048.25622-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/bus.c