From: Boris Brezillon <boris.brezillon@collabora.com>
To: "Boris Brezillon" <boris.brezillon@collabora.com>,
"Steven Price" <steven.price@arm.com>,
"Liviu Dudau" <liviu.dudau@arm.com>,
"Adrián Larumbe" <adrian.larumbe@collabora.com>
Cc: 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: Wed, 13 Nov 2024 16:54:34 +0100 [thread overview]
Message-ID: <20241113165434.2843abe7@collabora.com> (raw)
In-Reply-To: <20241113154257.1971284-3-boris.brezillon@collabora.com>
On Wed, 13 Nov 2024 16:42:54 +0100
Boris Brezillon <boris.brezillon@collabora.com> wrote:
> @@ -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);
Okay, I always get confused by pm_runtime_get_sync(). Turns out the
refcount is incremented even if pm_runtime_get_sync() fails, so we
should call pm_runtime_put_sync_suspend() unconditionally here.
next prev parent reply other threads:[~2024-11-13 15:54 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 [this message]
2024-11-13 15:59 ` Boris Brezillon
2024-11-14 11:13 ` Liviu Dudau
2024-11-14 11:27 ` Boris Brezillon
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=20241113165434.2843abe7@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.