From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
To: lgirdwood@gmail.com, broonie@kernel.org
Cc: alsa-devel@alsa-project.org, kai.vehmanen@linux.intel.com,
pierre-louis.bossart@linux.intel.com, rander.wang@intel.com,
ranjani.sridharan@linux.intel.com,
yung-chuan.liao@linux.intel.com,
angelogioacchino.delregno@collabora.com
Subject: [PATCH v2 2/3] ASoC: SOF: sof-audio: skip prepare/unprepare if swidget is NULL
Date: Mon, 16 Jan 2023 14:55:05 +0200 [thread overview]
Message-ID: <20230116125506.27989-3-peter.ujfalusi@linux.intel.com> (raw)
In-Reply-To: <20230116125506.27989-1-peter.ujfalusi@linux.intel.com>
From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Skip preparing/unpreparing widgets if the swidget pointer is NULL. This
will be true in the case of virtual widgets in topology that were added
for reusing the legacy HDA machine driver with SOF.
Fixes: 9862dcf70245 ("ASoC: SOF: don't unprepare widget used other pipelines")
Cc: <stable@vger.kernel.org> # 6.1
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
---
sound/soc/sof/sof-audio.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/sof/sof-audio.c b/sound/soc/sof/sof-audio.c
index 068501ed7951..739afb8df590 100644
--- a/sound/soc/sof/sof-audio.c
+++ b/sound/soc/sof/sof-audio.c
@@ -274,7 +274,7 @@ sof_unprepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widg
struct snd_soc_dapm_path *p;
/* return if the widget is in use or if it is already unprepared */
- if (!swidget->prepared || swidget->use_count > 0)
+ if (!swidget || !swidget->prepared || swidget->use_count > 0)
return;
widget_ops = tplg_ops ? tplg_ops->widget : NULL;
@@ -310,7 +310,7 @@ sof_prepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget
if (!widget_ops)
return 0;
- if (!widget_ops[widget->id].ipc_prepare || swidget->prepared)
+ if (!swidget || !widget_ops[widget->id].ipc_prepare || swidget->prepared)
goto sink_prepare;
/* prepare the source widget */
--
2.39.0
next prev parent reply other threads:[~2023-01-16 12:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-16 12:55 [PATCH v2 0/3] ASoC: SOF: sof-audio: Fixes for widget prepare and unprepare Peter Ujfalusi
2023-01-16 12:55 ` [PATCH v2 1/3] ASoC: SOF: sof-audio: Unprepare when swidget->use_count > 0 Peter Ujfalusi
2023-01-16 12:55 ` Peter Ujfalusi [this message]
2023-01-17 12:44 ` [PATCH v2 2/3] ASoC: SOF: sof-audio: skip prepare/unprepare if swidget is NULL AngeloGioacchino Del Regno
2023-01-16 12:55 ` [PATCH v2 3/3] ASoC: SOF: sof-audio: keep prepare/unprepare widgets in sink path Peter Ujfalusi
2023-01-17 13:16 ` [PATCH v2 0/3] ASoC: SOF: sof-audio: Fixes for widget prepare and unprepare Mark Brown
2023-01-17 13:48 ` Péter Ujfalusi
2023-01-17 14:05 ` Péter Ujfalusi
2023-01-17 14:18 ` Mark Brown
2023-01-17 14:30 ` Péter Ujfalusi
2023-01-17 15:21 ` Mark Brown
2023-01-18 15:46 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230116125506.27989-3-peter.ujfalusi@linux.intel.com \
--to=peter.ujfalusi@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=broonie@kernel.org \
--cc=kai.vehmanen@linux.intel.com \
--cc=lgirdwood@gmail.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=rander.wang@intel.com \
--cc=ranjani.sridharan@linux.intel.com \
--cc=yung-chuan.liao@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox