ASoC: Fix constraint return value handling
Subsystems (15)
cover ASoC: Fix constraint return value handling
From: bui duc phuc <[email protected]>
Hi all,
snd_pcm_hw_constraint_minmax() and snd_pcm_hw_constraint_integer() may return positive values on success. However, ASoC only marks the DAI, link, or component as started or opened when the corresponding callback returns 0.
This series fixes affected ASoC drivers to return 0 on success and properly handle rollback paths.
Found by manual code inspection.
Compile-tested only.
Best regards,
Phuc
bui duc phuc (24):
ASoC: amd: acp: Fix .close() being skipped on rollback
ASoC: amd: ps: Fix acp63_pdm_dma_close() being skipped on rollback
ASoC: amd: ps: Fix acp63_sdw_dma_close() being skipped on rollback
ASoC: amd: raven: Fix acp3x_dma_close() being skipped on rollback
ASoC: amd: renoir: Fix acp_pdm_dma_close() being skipped on rollback
ASoC: amd: vangogh: Fix acp5x_dma_close() being skipped on rollback
ASoC: amd: yc: Fix acp6x_pdm_dma_close() being skipped on rollback
ASoC: apple: mca: Ensure the DAI is marked as started on success
ASoC: atmel: atmel-pcm-pdc: Fix atmel_pcm_close() being skipped on
rollback
ASoC: codecs: cs42l42: Ensure the DAI is marked as started on success
ASoC: codecs: nau8325: Ensure the DAI is marked as started on success
ASoC: codecs: nau8540: Ensure the DAI is marked as started on success
ASoC: codecs: nau8821: Ensure the DAI is marked as started on success
ASoC: codecs: nau8824: Ensure the DAI is marked as started on success
ASoC: codecs: nau8825: Ensure the DAI is marked as started on success
ASoC: codecs: wm8580: Ensure the DAI is marked as started on success
ASoC: codecs: wm8782: Ensure the DAI is marked as started on success
ASoC: imx-pcm-rpmsg: Fix imx_rpmsg_pcm_close() being skipped on
rollback
ASoC: intel: atom: Fix .shutdown() being skipped on rollback
ASoC: renesas: fsi: Ensure the component is marked as opened on
success
ASoC: renesas: msiof: Fix msiof_close() being skipped on rollback
ASoC: renesas: rz-ssi: Ensure the component is marked as opened on
success
ASoC: rockchip: rk3399_gru_sound: Mark the link as started on success
ASoC: rockchip: rockchip_max98090: Mark the link as started on success
sound/soc/amd/acp/acp-platform.c | 2 +- sound/soc/amd/ps/ps-pdm-dma.c | 2 +- sound/soc/amd/ps/ps-sdw-dma.c | 2 +- sound/soc/amd/raven/acp3x-pcm-dma.c | 2 +- sound/soc/amd/renoir/acp3x-pdm-dma.c | 2 +- sound/soc/amd/vangogh/acp5x-pcm-dma.c | 2 +- sound/soc/amd/yc/acp6x-pdm-dma.c | 2 +- sound/soc/apple/mca.c | 11 ++++++++--- sound/soc/atmel/atmel-pcm-pdc.c | 2 ++ sound/soc/codecs/cs42l42.c | 11 ++++++++--- sound/soc/codecs/nau8325.c | 11 ++++++++--- sound/soc/codecs/nau8540.c | 11 ++++++++--- sound/soc/codecs/nau8821.c | 11 ++++++++--- sound/soc/codecs/nau8824.c | 11 ++++++++--- sound/soc/codecs/nau8825.c | 11 ++++++++--- sound/soc/codecs/wm8580.c | 10 ++++++++-- sound/soc/codecs/wm8782.c | 7 ++++++- sound/soc/fsl/imx-pcm-rpmsg.c | 2 +- sound/soc/intel/atom/sst-mfld-platform-pcm.c | 2 +- sound/soc/renesas/fsi.c | 6 ++++-- sound/soc/renesas/rcar/msiof.c | 6 ++++-- sound/soc/renesas/rz-ssi.c | 18 +++++++++++++++--- sound/soc/rockchip/rk3399_gru_sound.c | 9 +++++++-- sound/soc/rockchip/rockchip_max98090.c | 10 ++++++++-- 24 files changed, 119 insertions(+), 44 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/24 ASoC: amd: acp: Fix .close() being skipped on rollback
From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_integer() may return 1, which is then returned from acp_dma_open(). ASoC only marks the component as opened when .open() returns 0, so .close() can be skipped on rollback.
Return 0 explicitly on success.
--- sound/soc/amd/acp/acp-platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/amd/acp/acp-platform.c +1 -1
@@ -248,7 +248,7 @@ static int acp_dma_open(struct snd_soc_component *component, struct snd_pcm_subslist_add_tail (&stream->list, &chip->stream_list);spin_unlock_irq (&chip->acp_lock); -return ret; +return 0 ; } static int acp_dma_hw_params(struct snd_soc_component *component,
Signature · 1 line
2.43.0
PATCH 2/24 ASoC: amd: ps: Fix acp63_pdm_dma_close() being skipped on rollback
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_integer() may return 1, which is then returned from acp63_pdm_dma_open(). ASoC only marks the component as opened when .open() returns 0, so .close() can be skipped on rollback.
Return 0 explicitly on success.
--- sound/soc/amd/ps/ps-pdm-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/amd/ps/ps-pdm-dma.c +1 -1
@@ -211,7 +211,7 @@ static int acp63_pdm_dma_open(struct snd_soc_component *component, pdm_data->acp63_base = adata->acp63_base; runtime->private_data = pdm_data; -return ret; +return 0 ; } static int acp63_pdm_dma_hw_params(struct snd_soc_component *component,
Signature · 1 line
2.43.0
PATCH 3/24 ASoC: amd: ps: Fix acp63_sdw_dma_close() being skipped on rollback
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_integer() may return 1, which is then returned from acp63_sdw_dma_open(). ASoC only marks the component as opened when .open() returns 0, so .close() can be skipped on rollback.
Return 0 explicitly on success.
--- sound/soc/amd/ps/ps-sdw-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/amd/ps/ps-sdw-dma.c +1 -1
@@ -337,7 +337,7 @@ static int acp63_sdw_dma_open(struct snd_soc_component *component, stream->stream_id = cpu_dai->id; stream->instance = amd_manager->instance; runtime->private_data = stream; -return ret; +return 0 ; } static int acp63_sdw_dma_hw_params(struct snd_soc_component *component,
Signature · 1 line
2.43.0
PATCH 4/24 ASoC: amd: raven: Fix acp3x_dma_close() being skipped on rollback
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_integer() may return 1, which is then returned from acp3x_dma_open(). ASoC only marks the component as opened when .open() returns 0, so .close() can be skipped on rollback.
Return 0 explicitly on success.
--- sound/soc/amd/raven/acp3x-pcm-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/amd/raven/acp3x-pcm-dma.c +1 -1
@@ -237,7 +237,7 @@ static int acp3x_dma_open(struct snd_soc_component *component, i2s_data->acp3x_base = adata->acp3x_base; runtime->private_data = i2s_data; -return ret; +return 0 ; }
Signature · 1 line
2.43.0
PATCH 5/24 ASoC: amd: renoir: Fix acp_pdm_dma_close() being skipped on rollback
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_integer() may return 1, which is then returned from acp_pdm_dma_open(). ASoC only marks the component as opened when .open() returns 0, so .close() can be skipped on rollback.
Return 0 explicitly on success.
--- sound/soc/amd/renoir/acp3x-pdm-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/amd/renoir/acp3x-pdm-dma.c +1 -1
@@ -233,7 +233,7 @@ static int acp_pdm_dma_open(struct snd_soc_component *component, pdm_data->acp_base = adata->acp_base; runtime->private_data = pdm_data; -return ret; +return 0 ; } static int acp_pdm_dma_hw_params(struct snd_soc_component *component,
Signature · 1 line
2.43.0
PATCH 6/24 ASoC: amd: vangogh: Fix acp5x_dma_close() being skipped on rollback
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_integer() may return 1, which is then returned from acp5x_dma_open(). ASoC only marks the component as opened when .open() returns 0, so .close() can be skipped on rollback.
Return 0 explicitly on success.
--- sound/soc/amd/vangogh/acp5x-pcm-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/amd/vangogh/acp5x-pcm-dma.c +1 -1
@@ -231,7 +231,7 @@ static int acp5x_dma_open(struct snd_soc_component *component, } i2s_data->acp5x_base = adata->acp5x_base; runtime->private_data = i2s_data; -return ret; +return 0 ; } static int acp5x_dma_hw_params(struct snd_soc_component *component,
Signature · 1 line
2.43.0
PATCH 7/24 ASoC: amd: yc: Fix acp6x_pdm_dma_close() being skipped on rollback
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_integer() may return 1, which is then returned from acp6x_pdm_dma_open(). ASoC only marks the component as opened when .open() returns 0, so .close() can be skipped on rollback.
Return 0 explicitly on success.
--- sound/soc/amd/yc/acp6x-pdm-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/amd/yc/acp6x-pdm-dma.c +1 -1
@@ -209,7 +209,7 @@ static int acp6x_pdm_dma_open(struct snd_soc_component *component, pdm_data->acp6x_base = adata->acp6x_base; runtime->private_data = pdm_data; -return ret; +return 0 ; } static int acp6x_pdm_dma_hw_params(struct snd_soc_component *component,
Signature · 1 line
2.43.0
PATCH 8/24 ASoC: apple: mca: Ensure the DAI is marked as started on success
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_minmax() may return 1, which is then returned from mca_fe_startup(). ASoC only marks the DAI as started when .startup() returns 0.
This currently has no functional impact, as mca_fe_ops has no .shutdown() callback. Still, return 0 explicitly on success to match what ASoC expects and ensure the DAI is correctly marked as started.
--- sound/soc/apple/mca.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
sound/soc/apple/mca.c +8 -3
@@ -516,6 +516,7 @@ static int mca_fe_startup(struct snd_pcm_substream *substream, {struct mca_cluster *cl =mca_dai_to_cluster (dai);unsigned int mask, nchannels; +int ret;if (cl->tdm_slots) {if (substream->stream ==SNDRV_PCM_STREAM_PLAYBACK )
@@ -528,9 +529,13 @@ static int mca_fe_startup(struct snd_pcm_substream *substream, nchannels =2 ; } -return snd_pcm_hw_constraint_minmax (substream->runtime, -SNDRV_PCM_HW_PARAM_CHANNELS , -1 , nchannels); + ret =snd_pcm_hw_constraint_minmax (substream->runtime, +SNDRV_PCM_HW_PARAM_CHANNELS , +1 , nchannels); +if (ret <0 ) +return ret; + +return 0 ; } static int mca_fe_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
Signature · 1 line
2.43.0
PATCH 9/24 ASoC: atmel: atmel-pcm-pdc: Fix atmel_pcm_close() being skipped on rollback
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_integer() may return 1, which is then returned from atmel_pcm_open(). ASoC only marks the component as opened when .open() returns 0, so .close() can be skipped on rollback.
Return 0 explicitly on success.
--- sound/soc/atmel/atmel-pcm-pdc.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/atmel/atmel-pcm-pdc.c +2 -0
@@ -295,6 +295,8 @@ static int atmel_pcm_open(struct snd_soc_component *component, } runtime->private_data = prtd; +return 0 ; + out:return ret; }
Signature · 1 line
2.43.0
PATCH 10/24 ASoC: codecs: cs42l42: Ensure the DAI is marked as started on success
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_minmax() may return 1, which is then returned from cs42l42_dai_startup(). ASoC only marks the DAI as started when .startup() returns 0.
This currently has no functional impact, as cs42l42_ops has no .shutdown() callback. Still, return 0 explicitly on success to match what ASoC expects and ensure the DAI is correctly marked as started.
--- sound/soc/codecs/cs42l42.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
sound/soc/codecs/cs42l42.c +8 -3
@@ -890,6 +890,7 @@ static int cs42l42_dai_startup(struct snd_pcm_substream *substream, struct snd_s {struct snd_soc_component *component = dai->component;struct cs42l42_private *cs42l42 =snd_soc_component_get_drvdata (component); +int ret;/* * Sample rates < 44.1 kHz would produce an out-of-range SCLK with
@@ -900,9 +901,13 @@ static int cs42l42_dai_startup(struct snd_pcm_substream *substream, struct snd_sreturn 0 ;/* Machine driver has not set a SCLK, limit bottom end to 44.1 kHz */ -return snd_pcm_hw_constraint_minmax (substream->runtime, -SNDRV_PCM_HW_PARAM_RATE , -44100 ,96000 ); + ret =snd_pcm_hw_constraint_minmax (substream->runtime, +SNDRV_PCM_HW_PARAM_RATE , +44100 ,96000 ); +if (ret <0 ) +return ret; + +return 0 ; } static int cs42l42_pcm_hw_params(struct snd_pcm_substream *substream,
Signature · 1 line
2.43.0
PATCH 11/24 ASoC: codecs: nau8325: Ensure the DAI is marked as started on success
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_minmax() may return 1, which is then returned from nau8325_dai_startup(). ASoC only marks the DAI as started when .startup() returns 0.
This currently has no functional impact, as nau8325_dai_ops has no .shutdown() callback. Still, return 0 explicitly on success to match what ASoC expects and ensure the DAI is correctly marked as started.
--- sound/soc/codecs/nau8325.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
sound/soc/codecs/nau8325.c +8 -3
@@ -489,14 +489,19 @@ static int nau8325_dai_startup(struct snd_pcm_substream *substream,struct snd_soc_component *component = dai->component;struct nau8325 *nau8325 =snd_soc_component_get_drvdata (component);const struct nau8325_osr_attr *osr; +int ret; osr =nau8325_get_osr (nau8325);if (!osr || !osr->osr)return -EINVAL ; -return snd_pcm_hw_constraint_minmax (substream->runtime, -SNDRV_PCM_HW_PARAM_RATE , -0 ,CLK_DA_AD_MAX / osr->osr); + ret =snd_pcm_hw_constraint_minmax (substream->runtime, +SNDRV_PCM_HW_PARAM_RATE , +0 ,CLK_DA_AD_MAX / osr->osr); +if (ret <0 ) +return ret; + +return 0 ; } static int nau8325_hw_params(struct snd_pcm_substream *substream,
Signature · 1 line
2.43.0
PATCH 12/24 ASoC: codecs: nau8540: Ensure the DAI is marked as started on success
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_minmax() may return 1, which is then returned from nau8540_dai_startup(). ASoC only marks the DAI as started when .startup() returns 0.
This currently has no functional impact, as nau8540_dai_ops has no .shutdown() callback. Still, return 0 explicitly on success to match what ASoC expects and ensure the DAI is correctly marked as started.
--- sound/soc/codecs/nau8540.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
sound/soc/codecs/nau8540.c +8 -3
@@ -419,14 +419,19 @@ static int nau8540_dai_startup(struct snd_pcm_substream *substream,struct snd_soc_component *component = dai->component;struct nau8540 *nau8540 =snd_soc_component_get_drvdata (component);const struct nau8540_osr_attr *osr; +int ret; osr =nau8540_get_osr (nau8540);if (!osr || !osr->osr)return -EINVAL ; -return snd_pcm_hw_constraint_minmax (substream->runtime, -SNDRV_PCM_HW_PARAM_RATE , -0 ,CLK_ADC_MAX / osr->osr); + ret =snd_pcm_hw_constraint_minmax (substream->runtime, +SNDRV_PCM_HW_PARAM_RATE , +0 ,CLK_ADC_MAX / osr->osr); +if (ret <0 ) +return ret; + +return 0 ; } static int nau8540_hw_params(struct snd_pcm_substream *substream,
Signature · 1 line
2.43.0
PATCH 13/24 ASoC: codecs: nau8821: Ensure the DAI is marked as started on success
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_minmax() may return 1, which is then returned from nau8821_dai_startup(). ASoC only marks the DAI as started when .startup() returns 0.
This currently has no functional impact, as nau8821_dai_ops has no .shutdown() callback. Still, return 0 explicitly on success to match what ASoC expects and ensure the DAI is correctly marked as started.
--- sound/soc/codecs/nau8821.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
sound/soc/codecs/nau8821.c +8 -3
@@ -829,14 +829,19 @@ static int nau8821_dai_startup(struct snd_pcm_substream *substream,struct snd_soc_component *component = dai->component;struct nau8821 *nau8821 =snd_soc_component_get_drvdata (component);const struct nau8821_osr_attr *osr; +int ret; osr =nau8821_get_osr (nau8821, substream->stream);if (!osr || !osr->osr)return -EINVAL ; -return snd_pcm_hw_constraint_minmax (substream->runtime, -SNDRV_PCM_HW_PARAM_RATE , -0 ,CLK_DA_AD_MAX / osr->osr); + ret =snd_pcm_hw_constraint_minmax (substream->runtime, +SNDRV_PCM_HW_PARAM_RATE , +0 ,CLK_DA_AD_MAX / osr->osr); +if (ret <0 ) +return ret; + +return 0 ; } static int nau8821_hw_params(struct snd_pcm_substream *substream,
Signature · 1 line
2.43.0
PATCH 14/24 ASoC: codecs: nau8824: Ensure the DAI is marked as started on success
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_minmax() may return 1, which is then returned from nau8824_dai_startup(). ASoC only marks the DAI as started when .startup() returns 0.
This currently has no functional impact, as nau8824_dai_ops has no .shutdown() callback. Still, return 0 explicitly on success to match what ASoC expects and ensure the DAI is correctly marked as started.
--- sound/soc/codecs/nau8824.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
sound/soc/codecs/nau8824.c +8 -3
@@ -1061,14 +1061,19 @@ static int nau8824_dai_startup(struct snd_pcm_substream *substream,struct snd_soc_component *component = dai->component;struct nau8824 *nau8824 =snd_soc_component_get_drvdata (component);const struct nau8824_osr_attr *osr; +int ret; osr =nau8824_get_osr (nau8824, substream->stream);if (!osr || !osr->osr)return -EINVAL ; -return snd_pcm_hw_constraint_minmax (substream->runtime, -SNDRV_PCM_HW_PARAM_RATE , -0 ,CLK_DA_AD_MAX / osr->osr); + ret =snd_pcm_hw_constraint_minmax (substream->runtime, +SNDRV_PCM_HW_PARAM_RATE , +0 ,CLK_DA_AD_MAX / osr->osr); +if (ret <0 ) +return ret; + +return 0 ; } static int nau8824_hw_params(struct snd_pcm_substream *substream,
Signature · 1 line
2.43.0
PATCH 15/24 ASoC: codecs: nau8825: Ensure the DAI is marked as started on success
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_minmax() may return 1, which is then returned from nau8825_dai_startup(). ASoC only marks the DAI as started when .startup() returns 0.
This currently has no functional impact, as nau8825_dai_ops has no .shutdown() callback. Still, return 0 explicitly on success to match what ASoC expects and ensure the DAI is correctly marked as started.
--- sound/soc/codecs/nau8825.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
sound/soc/codecs/nau8825.c +8 -3
@@ -1261,14 +1261,19 @@ static int nau8825_dai_startup(struct snd_pcm_substream *substream,struct snd_soc_component *component = dai->component;struct nau8825 *nau8825 =snd_soc_component_get_drvdata (component);const struct nau8825_osr_attr *osr; +int ret; osr =nau8825_get_osr (nau8825, substream->stream);if (!osr || !osr->osr)return -EINVAL ; -return snd_pcm_hw_constraint_minmax (substream->runtime, -SNDRV_PCM_HW_PARAM_RATE , -0 ,CLK_DA_AD_MAX / osr->osr); + ret =snd_pcm_hw_constraint_minmax (substream->runtime, +SNDRV_PCM_HW_PARAM_RATE , +0 ,CLK_DA_AD_MAX / osr->osr); +if (ret <0 ) +return ret; + +return 0 ; } static int nau8825_hw_params(struct snd_pcm_substream *substream,
Signature · 1 line
2.43.0
PATCH 16/24 ASoC: codecs: wm8580: Ensure the DAI is marked as started on success
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_minmax() may return 1, which is then returned from wm8580_playback_startup(). ASoC only marks the DAI as started when .startup() returns 0.
This currently has no functional impact, as wm8580_dai_ops_playback has no .shutdown() callback. Still, return 0 explicitly on success to match what ASoC expects and ensure the DAI is correctly marked as started.
--- sound/soc/codecs/wm8580.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
sound/soc/codecs/wm8580.c +8 -2
@@ -852,9 +852,15 @@ static int wm8580_playback_startup(struct snd_pcm_substream *substream, {struct snd_soc_component *component = dai->component;struct wm8580_priv *wm8580 =snd_soc_component_get_drvdata (component); +int ret; -return snd_pcm_hw_constraint_minmax (substream->runtime, -SNDRV_PCM_HW_PARAM_CHANNELS ,1 , wm8580->drvdata->num_dacs *2 ); + ret =snd_pcm_hw_constraint_minmax (substream->runtime, +SNDRV_PCM_HW_PARAM_CHANNELS ,1 , + wm8580->drvdata->num_dacs *2 ); +if (ret <0 ) +return ret; + +return 0 ; }#define WM8580_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
Signature · 1 line
2.43.0
PATCH 17/24 ASoC: codecs: wm8782: Ensure the DAI is marked as started on success
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_minmax() may return 1, which is then returned from wm8782_dai_startup(). ASoC only marks the DAI as started when .startup() returns 0.
This currently has no functional impact, as wm8782_dai_ops has no .shutdown() callback. Still, return 0 explicitly on success to match what ASoC expects and ensure the DAI is correctly marked as started.
--- sound/soc/codecs/wm8782.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
sound/soc/codecs/wm8782.c +6 -1
@@ -39,9 +39,14 @@ static int wm8782_dai_startup(struct snd_pcm_substream *sub, struct snd_soc_daistruct snd_pcm_runtime *runtime = sub->runtime;struct wm8782_priv *priv =snd_soc_component_get_drvdata (dai->component); +int ret; -return snd_pcm_hw_constraint_minmax (runtime,SNDRV_PCM_HW_PARAM_RATE , + ret =snd_pcm_hw_constraint_minmax (runtime,SNDRV_PCM_HW_PARAM_RATE ,8000 , priv->max_rate); +if (ret <0 ) +return ret; + +return 0 ; }static const struct snd_soc_dapm_widget wm8782_dapm_widgets[] = {
Signature · 1 line
2.43.0
PATCH 18/24 ASoC: imx-pcm-rpmsg: Fix imx_rpmsg_pcm_close() being skipped on rollback
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_integer() may return 1, which is then returned from imx_rpmsg_pcm_open(). ASoC only marks the component as opened when .open() returns 0, so .close() can be skipped on rollback.
Return 0 explicitly on success.
--- sound/soc/fsl/imx-pcm-rpmsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/fsl/imx-pcm-rpmsg.c +1 -1
@@ -269,7 +269,7 @@ 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; +return 0 ; } static int imx_rpmsg_pcm_close(struct snd_soc_component *component,
Signature · 1 line
2.43.0
PATCH 19/24 ASoC: intel: atom: Fix .shutdown() being skipped on rollback
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_integer() may return 1, which is then returned from sst_media_open(). ASoC only marks the DAI as started when .startup() returns 0, so .shutdown() can be skipped on rollback.
Return 0 explicitly on success.
--- sound/soc/intel/atom/sst-mfld-platform-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/atom/sst-mfld-platform-pcm.c +1 -1
@@ -341,7 +341,7 @@ static int sst_media_open(struct snd_pcm_substream *substream, stream =NULL ; -return ret_val; +return 0 ; } static void sst_media_close(struct snd_pcm_substream *substream,
Signature · 1 line
2.43.0
PATCH 20/24 ASoC: renesas: fsi: Ensure the component is marked as opened on success
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_integer() may return 1, which is then returned from fsi_pcm_open(). ASoC only marks the component as opened when .open() returns 0.
This currently has no functional impact, as fsi_soc_component has no .close() callback. Still, return 0 explicitly on success to match what ASoC expects and ensure the component is correctly marked as opened.
--- sound/soc/renesas/fsi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
sound/soc/renesas/fsi.c +4 -2
@@ -1811,14 +1811,16 @@ static int fsi_pcm_open(struct snd_soc_component *component, struct snd_pcm_substream *substream) {struct snd_pcm_runtime *runtime = substream->runtime; -int ret =0 ; +int ret;snd_soc_set_runtime_hwparams (substream, &fsi_pcm_hardware); ret =snd_pcm_hw_constraint_integer (runtime,SNDRV_PCM_HW_PARAM_PERIODS ); +if (ret <0 ) +return ret; -return ret; +return 0 ; } static snd_pcm_uframes_t fsi_pointer(struct snd_soc_component *component,
Signature · 1 line
2.43.0
PATCH 21/24 ASoC: renesas: msiof: Fix msiof_close() being skipped on rollback
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_integer() may return 1, which is then returned from msiof_open(). ASoC only marks the component as opened when .open() returns 0, so .close() can be skipped on rollback.
Return 0 explicitly on success.
--- sound/soc/renesas/rcar/msiof.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
sound/soc/renesas/rcar/msiof.c +4 -2
@@ -427,10 +427,12 @@ static int msiof_open(struct snd_soc_component *component, ret =snd_pcm_hw_constraint_integer (substream->runtime,SNDRV_PCM_HW_PARAM_PERIODS ); open_err_dma: -if (ret <0 ) +if (ret <0 ) {dma_release_channel (chan); +return ret; + } -return ret; +return 0 ; } static int msiof_close(struct snd_soc_component *component,
Signature · 1 line
2.43.0
PATCH 22/24 ASoC: renesas: rz-ssi: Ensure the component is marked as opened on success
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_integer() may return 1, which is then returned from rz_ssi_pcm_open_xx(). ASoC only marks the component as opened when .open() returns 0.
This currently has no functional impact, as the component driver has no .close() callback. Still, return 0 explicitly on success to match what ASoC expects and ensure the component is correctly marked as opened.
--- sound/soc/renesas/rz-ssi.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
sound/soc/renesas/rz-ssi.c +15 -3
@@ -937,17 +937,29 @@ static const struct snd_pcm_hardware rz_ssi_pcm_hardware = {static int rz_ssi_pcm_open_pio (struct snd_soc_component *component,struct snd_pcm_substream *substream) { +int ret; +snd_soc_set_runtime_hwparams (substream, &rz_ssi_pcm_hardware); -return snd_pcm_hw_constraint_integer (substream->runtime, + ret =snd_pcm_hw_constraint_integer (substream->runtime,SNDRV_PCM_HW_PARAM_PERIODS ); +if (ret <0 ) +return ret; + +return 0 ; }static int rz_ssi_pcm_open_dma (struct snd_soc_component *component,struct snd_pcm_substream *substream) { -return snd_pcm_hw_constraint_integer (substream->runtime, -SNDRV_PCM_HW_PARAM_PERIODS ); +int ret; + + ret =snd_pcm_hw_constraint_integer (substream->runtime, +SNDRV_PCM_HW_PARAM_PERIODS ); +if (ret <0 ) +return ret; + +return 0 ; } static snd_pcm_uframes_t rz_ssi_pcm_pointer(struct snd_soc_component *component,
Signature · 1 line
2.43.0
PATCH 23/24 ASoC: rockchip: rk3399_gru_sound: Mark the link as started on success
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_minmax() may return 1, which is then returned from rockchip_sound_startup(). ASoC only marks the DAI link as started when .startup() returns 0.
This currently has no functional impact, as there is no .shutdown() callback in the relevant snd_soc_ops. Still, return 0 explicitly on success to match what ASoC expects and ensure the DAI link is correctly marked as started.
--- sound/soc/rockchip/rk3399_gru_sound.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
sound/soc/rockchip/rk3399_gru_sound.c +7 -2
@@ -258,10 +258,15 @@ static int rockchip_sound_dmic_hw_params(struct snd_pcm_substream *substream,static int rockchip_sound_startup (struct snd_pcm_substream *substream) {struct snd_pcm_runtime *runtime = substream->runtime; +int ret; runtime->hw.formats =SNDRV_PCM_FMTBIT_S16_LE ; -return snd_pcm_hw_constraint_minmax (runtime,SNDRV_PCM_HW_PARAM_RATE , -8000 ,96000 ); + ret =snd_pcm_hw_constraint_minmax (runtime,SNDRV_PCM_HW_PARAM_RATE , +8000 ,96000 ); +if (ret <0 ) +return ret; + +return 0 ; }static const struct snd_soc_ops rockchip_sound_max98357a_ops = {
Signature · 1 line
2.43.0
PATCH 24/24 ASoC: rockchip: rockchip_max98090: Mark the link as started on success
In reply to [email protected]From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_minmax() may return 1, which is then returned from rk_aif1_startup(). ASoC only marks the DAI link as started when .startup() returns 0.
This currently has no functional impact, as there is no .shutdown() callback in the relevant snd_soc_ops. Still, return 0 explicitly on success to match what ASoC expects and ensure the DAI link is correctly marked as started.
--- sound/soc/rockchip/rockchip_max98090.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
sound/soc/rockchip/rockchip_max98090.c +8 -2
@@ -191,12 +191,18 @@ static int rk_aif1_hw_params(struct snd_pcm_substream *substream,static int rk_aif1_startup (struct snd_pcm_substream *substream) { +int ret;/* * Set period size to 240 because pl330 has issue * dealing with larger period in stress testing. */ -return snd_pcm_hw_constraint_minmax (substream->runtime, -SNDRV_PCM_HW_PARAM_PERIOD_SIZE ,240 ,240 ); + ret =snd_pcm_hw_constraint_minmax (substream->runtime, +SNDRV_PCM_HW_PARAM_PERIOD_SIZE , +240 ,240 ); +if (ret <0 ) +return ret; + +return 0 ; }static const struct snd_soc_ops rk_aif1_ops = {
Signature · 1 line
2.43.0
Richard Fitzgerald
maintainerRe: [PATCH 10/24] ASoC: codecs: cs42l42: Ensure the DAI is marked as started on success
In reply to [email protected]Quoted 5 lines · On 08/10/2026 11:38 am, [email protected] wrote:
From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_minmax()may return 1, which is then returned fromcs42l42_dai_startup(). ASoC only marks the DAI as started when .startup() returns 0.
Is there any reason why we can't change ASoC to mark the DAI as started if return is not an error?
int snd_soc_dai_startup(struct snd_soc_dai *dai,
struct snd_pcm_substream *substream)
{
<SNIP>
if (ret < 0) soc_dai_ret(dai, ret); soc_dai_mark_push(dai, substream, startup); return soc_dai_ret(dai, 0); }
_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
[email protected]
AI reviewRe: [PATCH 06/24] ASoC: amd: vangogh: Fix acp5x_dma_close() being skipped on rollback
In reply to [email protected]Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Critical] ASoC: amd: vangogh: Uninitialized i2s_instance in acp5x_dma_close() corrupts concurrent…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Critical] ASoC: amd: vangogh: Uninitialized i2s_instance in acp5x_dma_close() corrupts concurrent streams --
commit 0fa96f07228732634c84e9e1736847a1c270fb29
Author: bui duc phuc <[email protected]>
ASoC: amd: vangogh: Fix acp5x_dma_close() being skipped on rollback
This commit explicitly returns 0 on success in acp5x_dma_open() to ensure ASoC correctly marks the component as opened. This prevents .close() from being skipped during a rollback if .open() initially returned 1 from snd_pcm_hw_constraint_integer().
sound/soc/amd/vangogh/acp5x-pcm-dma.c static int acp5x_dma_open(struct snd_soc_component *component, · line 234
Quoted 10 lines
sound/soc/amd/vangogh/acp5x-pcm-dma.c +1
-1@@ -231,7 +231,7 @@ static int acp5x_dma_open(struct snd_soc_component *component, } i2s_data->acp5x_base = adata->acp5x_base; runtime->private_data = i2s_data; -return ret; +return 0 ;
[Severity: Critical]
By ensuring acp5x_dma_open() returns 0, ALSA SoC will now call acp5x_dma_close() on rollback if a stream is aborted before hw_params() is called.
Can this regression corrupt the state of concurrent streams?
When acp5x_dma_open() allocates i2s_data via kzalloc(), the i2s_instance field is initialized to 0. It is only set to its correct value later in acp5x_dma_hw_params().
If acp5x_dma_close() runs on rollback before hw_params() is called:
sound/soc/amd/vangogh/acp5x-pcm-dma.c:acp5x_dma_close() {
...
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
switch (ins->i2s_instance) {
case I2S_HS_INSTANCE:
adata->play_stream = NULL;
break;
case I2S_SP_INSTANCE:
default:
adata->i2ssp_play_stream = NULL;
}
...
}Because ins->i2s_instance is 0, it falls through to the default case and sets adata->i2ssp_play_stream = NULL.
Since adata is shared per-device data, this incorrectly clears the stream tracking pointer for a completely separate, concurrently running stream.
When the hardware fires a threshold interrupt for the active stream, the handler will fail to clear it:
sound/soc/amd/vangogh/acp5x-pcm-dma.c:i2s_irq_handler() {
...
if ((val & BIT(I2S_TX_THRESHOLD)) && vg_i2s_data->i2ssp_play_stream) {
acp_writel(BIT(I2S_TX_THRESHOLD),
vg_i2s_data->acp5x_base + ACP_EXTERNAL_INTR_STAT);
snd_pcm_period_elapsed(vg_i2s_data->i2ssp_play_stream);
irq_flag = 1;
}
...
}Because the pointer was nullified, the interrupt remains asserted and the handler returns IRQ_NONE, causing an infinite hardirq loop.
Quoted 3 lines
sound/soc/amd/vangogh/acp5x-pcm-dma.c +0
-0} static int acp5x_dma_hw_params(struct snd_soc_component *component,
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
[email protected]
AI reviewRe: [PATCH 21/24] ASoC: renesas: msiof: Fix msiof_close() being skipped on rollback
In reply to [email protected]Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] asoc: msiof: memory leak of prtd in msiof_open() error path --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] asoc: msiof: memory leak of prtd in msiof_open() error path
--
commit d7a4f2d9645c8240b2c60d42136e3b2e4694d703
Author: bui duc phuc <[email protected]>
ASoC: renesas: msiof: Fix msiof_close() being skipped on rollback
snd_pcm_hw_constraint_integer() may return 1, which is then returned from msiof_open(). ASoC only marks the component as opened when .open() returns 0, so this patch explicitly returns 0 on success to ensure .close() isn't skipped on rollback.
sound/soc/renesas/rcar/msiof.c static int msiof_open(struct snd_soc_component *component, · line 432
Quoted 12 lines
sound/soc/renesas/rcar/msiof.c +2
-1@@ -427,10 +427,12 @@ static int msiof_open(struct snd_soc_component *component, ret =snd_pcm_hw_constraint_integer (substream->runtime,SNDRV_PCM_HW_PARAM_PERIODS ); open_err_dma: -if (ret <0 ) +if (ret <0 ) {dma_release_channel (chan); +return ret;
[Severity: Medium]
Does this error path leak the dmaengine_pcm_runtime_data (prtd) memory?
In msiof_open(), if snd_dmaengine_pcm_open() succeeds, it allocates a prtd object. If the subsequent call to snd_pcm_hw_constraint_integer() fails, the function falls through to this open_err_dma error path.
Since this path calls dma_release_channel(chan) but fails to clean up the PCM state via snd_dmaengine_pcm_close(substream) or snd_dmaengine_pcm_close_release_chan(substream), is the prtd memory permanently leaked when msiof_open() returns an error and the ASoC core aborts the open sequence?
Quoted 7 lines
sound/soc/renesas/rcar/msiof.c +2
-1+ } -return ret; +return 0 ; } static int msiof_close(struct snd_soc_component *component,
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=21
Re: [PATCH 10/24] ASoC: codecs: cs42l42: Ensure the DAI is marked as started on success
In reply to Richard FitzgeraldHi Richard,
Thank you for your review.
Quoted 9 lines
Is there any reason why we can't change ASoC to mark the DAI as started if return is not an error?
int snd_soc_dai_startup(struct
snd_soc_dai*dai,
structsnd_pcm_substream*substream)
{
<SNIP>
Quoted 7 lines
if (ret < 0)
soc_dai_ret(dai, ret);
soc_dai_mark_push(dai, substream, startup);
return soc_dai_ret(dai, 0);
}I confirmed this with the maintainer here:
https://lore.kernel.org/all/CAABR9nEXM1OSnV6L4=N1YCbtWn5yMNr+OMEZ4p8h3WMaQXbgmA@mail.gmail.com/
It seems that the other ASoC callbacks consistently use 0 to indicate success. The other call sites also handle the return values correctly. The issue is limited to callbacks that directly return the result of snd_pcm_hw_constraint_minmax() or snd_pcm_hw_constraint_integer(), where the positive return value was overlooked.
Best regards,
Phuc
Re: [PATCH 21/24] ASoC: renesas: msiof: Fix msiof_close() being skipped on rollback
In reply to [email protected]Quoted 3 lines
[Severity: Medium]
Does this error path leak thedmaengine_pcm_runtime_data(prtd) memory?
Yes, this leak is pre-existing.
Looking at it further, snd_dmaengine_pcm_open() already calls snd_pcm_hw_constraint_integer() for SNDRV_PCM_HW_PARAM_PERIODS, so the second call in msiof_open() seems to be redundant. Removing it would fix both the positive return value and the prtd leak:
-----------------------------------------------------------------------------------------
ret = snd_dmaengine_pcm_open(substream, chan);
if (ret < 0) {
dma_release_channel(chan);
return ret;
}snd_soc_set_runtime_hwparams(substream, &msiof_pcm_hardware);
return 0;
-----------------------------------------------------------------------------------------
Morimoto-san, Mark, would this be acceptable? If so, I'll send it as v2.
Best regards,
Phuc
Kuninori Morimoto
maintainerRe: [PATCH 21/24] ASoC: renesas: msiof: Fix msiof_close() being skipped on rollback
In reply to [email protected]Hi
Quoted 11 lines
From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_integer()may return 1, which is then returned frommsiof_open(). ASoC only marks the component as opened when .open() returns 0, so .close() can be skipped on rollback.Return 0 explicitly on success.
Fixes c61caec22820 ("ASoC: renesas: add MSIOF sound support")Signed-off-by bui duc phuc <[email protected]>---
If so, we would like to have such comment to indicate such background, because it is not intuitive for people.
Otherwise, someone (maybe me :) will return to the original code.
Thank you for your help !!
Best regards
---
Kuninori Morimoto
Re: [PATCH 21/24] ASoC: renesas: msiof: Fix msiof_close() being skipped on rollback
Hi Morimoto-san,
Thank you for your review.
Quoted 2 lines
If so,
Although I don't have MSIOF hardware, I tested this on FSI hardware.
I added a .close() callback to fsi_soc_component and forced fsi_dai_startup() to fail to trigger rollback in __soc_pcm_open().
When fsi_pcm_open() returned 1 from snd_pcm_hw_constraint_integer(),
the .close() callback was skipped during rollback.
When it returned 0, the callback was called as expected.
Quoted 4 lines
we would like to have such comment to indicate such background, because it is not intuitive for people.
Otherwise, someone (maybe me :) will return to the original code.
I'll add a comment to explain why the return value must be normalized to 0 in the affected drivers.
For MSIOF, I noticed that snd_dmaengine_pcm_open() already calls snd_pcm_hw_constraint_integer() for SNDRV_PCM_HW_PARAM_PERIODS, so the call in msiof_open() seems redundant.
Since the first call succeeds, the second call should return 0. Would removing the redundant call be acceptable?
Best regards,
Phuc
Kuninori Morimoto
maintainerRe: [PATCH 21/24] ASoC: renesas: msiof: Fix msiof_close() being skipped on rollback
Hi Bui
Quoted 2 lines
I'll add a comment to explain why the return value must be normalized to 0 in the affected drivers.
Thanks
Quoted 6 lines
For MSIOF, I noticed that
snd_dmaengine_pcm_open()already callssnd_pcm_hw_constraint_integer()forSNDRV_PCM_HW_PARAM_PERIODS, so the call inmsiof_open()seems redundant.Since the first call succeeds, the second call should return 0. Would removing the redundant call be acceptable?
Nice cache, yes please.
Thank you for your help !!
Best regards
---
Kuninori Morimoto
Re: [PATCH 18/24] ASoC: imx-pcm-rpmsg: Fix imx_rpmsg_pcm_close() being skipped on rollback
In reply to [email protected]Quoted 10 lines · On 10/8/2026 6:38 PM, [email protected] wrote:
From: bui duc phuc <[email protected]>
snd_pcm_hw_constraint_integer()may return 1, which is then returned fromimx_rpmsg_pcm_open(). ASoC only marks the component as opened when .open() returns 0, so .close() can be skipped on rollback.Return 0 explicitly on success.
Fixes 3c00eceb2a53 ("ASoC: imx-pcm-rpmsg: Add platform driver for audio base on rpmsg")Signed-off-by bui duc phuc <[email protected]>
Regards,
Chancel Liu
Quoted 11 lines · On 10/8/26 16:08, [email protected] wrote:
[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
From: bui duc phuc <[email protected]>
Hi all,
snd_pcm_hw_constraint_minmax()andsnd_pcm_hw_constraint_integer()may return positive values on success. However, ASoC only marks the DAI, link, or component as started or opened when the corresponding callback returns 0.
Quoted 4 lines
This series fixes affected ASoC drivers to return 0 on success and properly handle rollback paths.
Found by manual code inspection.
For AMD patches:
Quoted 64 lines
Compile-tested only.
Best regards,
Phucbui duc phuc (24):
ASoC: amd: acp: Fix .close() being skipped on rollback
ASoC: amd: ps: Fixacp63_pdm_dma_close()being skipped on rollback
ASoC: amd: ps: Fixacp63_sdw_dma_close()being skipped on rollback
ASoC: amd: raven: Fixacp3x_dma_close()being skipped on rollback
ASoC: amd: renoir: Fixacp_pdm_dma_close()being skipped on rollback
ASoC: amd: vangogh: Fixacp5x_dma_close()being skipped on rollback
ASoC: amd: yc: Fixacp6x_pdm_dma_close()being skipped on rollback
ASoC: apple: mca: Ensure the DAI is marked as started on success
ASoC: atmel: atmel-pcm-pdc: Fixatmel_pcm_close()being skipped on
rollback
ASoC: codecs: cs42l42: Ensure the DAI is marked as started on success
ASoC: codecs: nau8325: Ensure the DAI is marked as started on success
ASoC: codecs: nau8540: Ensure the DAI is marked as started on success
ASoC: codecs: nau8821: Ensure the DAI is marked as started on success
ASoC: codecs: nau8824: Ensure the DAI is marked as started on success
ASoC: codecs: nau8825: Ensure the DAI is marked as started on success
ASoC: codecs: wm8580: Ensure the DAI is marked as started on success
ASoC: codecs: wm8782: Ensure the DAI is marked as started on success
ASoC: imx-pcm-rpmsg: Fiximx_rpmsg_pcm_close()being skipped on
rollback
ASoC: intel: atom: Fix .shutdown() being skipped on rollback
ASoC: renesas: fsi: Ensure the component is marked as opened on
success
ASoC: renesas: msiof: Fixmsiof_close()being skipped on rollback
ASoC: renesas: rz-ssi: Ensure the component is marked as opened on
success
ASoC: rockchip:rk3399_gru_sound: Mark the link as started on success
ASoC: rockchip:rockchip_max98090: Mark the link as started on successsound/soc/amd/acp/acp-platform.c | 2 +- sound/soc/amd/ps/ps-pdm-dma.c | 2 +- sound/soc/amd/ps/ps-sdw-dma.c | 2 +- sound/soc/amd/raven/acp3x-pcm-dma.c | 2 +- sound/soc/amd/renoir/acp3x-pdm-dma.c | 2 +- sound/soc/amd/vangogh/acp5x-pcm-dma.c | 2 +- sound/soc/amd/yc/acp6x-pdm-dma.c | 2 +- sound/soc/apple/mca.c | 11 ++++++++--- sound/soc/atmel/atmel-pcm-pdc.c | 2 ++ sound/soc/codecs/cs42l42.c | 11 ++++++++--- sound/soc/codecs/nau8325.c | 11 ++++++++--- sound/soc/codecs/nau8540.c | 11 ++++++++--- sound/soc/codecs/nau8821.c | 11 ++++++++--- sound/soc/codecs/nau8824.c | 11 ++++++++--- sound/soc/codecs/nau8825.c | 11 ++++++++--- sound/soc/codecs/wm8580.c | 10 ++++++++-- sound/soc/codecs/wm8782.c | 7 ++++++- sound/soc/fsl/imx-pcm-rpmsg.c | 2 +- sound/soc/intel/atom/sst-mfld-platform-pcm.c | 2 +- sound/soc/renesas/fsi.c | 6 ++++-- sound/soc/renesas/rcar/msiof.c | 6 ++++-- sound/soc/renesas/rz-ssi.c | 18 +++++++++++++++--- sound/soc/rockchip/rk3399_gru_sound.c | 9 +++++++-- sound/soc/rockchip/rockchip_max98090.c | 10 ++++++++-- 24 files changed, 119 insertions(+), 44 deletions(-)--
2.43.0
Re: [PATCH 21/24] ASoC: renesas: msiof: Fix msiof_close() being skipped on rollback
In reply to Kuninori MorimotoHi Morimoto-san,
Thank you for your confirmation.
Quoted 9 lines
Quoted 6 lines
For MSIOF, I noticed that
snd_dmaengine_pcm_open()already callssnd_pcm_hw_constraint_integer()forSNDRV_PCM_HW_PARAM_PERIODS, so the call inmsiof_open()seems redundant.Since the first call succeeds, the second call should return 0. Would removing the redundant call be acceptable?
Nice cache, yes please.
For rz-ssi: in DMA mode, the driver registers the generic dmaengine PCM component, whose .open callback already applies the integer PERIODS constraint via snd_dmaengine_pcm_open().
Could we drop rz_ssi_pcm_open_dma() instead, and keep the return value fix only for rz_ssi_pcm_open_pio()?
Best regards,
Phuc
Kuninori Morimoto
maintainerRe: [PATCH 21/24] ASoC: renesas: msiof: Fix msiof_close() being skipped on rollback
Hi Bui, Claudiu
Quoted 6 lines
For rz-ssi: in DMA mode, the driver registers the generic dmaengine PCM component, whose .open callback already applies the integer PERIODS constraint via
snd_dmaengine_pcm_open().Could we drop
rz_ssi_pcm_open_dma()instead, and keep the return value fix only forrz_ssi_pcm_open_pio()?
It seems fine, but I don't know detail of rz-ssi.
Claudiu, what do you think ?
Thank you for your help !!
Best regards
---
Kuninori Morimoto
Hi Mukunda,
Thanks for the review.
Quoted 4 lines
Quoted 1 line
Found by manual code inspection.
For AMD patches:
Reviewed-by Vijendar Mukunda <[email protected]>
I'll send v2 shortly with your Reviewed-by tag.
Best regards,
Phuc
Re: [PATCH 18/24] ASoC: imx-pcm-rpmsg: Fix imx_rpmsg_pcm_close() being skipped on rollback
In reply to Chancel LiuHi Liu,
Quoted 3 lines
Reviewed-by Chancel Liu <[email protected]>
Thank you for your review.
Best regards,
Phuc
claudiu beznea
maintainerRe: [PATCH 21/24] ASoC: renesas: msiof: Fix msiof_close() being skipped on rollback
In reply to Kuninori MorimotoHi, Morimoto-san, Bui,
Quoted 7 lines · Kuninori Morimoto
Hi Bui, Claudiu
Quoted 4 lines
For rz-ssi: in DMA mode, the driver registers the generic dmaengine PCM component, whose .open callback already applies the integer PERIODS constraint via
snd_dmaengine_pcm_open().
Quoted 5 lines
Quoted 2 lines
Could we drop
rz_ssi_pcm_open_dma()instead, and keep the return value fix only forrz_ssi_pcm_open_pio()?It seems fine, but I don't know detail of rz-ssi.
Claudiu, what do you think ?
That should work. I'll test v2 once it's out.
Thank you,
Claudiu
Re: [PATCH 21/24] ASoC: renesas: msiof: Fix msiof_close() being skipped on rollback
Hi Claudiu, Morimoto-san,
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
For rz-ssi: in DMA mode, the driver registers the generic dmaengine PCM component, whose .open callback already applies the integer PERIODS constraint via
snd_dmaengine_pcm_open().
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Could we drop
rz_ssi_pcm_open_dma()instead, and keep the return value fix only forrz_ssi_pcm_open_pio()?It seems fine, but I don't know detail of rz-ssi.
Claudiu, what do you think ?That should work. I'll test v2 once it's out.
Thanks for your help and feedback. I'll send v2 now.
Best regards,
Phuc
Mark Brown
maintainerQuoted 4 lines · On Thu, 08 Oct 2026 17:38:07 +0700, [email protected] wrote:
ASoC: Fix constraint return value handling
From: bui duc phuc <[email protected]>
Quoted 8 lines
Hi all,
snd_pcm_hw_constraint_minmax()andsnd_pcm_hw_constraint_integer()may return positive values on success. However, ASoC only marks the DAI, link, or component as started or opened when the corresponding callback returns 0.[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4
Thanks!
[01/24] ASoC: amd: acp: Fix .close() being skipped on rollback
https://git.kernel.org/broonie/misc/c/2c3400aa9f39 [02/24] ASoC: amd: ps: Fix acp63_pdm_dma_close() being skipped on rollback https://git.kernel.org/broonie/misc/c/172888114dda [03/24] ASoC: amd: ps: Fix acp63_sdw_dma_close() being skipped on rollback https://git.kernel.org/broonie/misc/c/45dd2b22ea89 [04/24] ASoC: amd: raven: Fix acp3x_dma_close() being skipped on rollback https://git.kernel.org/broonie/misc/c/37ceef26df57 [05/24] ASoC: amd: renoir: Fix acp_pdm_dma_close() being skipped on rollback https://git.kernel.org/broonie/misc/c/a92571113ef2 [06/24] ASoC: amd: vangogh: Fix acp5x_dma_close() being skipped on rollback https://git.kernel.org/broonie/misc/c/38559fcd1c51 [07/24] ASoC: amd: yc: Fix acp6x_pdm_dma_close() being skipped on rollback https://git.kernel.org/broonie/misc/c/06654a3ef513 [08/24] ASoC: apple: mca: Ensure the DAI is marked as started on success https://git.kernel.org/broonie/misc/c/4d23ef7515dd [09/24] ASoC: atmel: atmel-pcm-pdc: Fix atmel_pcm_close() being skipped on rollback https://git.kernel.org/broonie/misc/c/50aaca643038 [10/24] ASoC: codecs: cs42l42: Ensure the DAI is marked as started on success https://git.kernel.org/broonie/misc/c/c2a3d0b2be0c [11/24] ASoC: codecs: nau8325: Ensure the DAI is marked as started on success https://git.kernel.org/broonie/misc/c/0634e7b24727 [12/24] ASoC: codecs: nau8540: Ensure the DAI is marked as started on success https://git.kernel.org/broonie/misc/c/1de1fd7c69a3 [13/24] ASoC: codecs: nau8821: Ensure the DAI is marked as started on success https://git.kernel.org/broonie/misc/c/fc5da89a0a8a [14/24] ASoC: codecs: nau8824: Ensure the DAI is marked as started on success https://git.kernel.org/broonie/misc/c/e66285731262 [15/24] ASoC: codecs: nau8825: Ensure the DAI is marked as started on success https://git.kernel.org/broonie/misc/c/552944e3b027 [16/24] ASoC: codecs: wm8580: Ensure the DAI is marked as started on success https://git.kernel.org/broonie/misc/c/b2c81f056c53 [17/24] ASoC: codecs: wm8782: Ensure the DAI is marked as started on success https://git.kernel.org/broonie/misc/c/29f52545ada7 [18/24] ASoC: imx-pcm-rpmsg: Fix imx_rpmsg_pcm_close() being skipped on rollback https://git.kernel.org/broonie/misc/c/85e56c3bbb7e [19/24] ASoC: intel: atom: Fix .shutdown() being skipped on rollback https://git.kernel.org/broonie/misc/c/e3bb57581104 [20/24] ASoC: renesas: fsi: Ensure the component is marked as opened on success https://git.kernel.org/broonie/misc/c/6bba4e5a171c [21/24] ASoC: renesas: msiof: Fix msiof_close() being skipped on rollback https://git.kernel.org/broonie/misc/c/b7c58a55fd9b [22/24] ASoC: renesas: rz-ssi: Ensure the component is marked as opened on success https://git.kernel.org/broonie/misc/c/fd5c45166d65 [23/24] ASoC: rockchip: rk3399_gru_sound: Mark the link as started on success https://git.kernel.org/broonie/misc/c/8a43611c834f [24/24] ASoC: rockchip: rockchip_max98090: Mark the link as started on success https://git.kernel.org/broonie/misc/c/303961c7daf1
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