[PATCH 4/9] drm/panfrost: handle job hw submit errors
Boris Brezillon
boris.brezillon at collabora.com
Mon Oct 21 14:14:37 UTC 2024
On Tue, 15 Oct 2024 00:31:39 +0100
Adrián Larumbe <adrian.larumbe at collabora.com> wrote:
> -static void panfrost_job_hw_submit(struct panfrost_job *job, int js)
> +static int panfrost_job_hw_submit(struct panfrost_job *job, int js)
> {
> struct panfrost_device *pfdev = job->pfdev;
> unsigned int subslot;
> @@ -207,15 +207,15 @@ static void panfrost_job_hw_submit(struct panfrost_job *job, int js)
>
> ret = pm_runtime_get_sync(pfdev->base.dev);
> if (ret < 0)
> - return;
> + return ret;
>
You need to call pm_runtime_put_autosuspend() if something fails after
that point, otherwise you're leaking a runtime-PM ref.
> if (WARN_ON(job_read(pfdev, JS_COMMAND_NEXT(js)))) {
> - return;
> + return -EINVAL;
> }
>
> ret = panfrost_mmu_as_get(pfdev, job->mmu, &cfg);
> if (ret)
> - return;
> + return ret;
>
> job_write(pfdev, JS_HEAD_NEXT_LO(js), lower_32_bits(jc_head));
> job_write(pfdev, JS_HEAD_NEXT_HI(js), upper_32_bits(jc_head));
> @@ -263,6 +263,8 @@ static void panfrost_job_hw_submit(struct panfrost_job *job, int js)
> job, js, subslot, jc_head, cfg & 0xf);
> }
> spin_unlock(&pfdev->js->job_lock);
> +
> + return 0;
> }
More information about the dri-devel
mailing list