]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
ASoC: rt711-sdw: use cancel_work_sync() for .remove
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Thu, 4 Feb 2021 20:17:37 +0000 (14:17 -0600)
committerMark Brown <broonie@kernel.org>
Fri, 5 Feb 2021 13:13:20 +0000 (13:13 +0000)
Make sure the workqueues are not running after the .remove() callback,
which can lead to timeout errors.

A previous fix to use cancel_work_sync was applied for the suspend
case but the remove case is missing

Fixes: 501ef013390b ('ASoC: rt711: wait for the delayed work to finish when the system suspends')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Link: https://lore.kernel.org/r/20210204201739.25206-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt711-sdw.c

index fc7df79c3b9189d5a8d2a5b116cbb6f2c3940035..308e625648412407b9aa078390684846716e178f 100644 (file)
@@ -463,8 +463,8 @@ static int rt711_sdw_remove(struct sdw_slave *slave)
        struct rt711_priv *rt711 = dev_get_drvdata(&slave->dev);
 
        if (rt711 && rt711->hw_init) {
-               cancel_delayed_work(&rt711->jack_detect_work);
-               cancel_delayed_work(&rt711->jack_btn_check_work);
+               cancel_delayed_work_sync(&rt711->jack_detect_work);
+               cancel_delayed_work_sync(&rt711->jack_btn_check_work);
                cancel_work_sync(&rt711->calibration_work);
        }