linux/drivers/soundwire
Richard Fitzgerald e1a3cfdbf5 soundwire: cadence: Drain the RX FIFO after an IO timeout
[ Upstream commit 0603a47bd3 ]

If wait_for_completion_timeout() times-out in _cdns_xfer_msg() it
is possible that something could have been written to the RX FIFO.
In this case, we should drain the RX FIFO so that anything in it
doesn't carry over and mess up the next transfer.

Obviously, if we got to this state something went wrong, and we
don't really know the state of everything. The cleanup in this
situation cannot be bullet-proof but we should attempt to avoid
breaking future transaction, if only to reduce the amount of
error noise when debugging the failure from a kernel log.

Note that this patch only implements the draining for blocking
(non-deferred) transfers. The deferred API doesn't have any proper
handling of error conditions and would need some re-design before
implementing cleanup. That is a task for a separate patch...

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221202161812.4186897-4-rf@opensource.cirrus.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-11 13:57:39 +01:00
..
bus_type.c soundwire: bus_type: Avoid lockdep assert in sdw_drv_probe() 2023-03-11 13:57:35 +01:00
bus.c soundwire: revisit driver bind/unbind and callbacks 2022-08-17 14:23:48 +02:00
bus.h
cadence_master.c soundwire: cadence: Drain the RX FIFO after an IO timeout 2023-03-11 13:57:39 +01:00
cadence_master.h soundwire: cadence: Remove wasted space in response_buf 2023-03-11 13:57:39 +01:00
debugfs.c
dmi-quirks.c soundwire: dmi-quirks: add quirk variant for LAPBC710 NUC15 2023-01-12 11:58:44 +01:00
generic_bandwidth_allocation.c
intel_init.c
intel.c ASoC/SoundWire: dai: expand 'stream' concept beyond SoundWire 2023-01-12 11:58:49 +01:00
intel.h
Kconfig
Makefile
master.c
mipi_disco.c
qcom.c ASoC/SoundWire: dai: expand 'stream' concept beyond SoundWire 2023-01-12 11:58:49 +01:00
slave.c soundwire: revisit driver bind/unbind and callbacks 2022-08-17 14:23:48 +02:00
stream.c ASoC/SoundWire: dai: expand 'stream' concept beyond SoundWire 2023-01-12 11:58:49 +01:00
sysfs_local.h
sysfs_slave_dpn.c
sysfs_slave.c