* [PATCH] ASoC: mediatek: mt8196: Ensure the DAI is marked as started on success
@ 2026-10-20 5:27 phucduc.bui
2026-11-02 22:59 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: phucduc.bui @ 2026-10-20 5:27 UTC (permalink / raw)
To: Mark Brown, AngeloGioacchino Del Regno
Cc: Liam Girdwood, Matthias Brugger, Jaroslav Kysela, Takashi Iwai,
cassiogabrielcontato, Mukesh Ojha, Liviu Dudau, Cyril Chao,
Darren Ye, linux-sound, linux-arm-kernel, linux-mediatek,
linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
snd_pcm_hw_constraint_integer() may return 1, which is then returned
from mt8196_fe_startup(). ASoC only treats 0 as success when marking
the DAI as started, so .shutdown() can be skipped on rollback.
Propagate constraint errors and return 0 explicitly on success.
Fixes: 57513aabfe5b ("ASoC: mediatek: mt8196: add platform driver")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
sound/soc/mediatek/mt8196/mt8196-afe-pcm.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/sound/soc/mediatek/mt8196/mt8196-afe-pcm.c b/sound/soc/mediatek/mt8196/mt8196-afe-pcm.c
index fbeba01b086c..f69ea22cfabb 100644
--- a/sound/soc/mediatek/mt8196/mt8196-afe-pcm.c
+++ b/sound/soc/mediatek/mt8196/mt8196-afe-pcm.c
@@ -161,8 +161,10 @@ static int mt8196_fe_startup(struct snd_pcm_substream *substream,
ret = snd_pcm_hw_constraint_integer(runtime,
SNDRV_PCM_HW_PARAM_PERIODS);
- if (ret < 0)
- dev_warn(afe->dev, "snd_pcm_hw_constraint_integer failed\n");
+ if (ret < 0) {
+ dev_err(afe->dev, "snd_pcm_hw_constraint_integer failed\n");
+ return ret;
+ }
/* dynamic allocate irq to memif */
if (memif->irq_usage < 0) {
@@ -173,10 +175,16 @@ static int mt8196_fe_startup(struct snd_pcm_substream *substream,
memif->irq_usage = irq_id;
} else {
dev_err(afe->dev, "no more asys irq\n");
- ret = -EBUSY;
+ return -EBUSY;
}
}
- return ret;
+
+ /*
+ * ASoC only marks the DAI as started when .startup() returns 0.
+ * Since snd_pcm_hw_constraint_integer() may return 1, explicitly
+ * return 0 to ensure .shutdown() is not skipped on rollback.
+ */
+ return 0;
}
static void mt8196_fe_shutdown(struct snd_pcm_substream *substream,
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: mediatek: mt8196: Ensure the DAI is marked as started on success
2026-10-20 5:27 [PATCH] ASoC: mediatek: mt8196: Ensure the DAI is marked as started on success phucduc.bui
@ 2026-11-02 22:59 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-11-02 22:59 UTC (permalink / raw)
To: AngeloGioacchino Del Regno, phucduc.bui
Cc: Liam Girdwood, Matthias Brugger, Jaroslav Kysela, Takashi Iwai,
cassiogabrielcontato, Mukesh Ojha, Liviu Dudau, Cyril Chao,
Darren Ye, linux-sound, linux-arm-kernel, linux-mediatek,
linux-kernel
On Tue, 20 Oct 2026 12:27:47 +0700, phucduc.bui@gmail.com wrote:
> ASoC: mediatek: mt8196: Ensure the DAI is marked as started on success
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.5
Thanks!
[1/1] ASoC: mediatek: mt8196: Ensure the DAI is marked as started on success
https://git.kernel.org/broonie/sound/c/e672cfa10dbc
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] 2+ messages in thread
end of thread, other threads:[~2026-11-03 17:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-20 5:27 [PATCH] ASoC: mediatek: mt8196: Ensure the DAI is marked as started on success phucduc.bui
2026-11-02 22:59 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox