ASoC: codecs: Realtek/SoundWire: fix remove/suspend issues
Subsystems (3)
cover ASoC: codecs: Realtek/SoundWire: fix remove/suspend issues
These issues and fixes were identified during our module load/unload and suspend/resume stress tests.
Bard Liao (1):
ASoC: rt5682: do nothing in rt5682_suspend/resume in sdw mode
Pierre-Louis Bossart (3):
ASoC: rt700-sdw: use cancel_work_sync() in .remove as well as .suspend
ASoC: rt711-sdw: use cancel_work_sync() for .remove
ASoC: rt5682-sdw: cancel_work_sync() in .remove and .suspend
sound/soc/codecs/rt5682-sdw.c | 4 +++- sound/soc/codecs/rt5682.c | 6 ++++++ sound/soc/codecs/rt700-sdw.c | 4 ++-- sound/soc/codecs/rt711-sdw.c | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/4 ASoC: rt700-sdw: use cancel_work_sync() in .remove as well as .suspend
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
--- sound/soc/codecs/rt700-sdw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/rt700-sdw.c +2 -2
@@ -462,8 +462,8 @@ static int rt700_sdw_remove(struct sdw_slave *slave)struct rt700_priv *rt700 =dev_get_drvdata (&slave->dev);if (rt700 && rt700->hw_init) { -cancel_delayed_work (&rt700->jack_detect_work); -cancel_delayed_work (&rt700->jack_btn_check_work); +cancel_delayed_work_sync (&rt700->jack_detect_work); +cancel_delayed_work_sync (&rt700->jack_btn_check_work); }return 0 ;
Signature · 1 line
2.25.1
PATCH 2/4 ASoC: rt711-sdw: use cancel_work_sync() for .remove
In reply to Pierre-Louis BossartMake 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
--- sound/soc/codecs/rt711-sdw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/rt711-sdw.c +2 -2
@@ -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); }
Signature · 1 line
2.25.1
PATCH 3/4 ASoC: rt5682-sdw: cancel_work_sync() in .remove and .suspend
In reply to Pierre-Louis BossartFollow pattern from other drivers and use cancel_work_sync() for both .remove() and .suspend().
--- sound/soc/codecs/rt5682-sdw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/codecs/rt5682-sdw.c +3 -1
@@ -710,7 +710,7 @@ static int rt5682_sdw_remove(struct sdw_slave *slave)struct rt5682_priv *rt5682 =dev_get_drvdata (&slave->dev);if (rt5682 && rt5682->hw_init) -cancel_delayed_work (&rt5682->jack_detect_work); +cancel_delayed_work_sync (&rt5682->jack_detect_work);return 0 ; }
@@ -728,6 +728,8 @@ static int __maybe_unused rt5682_dev_suspend(struct device *dev)if (!rt5682->hw_init)return 0 ; +cancel_delayed_work_sync (&rt5682->jack_detect_work); +regcache_cache_only (rt5682->regmap, true);regcache_mark_dirty (rt5682->regmap);
Signature · 1 line
2.25.1
PATCH 4/4 ASoC: rt5682: do nothing in rt5682_suspend/resume in sdw mode
In reply to Pierre-Louis BossartFrom: Bard Liao <[email protected]>
regcache sync will be done in sdw device suspend/resume functions. And we have different jack detection mechanism for SoundWire.
--- sound/soc/codecs/rt5682.c | 6 ++++++ 1 file changed, 6 insertions(+)
sound/soc/codecs/rt5682.c +6 -0
@@ -2910,6 +2910,9 @@ static int rt5682_suspend(struct snd_soc_component *component) {struct rt5682_priv *rt5682 =snd_soc_component_get_drvdata (component); +if (rt5682->is_sdw) +return 0 ; +regcache_cache_only (rt5682->regmap, true);regcache_mark_dirty (rt5682->regmap);return 0 ;
@@ -2919,6 +2922,9 @@ static int rt5682_resume(struct snd_soc_component *component) {struct rt5682_priv *rt5682 =snd_soc_component_get_drvdata (component); +if (rt5682->is_sdw) +return 0 ; +regcache_cache_only (rt5682->regmap, false);regcache_sync (rt5682->regmap);
Signature · 1 line
2.25.1
Mark Brown
maintainerQuoted 6 lines · Pierre-Louis Bossart
These issues and fixes were identified during our module load/unload and suspend/resume stress tests.
Bard Liao (1):
ASoC: rt5682: do nothing in rt5682_suspend/resume in sdw mode
Quoted 6 lines
Pierre-Louis Bossart (3):
ASoC: rt700-sdw: usecancel_work_sync()in .remove as well as .suspend
ASoC: rt711-sdw: usecancel_work_sync()for .remove
ASoC: rt5682-sdw:cancel_work_sync()in .remove and .suspend[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/4] ASoC: rt700-sdw: use cancel_work_sync() in .remove as well as .suspend
commit: 737ee8bdf682cedb3c42b713d20ffa5c899591fb
[2/4] ASoC: rt711-sdw: use cancel_work_sync() for .remove
commit: 121871a75ae4032cf5e506ba5159761805709def
[3/4] ASoC: rt5682-sdw: cancel_work_sync() in .remove and .suspend
commit: c792c3690b82c8d26c01494a51ebf66d9cae7e72
[4/4] ASoC: rt5682: do nothing in rt5682_suspend/resume in sdw mode
commit: 30fd8f65af78d0ac0859cf436beed14834b39802All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark