Skip to content

Commit 17082e0

Browse files
simontrimmerbroonie
authored andcommitted
ASoC: cs35l56: Prevent unbalanced pm_runtime in dsp_work() on SoundWire
Flush the SoundWire interrupt handler work instead of cancelling it. When a SoundWire interrupt is triggered the pm_runtime is held until the work has completed. It's therefore unsafe to cancel the work, it must be flushed. Signed-off-by: Simon Trimmer <[email protected] Signed-off-by: Richard Fitzgerald <[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]
1 parent 41c5305 commit 17082e0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sound/soc/codecs/cs35l56.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,10 +852,11 @@ static void cs35l56_dsp_work(struct work_struct *work)
852852
*/
853853
if (cs35l56->sdw_peripheral) {
854854
cs35l56->sdw_irq_no_unmask = true;
855-
cancel_work_sync(&cs35l56->sdw_irq_work);
855+
flush_work(&cs35l56->sdw_irq_work);
856856
sdw_write_no_pm(cs35l56->sdw_peripheral, CS35L56_SDW_GEN_INT_MASK_1, 0);
857857
sdw_read_no_pm(cs35l56->sdw_peripheral, CS35L56_SDW_GEN_INT_STAT_1);
858858
sdw_write_no_pm(cs35l56->sdw_peripheral, CS35L56_SDW_GEN_INT_STAT_1, 0xFF);
859+
flush_work(&cs35l56->sdw_irq_work);
859860
}
860861

861862
ret = cs35l56_mbox_send(cs35l56, CS35L56_MBOX_CMD_SHUTDOWN);

0 commit comments

Comments
 (0)