[PATCH] ASoC: SOF: imx8: check imx_sc_pm_cpu_start() return value
From: Ștefan Ghețu
Date: Wed Sep 02 2026 - 14:34:27 EST
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@xxxxxxxxx>
---
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