From: Boris Brezillon <boris.brezillon@collabora.com>
To: Liviu Dudau <liviu.dudau@arm.com>
Cc: "Steven Price" <steven.price@arm.com>,
"Adrián Larumbe" <adrian.larumbe@collabora.com>,
dri-devel@lists.freedesktop.org, kernel@collabora.com
Subject: Re: [PATCH 2/5] drm/panthor: Be robust against runtime PM resume failures in the suspend path
Date: Thu, 14 Nov 2024 12:27:55 +0100 [thread overview]
Message-ID: <20241114122755.7dfb7bef@collabora.com> (raw)
In-Reply-To: <ZzXbWUtF_oxWXl9G@e110455-lin.cambridge.arm.com>
On Thu, 14 Nov 2024 11:13:29 +0000
Liviu Dudau <liviu.dudau@arm.com> wrote:
> On Wed, Nov 13, 2024 at 04:42:54PM +0100, Boris Brezillon wrote:
> > The runtime PM resume operation is not guaranteed to succeed, but if it
> > fails, the device should be in a suspended state. Make sure we're robust
> > to resume failures in the unplug path.
> >
> > Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> > ---
> > drivers/gpu/drm/panthor/panthor_device.c | 23 ++++++++---------------
> > drivers/gpu/drm/panthor/panthor_fw.c | 14 +++++++++-----
> > drivers/gpu/drm/panthor/panthor_gpu.c | 3 ++-
> > drivers/gpu/drm/panthor/panthor_mmu.c | 3 ++-
> > 4 files changed, 21 insertions(+), 22 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/panthor/panthor_device.c b/drivers/gpu/drm/panthor/panthor_device.c
> > index db7ba40f771d..8b5d54b2bbb4 100644
> > --- a/drivers/gpu/drm/panthor/panthor_device.c
> > +++ b/drivers/gpu/drm/panthor/panthor_device.c
> > @@ -48,6 +48,8 @@ static int panthor_clk_init(struct panthor_device *ptdev)
> >
> > void panthor_device_unplug(struct panthor_device *ptdev)
> > {
> > + int ret;
> > +
> > /* This function can be called from two different path: the reset work
> > * and the platform device remove callback. drm_dev_unplug() doesn't
> > * deal with concurrent callers, so we have to protect drm_dev_unplug()
> > @@ -74,7 +76,8 @@ void panthor_device_unplug(struct panthor_device *ptdev)
> > */
> > mutex_unlock(&ptdev->unplug.lock);
> >
> > - drm_WARN_ON(&ptdev->base, pm_runtime_get_sync(ptdev->base.dev) < 0);
> > + ret = pm_runtime_get_sync(ptdev->base.dev);
> > + drm_WARN_ON(&ptdev->base, ret < 0);
> >
> > /* Now, try to cleanly shutdown the GPU before the device resources
> > * get reclaimed.
> > @@ -85,7 +88,10 @@ void panthor_device_unplug(struct panthor_device *ptdev)
> > panthor_gpu_unplug(ptdev);
> >
> > pm_runtime_dont_use_autosuspend(ptdev->base.dev);
> > - pm_runtime_put_sync_suspend(ptdev->base.dev);
> > +
> > + /* If the resume failed, we don't need to suspend here. */
> > + if (!ret)
> > + pm_runtime_put_sync_suspend(ptdev->base.dev);
> >
> > /* If PM is disabled, we need to call the suspend handler manually. */
> > if (!IS_ENABLED(CONFIG_PM))
> > @@ -541,17 +547,4 @@ int panthor_device_suspend(struct device *dev)
> > clk_disable_unprepare(ptdev->clks.core);
> > atomic_set(&ptdev->pm.state, PANTHOR_DEVICE_PM_STATE_SUSPENDED);
> > return 0;
> > -
> > -err_set_active:
>
> Label is being deleted here, but I don't see where the `goto err_set_active` is being removed.
Yes, as mentioned in my own reply, this chunk should be in patch 3.
next prev parent reply other threads:[~2024-11-14 11:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-13 15:42 [PATCH 0/5] drm/panthor: Be robust against failures in the resume path Boris Brezillon
2024-11-13 15:42 ` [PATCH 1/5] drm/panthor: Preserve the result returned by panthor_fw_resume() Boris Brezillon
2024-11-14 10:50 ` Steven Price
2024-11-13 15:42 ` [PATCH 2/5] drm/panthor: Be robust against runtime PM resume failures in the suspend path Boris Brezillon
2024-11-13 15:54 ` Boris Brezillon
2024-11-13 15:59 ` Boris Brezillon
2024-11-14 11:13 ` Liviu Dudau
2024-11-14 11:27 ` Boris Brezillon [this message]
2024-11-14 11:36 ` Liviu Dudau
2024-11-13 15:42 ` [PATCH 3/5] drm/panthor: Ignore devfreq_{suspend, resume}_device() failures Boris Brezillon
2024-11-14 10:50 ` Steven Price
2024-11-13 15:42 ` [PATCH 4/5] drm/panthor: Be robust against resume failures Boris Brezillon
2024-11-14 10:51 ` Steven Price
2024-11-14 11:24 ` Boris Brezillon
2024-11-13 15:42 ` [PATCH 5/5] drm/panthor: Fix the fast-reset logic Boris Brezillon
2024-11-14 10:51 ` Steven Price
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241114122755.7dfb7bef@collabora.com \
--to=boris.brezillon@collabora.com \
--cc=adrian.larumbe@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel@collabora.com \
--cc=liviu.dudau@arm.com \
--cc=steven.price@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.