remoteproc: qcom: adsp: Remove subdevs on the error path of adsp_probe()

BugLink: https://bugs.launchpad.net/bugs/2101915

[ Upstream commit fe80d3205e91e36e67f4d3d6c326793298d15766 ]

Current implementation of adsp_probe() in qcom_q6v5_adsp.c and does not
remove the subdevs of adsp on the error path. Fix this bug by calling
qcom_remove_{ssr,sysmon,pdm,smd,glink}_subdev(), and qcom_q6v5_deinit()
appropriately.

Fixes: dc160e4491 ("remoteproc: qcom: Introduce Non-PAS ADSP PIL driver")
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Link: https://lore.kernel.org/r/fed3df4219543d46b88bacf87990d947f3fac8d7.1731038950.git.joe@pf.is.s.u-tokyo.ac.jp
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[koichiroden: dropped qcom_remove_pdm_subdev() invocation due to missing
5b9f51b200dc ("remoteproc: qcom: enable in-kernel PD mapper")]
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
This commit is contained in:
Joe Hattori
2025-03-11 08:51:19 +09:00
committed by Stefan Bader
parent e3e68c0e7e
commit 5b8733e29a
+8 -2
View File
@@ -743,15 +743,21 @@ static int adsp_probe(struct platform_device *pdev)
desc->ssctl_id);
if (IS_ERR(adsp->sysmon)) {
ret = PTR_ERR(adsp->sysmon);
goto disable_pm;
goto deinit_remove_glink_pdm_ssr;
}
ret = rproc_add(rproc);
if (ret)
goto disable_pm;
goto remove_sysmon;
return 0;
remove_sysmon:
qcom_remove_sysmon_subdev(adsp->sysmon);
deinit_remove_glink_pdm_ssr:
qcom_q6v5_deinit(&adsp->q6v5);
qcom_remove_glink_subdev(rproc, &adsp->glink_subdev);
qcom_remove_ssr_subdev(rproc, &adsp->ssr_subdev);
disable_pm:
qcom_rproc_pds_detach(adsp, adsp->proxy_pds, adsp->proxy_pd_count);