ASoC: mediatek: mt8196: Ensure the DAI is marked as started on success
Subsystems (3)
PATCH 1/1 ASoC: mediatek: mt8196: Ensure the DAI is marked as started on success
From: bui duc phuc <[email protected]>
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.
--- sound/soc/mediatek/mt8196/mt8196-afe-pcm.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
sound/soc/mediatek/mt8196/mt8196-afe-pcm.c +12 -4
@@ -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,
Signature · 1 line
2.43.0
Mark Brown
maintainerQuoted 1 line · On Tue, 20 Oct 2026 12:27:47 +0700, [email protected] 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