mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
remoteproc: imx_dsp: Acquire runtime PM before adding carveouts
The prepare callback publishes DSP carveouts before acquiring the
runtime-PM reference that establishes required clocks and mailbox state.
A PM failure therefore leaves the prepare transaction partially
published.
Acquire runtime PM first and drop that reference if carveout
construction fails, so a failed prepare does not add resources before
its hardware prerequisite.
Fixes: ec0e5549f3 ("remoteproc: imx_dsp_rproc: Add remoteproc driver for DSP on i.MX")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20260830133310.6926-1-pengpeng@iscas.ac.cn
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
This commit is contained in:
parent
0ea61504f8
commit
13df1fa4f1
|
|
@ -726,14 +726,17 @@ static int imx_dsp_rproc_prepare(struct rproc *rproc)
|
|||
struct device *dev = rproc->dev.parent;
|
||||
int ret;
|
||||
|
||||
ret = pm_runtime_resume_and_get(dev);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = imx_dsp_rproc_add_carveout(priv);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed on imx_dsp_rproc_add_carveout\n");
|
||||
pm_runtime_put_sync(dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
pm_runtime_get_sync(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user