From: Cezary Rojewski <cezary.rojewski@intel.com>
To: broonie@kernel.org, linux-sound@vger.kernel.org
Cc: tiwai@suse.com, perex@perex.cz, amade@asmblr.net,
linux-kernel@vger.kernel.org,
Cezary Rojewski <cezary.rojewski@intel.com>
Subject: [PATCH 02/11] ASoC: Intel: avs: Do not skip errors from avs_path_pause()
Date: Fri, 13 Nov 2026 12:38:31 +0100 [thread overview]
Message-ID: <20261113113840.3067489-3-cezary.rojewski@intel.com> (raw)
In-Reply-To: <20261113113840.3067489-1-cezary.rojewski@intel.com>
During downward trigger() operation avs_path_pause() occurs before
avs_path_reset(). Only the result of the latter is taken into
consideration whilst the result of pause operation is ignored. Fix that
and make the first error take priority when returning the final result.
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
---
sound/soc/intel/avs/pcm.c | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c
index fd4ab14bfe04..b0796d18c1c4 100644
--- a/sound/soc/intel/avs/pcm.c
+++ b/sound/soc/intel/avs/pcm.c
@@ -271,7 +271,7 @@ static int avs_dai_nonhda_be_trigger(struct snd_pcm_substream *substream, int cm
{
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct avs_dma_data *data;
- int ret = 0;
+ int ret2, ret = 0;
data = snd_soc_dai_get_dma_data(dai, substream);
@@ -303,9 +303,11 @@ static int avs_dai_nonhda_be_trigger(struct snd_pcm_substream *substream, int cm
if (ret < 0)
dev_err(dai->dev, "pause BE path failed: %d\n", ret);
- ret = avs_path_reset(data->path);
- if (ret < 0)
- dev_err(dai->dev, "reset BE path failed: %d\n", ret);
+ ret2 = avs_path_reset(data->path);
+ if (ret2)
+ dev_err(dai->dev, "reset BE path failed: %d\n", ret2);
+ if (ret2 && !ret)
+ ret = ret2;
break;
default:
@@ -492,7 +494,7 @@ static int avs_dai_hda_be_trigger(struct snd_pcm_substream *substream, int cmd,
{
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct avs_dma_data *data;
- int ret = 0;
+ int ret2, ret = 0;
dev_dbg(dai->dev, "entry %s cmd=%d\n", __func__, cmd);
@@ -530,9 +532,11 @@ static int avs_dai_hda_be_trigger(struct snd_pcm_substream *substream, int cmd,
snd_hdac_ext_stream_clear(data->link_stream);
- ret = avs_path_reset(data->path);
- if (ret < 0)
- dev_err(dai->dev, "reset BE path failed: %d\n", ret);
+ ret2 = avs_path_reset(data->path);
+ if (ret2)
+ dev_err(dai->dev, "reset BE path failed: %d\n", ret2);
+ if (ret2 && !ret)
+ ret = ret2;
break;
default:
@@ -868,7 +872,7 @@ static int avs_dai_fe_trigger(struct snd_pcm_substream *substream, int cmd, stru
struct hdac_ext_stream *host_stream;
struct hdac_bus *bus;
unsigned long flags;
- int ret = 0;
+ int ret2, ret = 0;
data = snd_soc_dai_get_dma_data(dai, substream);
host_stream = data->host_stream;
@@ -915,9 +919,11 @@ static int avs_dai_fe_trigger(struct snd_pcm_substream *substream, int cmd, stru
avs_hda_stream_stop(bus, host_stream);
spin_unlock_irqrestore(&bus->reg_lock, flags);
- ret = avs_path_reset(data->path);
- if (ret < 0)
- dev_err(dai->dev, "reset FE path failed: %d\n", ret);
+ ret2 = avs_path_reset(data->path);
+ if (ret2)
+ dev_err(dai->dev, "reset FE path failed: %d\n", ret2);
+ if (ret2 && !ret)
+ ret = ret2;
break;
default:
--
2.34.1
next prev parent reply other threads:[~2026-11-13 11:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 11:38 [PATCH 00/11] ASoC: Intel: avs: Renames and debug prints Cezary Rojewski
2026-11-13 11:38 ` [PATCH 01/11] ASoC: Intel: avs: Do not skip error reporting when an IPC timeouts Cezary Rojewski
2026-11-13 11:38 ` Cezary Rojewski [this message]
2026-11-13 11:38 ` [PATCH 03/11] ASoC: Intel: avs: Have one location for dumping path-errors Cezary Rojewski
2026-11-13 11:38 ` [PATCH 04/11] ASoC: Intel: avs: Small registers cleanup Cezary Rojewski
2026-11-13 11:38 ` [PATCH 05/11] ASoC: Intel: avs: Enrich missing-format and token-parsing messages Cezary Rojewski
2026-11-13 11:38 ` [PATCH 06/11] ASoC: Intel: avs: Unify code style for platform_device_id arrays Cezary Rojewski
2026-11-13 11:38 ` [PATCH 07/11] ASoC: Intel: avs: Streamline topology parser names Cezary Rojewski
2026-11-13 11:38 ` [PATCH 08/11] ASoC: Intel: avs: Streamline wording used for board configs Cezary Rojewski
2026-11-13 11:38 ` [PATCH 09/11] ASoC: Intel: avs: Streamline naming of hw_params variables Cezary Rojewski
2026-11-13 11:38 ` [PATCH 10/11] ASoC: Intel: avs: Streamline spacing used in the avs_ids table Cezary Rojewski
2026-11-13 11:38 ` [PATCH 11/11] ASoC: Intel: avs: Remove soc-acpi-intel-match include Cezary Rojewski
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=20261113113840.3067489-3-cezary.rojewski@intel.com \
--to=cezary.rojewski@intel.com \
--cc=amade@asmblr.net \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.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
all inboxes | Powered by JetHome®