* [PATCH] ASoC: SOF: imx8: check imx_sc_pm_cpu_start() return value
@ 2026-09-02 17:55 Ștefan Ghețu
2026-09-07 18:04 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Ștefan Ghețu @ 2026-09-02 17:55 UTC (permalink / raw)
To: lgirdwood, peter.ujfalusi, yung-chuan.liao, daniel.baluta,
broonie
Cc: kai.vehmanen, pierre-louis.bossart, perex, tiwai,
sound-open-firmware, linux-sound, linux-kernel,
Ștefan Ghețu
imx8_run(), imx8x_run() and imx8_shutdown() check the return value of
every imx_sc_misc_set_control() call but ignore the one from
imx_sc_pm_cpu_start(), which propagates errors from imx_scu_call_rpc()
and can fail with -ETIMEDOUT, -EINVAL or -EPERM.
Reporting success after a failed start leaves the caller loading
firmware onto a core that is not running, and a failed shutdown is
similarly hidden from imx_chip_core_shutdown() callers, which do act on
the return value.
Propagate the error, matching imx95_core_shutdown() in imx9.c.
Signed-off-by: Ștefan Ghețu <stefanghetu9@gmail.com>
---
sound/soc/sof/imx/imx8.c | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c
index c2b4d379a3a3a..0820724dbb349 100644
--- a/sound/soc/sof/imx/imx8.c
+++ b/sound/soc/sof/imx/imx8.c
@@ -41,13 +41,18 @@ struct imx8m_chip_data {
static int imx8_shutdown(struct snd_sof_dev *sdev)
{
+ int ret;
/*
* Force the DSP to stall. After the firmware image is loaded,
* the stall will be removed during run() by a matching
* imx_sc_pm_cpu_start() call.
*/
- imx_sc_pm_cpu_start(get_chip_pdata(sdev), IMX_SC_R_DSP, false,
- RESET_VECTOR_VADDR);
+ ret = imx_sc_pm_cpu_start(get_chip_pdata(sdev), IMX_SC_R_DSP, false,
+ RESET_VECTOR_VADDR);
+ if (ret < 0) {
+ dev_err(sdev->dev, "Error stalling DSP core %d\n", ret);
+ return ret;
+ }
return 0;
}
@@ -88,8 +93,12 @@ static int imx8x_run(struct snd_sof_dev *sdev)
return ret;
}
- imx_sc_pm_cpu_start(get_chip_pdata(sdev), IMX_SC_R_DSP, true,
- RESET_VECTOR_VADDR);
+ ret = imx_sc_pm_cpu_start(get_chip_pdata(sdev), IMX_SC_R_DSP, true,
+ RESET_VECTOR_VADDR);
+ if (ret < 0) {
+ dev_err(sdev->dev, "Error starting DSP %d\n", ret);
+ return ret;
+ }
return 0;
}
@@ -105,8 +114,12 @@ static int imx8_run(struct snd_sof_dev *sdev)
return ret;
}
- imx_sc_pm_cpu_start(get_chip_pdata(sdev), IMX_SC_R_DSP, true,
- RESET_VECTOR_VADDR);
+ ret = imx_sc_pm_cpu_start(get_chip_pdata(sdev), IMX_SC_R_DSP, true,
+ RESET_VECTOR_VADDR);
+ if (ret < 0) {
+ dev_err(sdev->dev, "Error starting DSP %d\n", ret);
+ return ret;
+ }
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: SOF: imx8: check imx_sc_pm_cpu_start() return value
2026-09-02 17:55 [PATCH] ASoC: SOF: imx8: check imx_sc_pm_cpu_start() return value Ștefan Ghețu
@ 2026-09-07 18:04 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-09-07 18:04 UTC (permalink / raw)
To: lgirdwood, peter.ujfalusi, yung-chuan.liao, daniel.baluta,
Ștefan Ghețu
Cc: kai.vehmanen, pierre-louis.bossart, perex, tiwai,
sound-open-firmware, linux-sound, linux-kernel
On Wed, 02 Sep 2026 20:55:17 +0300, Ștefan Ghețu wrote:
> ASoC: SOF: imx8: check imx_sc_pm_cpu_start() return value
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4
Thanks!
[1/1] ASoC: SOF: imx8: check imx_sc_pm_cpu_start() return value
https://git.kernel.org/broonie/sound/c/88be49b2f848
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-09-07 18:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-02 17:55 [PATCH] ASoC: SOF: imx8: check imx_sc_pm_cpu_start() return value Ștefan Ghețu
2026-09-07 18:04 ` Mark Brown
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.