soundwire: cadence_master: wait and cancel cdns->work before clock stop
Changes
1 files changed · +7 −0
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| drivers/soundwire/cadence_master.c | modified | +7 | −0 | View file |
drivers/soundwire/cadence_master.c
View filediff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c
index e690237..a0a63b7 100644
--- a/drivers/soundwire/cadence_master.c
+++ b/drivers/soundwire/cadence_master.c
@@ -1702,6 +1702,13 @@ int sdw_cdns_clock_stop(struct sdw_cdns *cdns, bool block_wake)
}
/*
+ * wait for any in-flight peripheral event handling to complete before stopping the clock.
+ * No need to disable peripheral interrupts before canceling the work, as the peripheral
+ * interrupts are already masked before the work is scheduled.
+ */
+ cancel_work_sync(&cdns->work);
+
+ /*
* Before entering clock stop we mask the Slave
* interrupts. This helps avoid having to deal with e.g. a
* Slave becoming UNATTACHED while the clock is being stopped