[PATCH] media: hantro: release runtime resources when device_run fails
Tharit Tangkijwanichakul
tharitt97 at gmail.com
Fri Jul 24 05:44:00 PDT 2026
> But right below this, you are still letting
>
> if (ctx->codec_ops->run(ctx))
> goto err_cancel_job;
>
> without disabling the clocks.
>
> >
> > @@ -191,8 +192,12 @@ static void device_run(void *priv)
> >
> > return;
> >
> > +err_disable_clock:
> > + clk_bulk_disable(vpu->variant->num_clocks, ctx->dev->clocks);
>
> You have added vpu = ctx->dev, why not use vpu->clocks as second
> parameter?
>
> > +err_pm_put_autosuspend:
> > + pm_runtime_put_autosuspend(vpu->dev);
> > err_cancel_job:
> > - hantro_job_finish_no_pm(ctx->dev, ctx, VB2_BUF_STATE_ERROR);
> > + hantro_job_finish_no_pm(vpu, ctx, VB2_BUF_STATE_ERROR);
>
> Why are you changing ctx->dev to vpu here, but not in the other
> function calls in device_run(), e.g. pm_runtime_resume_and_get() and
> clk_bulk_enable() above?
>
> regards
> Philipp
Hi Philipp,
This is embarrassing. I did notice this, made a local change and
forgot to re-run git add.
I will fix this asap and send a v2.
Best,
Tharit
More information about the Linux-rockchip
mailing list