From: sashiko-bot@kernel.org
To: "Adrián Larumbe" <adrian.larumbe@collabora.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/panfrost: Enable cycle counting when perfcnt is enabled
Date: Thu, 15 Oct 2026 18:36:15 +0000 [thread overview]
Message-ID: <sashiko-outbox-173309@kernel.org> (raw)
In-Reply-To: <20261015-panfrost-reset-races-fixes-v1-1-bb74c1786a0b@collabora.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] drm/panfrost: Spurious drm_WARN_ON during GPU reset with active perfcnt
--
commit d9ae50cec3ff06c2a614193efb813114ed5ac709
Author: Boris Brezillon <boris.brezillon@collabora.com>
Date: Thu Oct 15 18:22:31 2026 +0000
drm/panfrost: Enable cycle counting when perfcnt is enabled
If we don't do that, we end up with invalid timestamps in the block
headers.
> diff --git a/drivers/gpu/drm/panfrost/panfrost_perfcnt.c b/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
> index a9def452d5ef9..b26da057a1a01 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
[ ... ]
> @@ -84,6 +86,7 @@ static int panfrost_perfcnt_hw_enable(struct panfrost_device *pfdev)
> return ret;
>
> perfcnt->owns_as_ref = true;
> + panfrost_cycle_counter_get(pfdev);
[Severity: Medium]
Will this cause a spurious drm_WARN_ON() during a GPU reset?
When a GPU reset is triggered (e.g. by a job timeout), panfrost_device_reset()
is called. This function calls panfrost_gpu_soft_reset() before it handles
the perfcnt state via panfrost_perfcnt_reset():
drivers/gpu/drm/panfrost/panfrost_device.c:panfrost_device_reset() {
...
panfrost_gpu_soft_reset(pfdev);
...
panfrost_perfcnt_reset(pfdev);
}
Inside panfrost_gpu_soft_reset(), it expects all cycle counter references
to be released:
drivers/gpu/drm/panfrost/panfrost_gpu.c:panfrost_gpu_soft_reset() {
...
/*
* All in-flight jobs should have released their cycle
* counter references upon reset, but let us make sure
*/
if (drm_WARN_ON(&pfdev->base, atomic_read(&pfdev->cycle_counter.use_count) != 0))
atomic_set(&pfdev->cycle_counter.use_count, 0);
...
}
Because the perfcnt still holds the reference when panfrost_gpu_soft_reset()
is called, won't this trigger the drm_WARN_ON() and potentially panic the kernel
if panic_on_warn is enabled?
>
> as = ret;
> cfg = GPU_PERFCNT_CFG_AS(as) |
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261015-panfrost-reset-races-fixes-v1-0-bb74c1786a0b@collabora.com?part=1
next prev parent reply other threads:[~2026-10-15 18:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 18:22 [PATCH 0/2] Two small perfcnt fixes for Panfrost Adrián Larumbe
2026-10-15 18:22 ` [PATCH 1/2] drm/panfrost: Enable cycle counting when perfcnt is enabled Adrián Larumbe
2026-10-15 18:36 ` sashiko-bot [this message]
2026-10-16 7:23 ` Boris Brezillon
2026-10-16 7:24 ` Boris Brezillon
2026-10-15 18:22 ` [PATCH 2/2] drm/panfrost: Fix race when restoring reset state in perfcnt Adrián Larumbe
2026-10-16 7:24 ` Boris Brezillon
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=sashiko-outbox-173309@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=adrian.larumbe@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
/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.