aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Trimmer <simont@opensource.cirrus.com>2023-05-12 15:42:37 +0100
committerMark Brown <broonie@kernel.org>2023-05-15 10:35:12 +0900
commit17082e09b94cfe60bf39088f3d37c1f10e6c5928 (patch)
tree05daaa76ff5455a355258ae381ce92172409c9ee
parent41c5305cc3d827d2ea686533777a285176ae01a0 (diff)
downloadlinux-17082e09b94cfe60bf39088f3d37c1f10e6c5928.tar.gz
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 <simont@opensource.cirrus.com Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com Link: https://lore.kernel.org/r/20230512144237.739000-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org
-rw-r--r--sound/soc/codecs/cs35l56.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/codecs/cs35l56.c b/sound/soc/codecs/cs35l56.c
index 46762f7f1449f2..d1677d76d01888 100644
--- a/sound/soc/codecs/cs35l56.c
+++ b/sound/soc/codecs/cs35l56.c
@@ -852,10 +852,11 @@ static void cs35l56_dsp_work(struct work_struct *work)
*/
if (cs35l56->sdw_peripheral) {
cs35l56->sdw_irq_no_unmask = true;
- cancel_work_sync(&cs35l56->sdw_irq_work);
+ flush_work(&cs35l56->sdw_irq_work);
sdw_write_no_pm(cs35l56->sdw_peripheral, CS35L56_SDW_GEN_INT_MASK_1, 0);
sdw_read_no_pm(cs35l56->sdw_peripheral, CS35L56_SDW_GEN_INT_STAT_1);
sdw_write_no_pm(cs35l56->sdw_peripheral, CS35L56_SDW_GEN_INT_STAT_1, 0xFF);
+ flush_work(&cs35l56->sdw_irq_work);
}
ret = cs35l56_mbox_send(cs35l56, CS35L56_MBOX_CMD_SHUTDOWN);