[PATCH] soundwire: qcom: wait for the interrupt thread before gating the clock
From: Oleg Keri
Date: Wed Oct 07 2026 - 15:38:11 EST
A broadcast write returns as soon as the interrupt thread signals
SPECIAL_CMD_ID_FINISHED, while the thread still has to clear and re-read
the interrupt status. swrm_runtime_suspend() gates hclk right after the
ClockStopNow broadcast, so those accesses race against the clock being
removed; on x1e80100 and glymur hclk is the SoundWire clock itself. The
next clock-stop exit then fails at random: bus clash, parity errors
reported by the peripherals or AUTO_ENUM_FAILED, each leaving one side of
the speakers detached until reboot.
Wait for the interrupt thread to finish before gating the clock.
Fixes: 74e79da9fd46 ("soundwire: qcom: add runtime pm support")
Signed-off-by: Oleg Keri <okerixx@xxxxxxxxx>
---
drivers/soundwire/qcom.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index 6e0c5fb10efa..76f940f4eb31 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -1887,6 +1887,7 @@ static int __maybe_unused swrm_runtime_suspend(struct device *dev)
}
}
+ synchronize_irq(ctrl->irq);
clk_disable_unprepare(ctrl->hclk);
usleep_range(300, 305);
--
2.55.0