summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2026-06-08 13:27:05 +0300
committerMark Brown <broonie@kernel.org>2026-06-11 22:46:48 +0300
commit5677a551f45820ddd69f11559394bb79669271ca (patch)
tree807e2f042468fe4e48d456d260b2592d7df00f9d
parented8676d99fe6a11e9231d70bc4990ad289359765 (diff)
downloadlinux-5677a551f45820ddd69f11559394bb79669271ca.tar.xz
soundwire: Always wait for initialisation of unattached devices
Currently in sdw_slave_wait_for_init() the waiting can be skipped if unattach_request is not set. Doing so was added in [1] likely because the core used to do a complete() on the completion so waiting in the case an unattach hadn't actually happened would block for the full timeout. However patch [2] updated the core to use complete_all() which means that the wait_for_completion() will now simply return if the device is already attached skipping the completion doesn't add much. Additionally, unattach_request is only set if the host initiates a bus reset. However, the host doing a bus reset is not the only reason a device may be unattached from the bus. Other options could include the driver probing before the device enumerates, a sync-loss, or the device itself powering down. Removing the skip using unattached_request, doesn't cost much in terms of efficiency and allows the sdw_slave_wait_for_init() helper to be used outside of runtime resume. [1] b2bd75f806c4 ("soundwire: sdw_slave: track unattach_request to handle all init sequences") [2] c40d6b3249b1 ("soundwire: fix enumeration completion") Acked-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20260608102714.2503120-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/soundwire/bus.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
index ea3a24f805c0..b7bdf19ebb42 100644
--- a/drivers/soundwire/bus.c
+++ b/drivers/soundwire/bus.c
@@ -1386,9 +1386,6 @@ int sdw_slave_wait_for_init(struct sdw_slave *slave, int timeout_ms)
{
unsigned long time;
- if (!slave->unattach_request)
- return 0;
-
time = wait_for_completion_timeout(&slave->initialization_complete,
msecs_to_jiffies(timeout_ms));
if (!time) {