diff options
author | Richard Fitzgerald <rf@opensource.cirrus.com> | 2022-09-14 17:02:48 +0100 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2022-09-20 10:29:31 +0530 |
commit | 72124f07f0fab446caeea1f545d8c58b7549a899 (patch) | |
tree | 38fda4d9b2a9485c0014a0977aa4b7b1cdb84ed3 /drivers/tty/serial/21285.c | |
parent | 0c5e99c41504b74dcfa9f3643f55cacab5c1e41f (diff) | |
download | linux-72124f07f0fab446caeea1f545d8c58b7549a899.tar.bz2 |
soundwire: bus: Don't exit early if no device IDs were programmed
Only exit sdw_handle_slave_status() right after calling
sdw_program_device_num() if it actually programmed an ID into at
least one device.
sdw_handle_slave_status() should protect itself against phantom
device #0 ATTACHED indications. In that case there is no actual
device still on #0. The early exit relies on there being a status
change to ATTACHED on the reprogrammed device to trigger another
call to sdw_handle_slave_status() which will then handle the status
of all peripherals. If no device was actually programmed with an
ID there won't be a new ATTACHED indication. This can lead to the
status of other peripherals not being handled.
The status passed to sdw_handle_slave_status() is obviously always
from a point of time in the past, and may indicate accumulated
unhandled events (depending how the bus manager operates). It's
possible that a device ID is reprogrammed but the last PING status
captured state just before that, when it was still reporting on
ID #0. Then sdw_handle_slave_status() is called with this PING info,
just before a new PING status is available showing it now on its new
ID. So sdw_handle_slave_status() will receive a phantom report of a
device on #0, but it will not find one.
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/20220914160248.1047627-6-rf@opensource.cirrus.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/tty/serial/21285.c')
0 files changed, 0 insertions, 0 deletions