From: sashiko-bot@kernel.org
To: phucduc.bui@gmail.com
Cc: imx@lists.linux.dev, Frank.Li@kernel.org,
wsa+renesas@sang-engineering.com
Subject: Re: [PATCH v2 18/25] ASoC: imx-pcm-rpmsg: Fix imx_rpmsg_pcm_close() being skipped on rollback
Date: Fri, 16 Oct 2026 04:14:27 +0000 [thread overview]
Message-ID: <sashiko-outbox-173747@kernel.org> (raw)
In-Reply-To: <20261015014324.5569-19-phucduc.bui@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] ASoC: fsl: rpmsg: remote state leak on hw_constraint error
--
commit e67c435f012ba584c1ab6a6bd485da78b988ac05
Author: bui duc phuc <phucduc.bui@gmail.com>
ASoC: imx-pcm-rpmsg: Fix imx_rpmsg_pcm_close() being skipped on rollback
This commit fixes an issue where the close callback was being skipped
when snd_pcm_hw_constraint_integer() returned a positive value. It ensures
the component is properly marked as opened by explicitly returning 0 on success.
> diff --git a/sound/soc/fsl/imx-pcm-rpmsg.c b/sound/soc/fsl/imx-pcm-rpmsg.c
> index 7086fb7fc1eba..85b7c929a28a4 100644
> --- a/sound/soc/fsl/imx-pcm-rpmsg.c
> +++ b/sound/soc/fsl/imx-pcm-rpmsg.c
> @@ -269,7 +269,13 @@ static int imx_rpmsg_pcm_open(struct snd_soc_component *component,
> info->stream_timer[substream->stream].substream = substream;
> timer_setup(&info->stream_timer[substream->stream].timer,
> imx_rpmsg_timer_callback, 0);
> - return ret;
> +
> + /*
> + * ASoC only marks the component as opened when .open() returns 0.
> + * Since snd_pcm_hw_constraint_integer() may return 1, explicitly
> + * return 0 to ensure .close() is not skipped on rollback.
> + */
> + return 0;
> }
[Severity: Medium]
If snd_pcm_hw_constraint_integer() returns an error, can this still leave the
remote DSP in a leaked state?
Earlier in imx_rpmsg_pcm_open(), an open message is successfully sent to the
remote DSP:
sound/soc/fsl/imx-pcm-rpmsg.c:imx_rpmsg_pcm_open() {
...
info->send_message(msg, info);
...
ret = snd_pcm_hw_constraint_integer(substream->runtime,
SNDRV_PCM_HW_PARAM_PERIODS);
if (ret < 0)
return ret;
...
}
Because returning a negative error code prevents ASoC from marking the
component as opened, snd_soc_component_close() will skip calling the close
callback on error rollback.
Does the driver need to manually send a close message before returning the
error, or is there another way to ensure the remote DSP state is cleaned up
on this failure path?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261015014324.5569-1-phucduc.bui@gmail.com?part=18
next prev parent reply other threads:[~2026-10-16 4:14 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 1:42 [PATCH v2 00/25] ASoC: Fix constraint return value handling phucduc.bui
2026-10-15 1:42 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 01/25] ASoC: amd: acp: Fix .close() being skipped on rollback phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-16 4:19 ` sashiko-bot
2026-10-16 7:40 ` Bui Duc Phuc
2026-10-15 1:43 ` [PATCH v2 02/25] ASoC: amd: ps: Fix acp63_pdm_dma_close() " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 03/25] ASoC: amd: ps: Fix acp63_sdw_dma_close() " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 04/25] ASoC: amd: raven: Fix acp3x_dma_close() " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-16 4:14 ` sashiko-bot
2026-10-15 1:43 ` [PATCH v2 05/25] ASoC: amd: renoir: Fix acp_pdm_dma_close() " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 06/25] ASoC: amd: vangogh: Fix acp5x_dma_close() " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 07/25] ASoC: amd: yc: Fix acp6x_pdm_dma_close() " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 08/25] ASoC: apple: mca: Ensure the DAI is marked as started on success phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 09/25] ASoC: atmel: atmel-pcm-pdc: Fix atmel_pcm_close() being skipped on rollback phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-16 4:16 ` sashiko-bot
2026-10-15 1:43 ` [PATCH v2 10/25] ASoC: codecs: cs42l42: Ensure the DAI is marked as started on success phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 11/25] ASoC: codecs: nau8325: " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 12/25] ASoC: codecs: nau8540: " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 13/25] ASoC: codecs: nau8821: " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 14/25] ASoC: codecs: nau8824: " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 15/25] ASoC: codecs: nau8825: " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 16/25] ASoC: codecs: wm8580: " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 17/25] ASoC: codecs: wm8782: " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 18/25] ASoC: imx-pcm-rpmsg: Fix imx_rpmsg_pcm_close() being skipped on rollback phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-16 4:14 ` sashiko-bot [this message]
2026-10-15 1:43 ` [PATCH v2 19/25] ASoC: intel: atom: Fix .shutdown() " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 10:44 ` Cezary Rojewski
2026-10-15 10:44 ` Cezary Rojewski
2026-10-16 4:12 ` sashiko-bot
2026-10-15 1:43 ` [PATCH v2 20/25] ASoC: renesas: fsi: Ensure the component is marked as opened on success phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 3:55 ` Kuninori Morimoto
2026-10-15 3:55 ` Kuninori Morimoto
2026-10-15 1:43 ` [PATCH v2 21/25] ASoC: renesas: msiof: Remove redundant period constraint phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 3:56 ` Kuninori Morimoto
2026-10-15 3:56 ` Kuninori Morimoto
2026-10-15 1:43 ` [PATCH v2 22/25] ASoC: renesas: rz-ssi: Ensure the component is marked as opened on success phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 23/25] ASoC: renesas: rz-ssi: Remove redundant component open callback phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 24/25] ASoC: rockchip: rk3399_gru_sound: Mark the link as started on success phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 11:12 ` [PATCH v2 00/25] ASoC: Fix constraint return value handling Mark Brown
2026-10-15 11:12 ` Mark Brown
2026-10-16 1:52 ` Bui Duc Phuc
2026-10-16 1:52 ` Bui Duc Phuc
2026-10-16 4:00 ` [PATCH v2 25/25] ASoC: rockchip: rockchip_max98090: Mark the link as started on success phucduc.bui
2026-10-16 4:00 ` phucduc.bui
2026-10-16 10:27 ` Mark Brown
2026-10-16 10:27 ` 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=sashiko-outbox-173747@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=imx@lists.linux.dev \
--cc=phucduc.bui@gmail.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=wsa+renesas@sang-engineering.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.