ASoC: SOF: core: unregister clients and machine drivers in .shutdown
Subsystems (3)
Kai Vehmanen
reviewerPATCH v2 1/1 ASoC: SOF: core: unregister clients and machine drivers in .shutdown
From: Pierre-Louis Bossart <[email protected]>
On a platform shutdown, the expectation for most drivers is that userspace tasks will release all resources. When those sequences do not complete, it can be the case that PCM devices exposed by ALSA cards are used *after* the DSP shutdown completes, leading to a platform hang.
When the clients and machine drivers provide an _unregister callback, let's invoke it in the shutdown sequence.
--- sound/soc/sof/core.c | 9 +++++++++ 1 file changed, 9 insertions(+)
V1->V2:
- correct patch title to have "ASoC: SOF: " prefix (reported by Amadeusz)
sound/soc/sof/core.c +9 -0
@@ -463,10 +463,19 @@ EXPORT_SYMBOL(snd_sof_device_remove);int snd_sof_device_shutdown (struct device *dev) {struct snd_sof_dev *sdev =dev_get_drvdata (dev); +struct snd_sof_pdata *pdata = sdev->pdata;if (IS_ENABLED (CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE ))cancel_work_sync (&sdev->probe_work); +/* +* make sure clients and machine driver(s) are unregistered to force +* all userspace devices to be closed prior to the DSP shutdown sequence +*/ +sof_unregister_clients (sdev); + +snd_sof_machine_unregister (sdev, pdata); +if (sdev->fw_state ==SOF_FW_BOOT_COMPLETE )return snd_sof_shutdown (sdev);
base-commit: f7d344a2bd5ec81fbd1ce76928fd059e57ec9bea
Signature · 1 line
2.35.1
Quoted 10 lines · Kai Vehmanen
From: Pierre-Louis Bossart <[email protected]>
On a platform shutdown, the expectation for most drivers is that userspace tasks will release all resources. When those sequences do not complete, it can be the case that PCM devices exposed by ALSA cards are used *after* the DSP shutdown completes, leading to a platform hang.
When the clients and machine drivers provide an
_unregistercallback, let's invoke it in the shutdown sequence.
Github lost my Reviewed-by...
Quoted 38 lines
Signed-off-by Pierre-Louis Bossart <[email protected]>Reviewed-by Kai Vehmanen <[email protected]>Reviewed-by Ranjani Sridharan <[email protected]>Signed-off-by Kai Vehmanen <[email protected]>--- sound/soc/sof/core.c | 9 +++++++++ 1 file changed, 9 insertions(+)
V1->V2:
- correct patch title to have "ASoC: SOF: " prefix (reported by Amadeusz)sound/soc/sof/core.c +9
-0@@ -463,10 +463,19 @@ EXPORT_SYMBOL(snd_sof_device_remove);int snd_sof_device_shutdown (struct device *dev) {struct snd_sof_dev *sdev =dev_get_drvdata (dev); +struct snd_sof_pdata *pdata = sdev->pdata;if (IS_ENABLED (CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE ))cancel_work_sync (&sdev->probe_work); +/* +* make sure clients and machine driver(s) are unregistered to force +* all userspace devices to be closed prior to the DSP shutdown sequence +*/ +sof_unregister_clients (sdev); + +snd_sof_machine_unregister (sdev, pdata); +if (sdev->fw_state ==SOF_FW_BOOT_COMPLETE )return snd_sof_shutdown (sdev);base-commit:
f7d344a2bd5ec81fbd1ce76928fd059e57ec9bea
Signature · 1 line
Péter
Mark Brown
maintainerQuoted 9 lines · Kai Vehmanen
From: Pierre-Louis Bossart <[email protected]>
On a platform shutdown, the expectation for most drivers is that userspace tasks will release all resources. When those sequences do not complete, it can be the case that PCM devices exposed by ALSA cards are used *after* the DSP shutdown completes, leading to a platform hang.
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: SOF: core: unregister clients and machine drivers in .shutdown
commit: 83bfc7e793b555291785136c3ae86abcdc046887
All 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