]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
soundwire: stream: Poll for DP prepare to avoid interrupt deadlock
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Fri, 27 Feb 2026 11:16:48 +0000 (11:16 +0000)
committerVinod Koul <vkoul@kernel.org>
Mon, 9 Mar 2026 07:02:38 +0000 (08:02 +0100)
commitfee12f3c20dd5902dbd95eb41f80d3fba89336d7
treee68923d5e100b70bb77baecada31674809055fa6
parent27ab4f1e4909a674dfd03058fb9802cae2343a36
soundwire: stream: Poll for DP prepare to avoid interrupt deadlock

Replace the wait_for_completion_timeout() in sdw_prep_deprep_slave_ports()
with a read_poll_timeout().

The original intent of the wait_for_completion_timeout() was to wait for
the port prepare interrupt. But at this time the code is holding the
bus_lock, which prevents the interrupt handler from running. Because of
this, the port_prep completion will not be signaled and the
wait_for_completion_timeout() will always timeout.

Rewriting the code to avoid taking the bus_lock carries risks, and
needs careful consideration of the consequences. It is safer and simpler
to replace the completion with a simple register poll.

As the code is holding the bus_lock, it is already blocking other activity
so consuming control channel bandwidth for polling isn't really a concern.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260227111648.175548-1-rf@opensource.cirrus.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/stream.c