* [PATCH] ASoC: SOF: sof-audio: Skip unprepare for in-use widgets on error rollback
@ 2024-06-03 7:26 Peter Ujfalusi
0 siblings, 0 replies; 3+ messages in thread
From: Peter Ujfalusi @ 2024-06-03 7:26 UTC (permalink / raw)
To: lgirdwood, broonie
Cc: linux-sound, pierre-louis.bossart, kai.vehmanen,
ranjani.sridharan
If the ipc_prepare() callback fails for a module instance, on error rewind
we must skip the ipc_unprepare() call for ones that has positive use count.
The positive use count means that the module instance is in active use, it
cannot be unprepared.
The issue affects capture direction paths with branches (single dai with
multiple PCMs), the affected widgets are in the shared part of the paths.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
sound/soc/sof/sof-audio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/sof/sof-audio.c b/sound/soc/sof/sof-audio.c
index b3ac040811e7..ef9318947d74 100644
--- a/sound/soc/sof/sof-audio.c
+++ b/sound/soc/sof/sof-audio.c
@@ -485,7 +485,7 @@ sof_prepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget
if (ret < 0) {
/* unprepare the source widget */
if (widget_ops[widget->id].ipc_unprepare &&
- swidget && swidget->prepared) {
+ swidget && swidget->prepared && swidget->use_count == 0) {
widget_ops[widget->id].ipc_unprepare(swidget);
swidget->prepared = false;
}
--
2.45.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] ASoC: SOF: sof-audio: Skip unprepare for in-use widgets on error rollback
@ 2024-06-12 12:12 Peter Ujfalusi
2024-06-13 8:42 ` Mark Brown
0 siblings, 1 reply; 3+ messages in thread
From: Peter Ujfalusi @ 2024-06-12 12:12 UTC (permalink / raw)
To: lgirdwood, broonie
Cc: linux-sound, pierre-louis.bossart, kai.vehmanen,
ranjani.sridharan
If the ipc_prepare() callback fails for a module instance, on error rewind
we must skip the ipc_unprepare() call for ones that has positive use count.
The positive use count means that the module instance is in active use, it
cannot be unprepared.
The issue affects capture direction paths with branches (single dai with
multiple PCMs), the affected widgets are in the shared part of the paths.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
sound/soc/sof/sof-audio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/sof/sof-audio.c b/sound/soc/sof/sof-audio.c
index 881eec38c2e2..9a52781bf8d8 100644
--- a/sound/soc/sof/sof-audio.c
+++ b/sound/soc/sof/sof-audio.c
@@ -485,7 +485,7 @@ sof_prepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget
if (ret < 0) {
/* unprepare the source widget */
if (widget_ops[widget->id].ipc_unprepare &&
- swidget && swidget->prepared) {
+ swidget && swidget->prepared && swidget->use_count == 0) {
widget_ops[widget->id].ipc_unprepare(swidget);
swidget->prepared = false;
}
--
2.45.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: SOF: sof-audio: Skip unprepare for in-use widgets on error rollback
2024-06-12 12:12 Peter Ujfalusi
@ 2024-06-13 8:42 ` Mark Brown
0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2024-06-13 8:42 UTC (permalink / raw)
To: lgirdwood, Peter Ujfalusi
Cc: linux-sound, pierre-louis.bossart, kai.vehmanen,
ranjani.sridharan
On Wed, 12 Jun 2024 15:12:03 +0300, Peter Ujfalusi wrote:
> If the ipc_prepare() callback fails for a module instance, on error rewind
> we must skip the ipc_unprepare() call for ones that has positive use count.
>
> The positive use count means that the module instance is in active use, it
> cannot be unprepared.
>
> The issue affects capture direction paths with branches (single dai with
> multiple PCMs), the affected widgets are in the shared part of the paths.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: SOF: sof-audio: Skip unprepare for in-use widgets on error rollback
commit: 6f2a43e3d14f6e31a3b041a1043195d02c54d615
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-06-13 8:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-03 7:26 [PATCH] ASoC: SOF: sof-audio: Skip unprepare for in-use widgets on error rollback Peter Ujfalusi
-- strict thread matches above, loose matches on Subject: below --
2024-06-12 12:12 Peter Ujfalusi
2024-06-13 8:42 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox