linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] soundwire: only use CLOCK_STOP_MODE0 and handle -ENODATA
@ 2021-04-19  5:26 Bard Liao
  2021-04-19  5:27 ` [PATCH 1/4] soundwire: bus: only use CLOCK_STOP_MODE0 and fix confusions Bard Liao
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Bard Liao @ 2021-04-19  5:26 UTC (permalink / raw)
  To: alsa-devel, vkoul
  Cc: vinod.koul, linux-kernel, gregkh, srinivas.kandagatla,
	rander.wang, hui.wang, pierre-louis.bossart, sanyog.r.kale,
	bard.liao

Existing devices and implementations only support the required
CLOCK_STOP_MODE0. All the code related to CLOCK_STOP_MODE1 has not
been tested and is highly questionable, with a clear confusion between
CLOCK_STOP_MODE1 and the simple clock stop state machine.

This patch removes all usages of CLOCK_STOP_MODE1 - which has no
impact on any solution - and fixes the use of the simple clock stop
state machine. The resulting code should be a lot more symmetrical and
easier to maintain.

Note that CLOCK_STOP_MODE1 is not supported in the SoundWire Device
Class specification so it's rather unlikely that we need to re-add
this mode later.

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.

Pierre-Louis Bossart (4):
  soundwire: bus: only use CLOCK_STOP_MODE0 and fix confusions
  soundwire: add missing kernel-doc description
  soundwire: bus: handle -ENODATA errors in clock stop/start sequences
  soundwire: bus: add missing \n in dynamic debug

 drivers/soundwire/bus.c       | 155 +++++++++++++++-------------------
 include/linux/soundwire/sdw.h |   3 +-
 2 files changed, 70 insertions(+), 88 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-04-19  5:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-19  5:26 [PATCH 0/4] soundwire: only use CLOCK_STOP_MODE0 and handle -ENODATA Bard Liao
2021-04-19  5:27 ` [PATCH 1/4] soundwire: bus: only use CLOCK_STOP_MODE0 and fix confusions Bard Liao
2021-04-19  5:27 ` [PATCH 2/4] soundwire: add missing kernel-doc description Bard Liao
2021-04-19  5:27 ` [PATCH 3/4] soundwire: bus: handle -ENODATA errors in clock stop/start sequences Bard Liao
2021-04-19  5:27 ` [PATCH 4/4] soundwire: bus: add missing \n in dynamic debug Bard Liao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).