[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241021161437.4555a490@collabora.com>
Date: Mon, 21 Oct 2024 16:14:37 +0200
From: Boris Brezillon <boris.brezillon@...labora.com>
To: Adrián Larumbe <adrian.larumbe@...labora.com>
Cc: Rob Herring <robh@...nel.org>, Steven Price <steven.price@....com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, Maxime Ripard
<mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>, David Airlie
<airlied@...il.com>, Simona Vetter <simona@...ll.ch>, Philipp Zabel
<p.zabel@...gutronix.de>, kernel@...labora.com,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/9] drm/panfrost: handle job hw submit errors
On Tue, 15 Oct 2024 00:31:39 +0100
Adrián Larumbe <adrian.larumbe@...labora.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;
> }
Powered by blists - more mailing lists