From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: Re: [PATCH v2 6/7] drm/panfrost: Fix PM usage_count mishandling
Date: Fri, 05 Jun 2026 06:16:25 +1000 [thread overview]
Message-ID: <review-patch6-20260604175050.A09181F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260604175050.A09181F00893@smtp.kernel.org>
Patch Review
**Verdict: This is the key bug fix. Looks correct.**
The fix adds `pm_runtime_get_noresume()` after `pm_runtime_enable()` to increment the usage count (since the device is already active), then adds `pm_runtime_put_autosuspend()` after `drm_dev_register()` to allow eventual autosuspend.
```c
pm_runtime_set_active(pfdev->base.dev);
pm_runtime_mark_last_busy(pfdev->base.dev);
pm_runtime_enable(pfdev->base.dev);
pm_runtime_get_noresume(pfdev->base.dev); // NEW: count=1, device stays active
...
drm_dev_register(&pfdev->base, 0);
...
pm_runtime_put_autosuspend(pfdev->base.dev); // NEW: count=0, autosuspend starts
```
The error path adds `pm_runtime_put_noidle` to balance the `get_noresume`.
In `panfrost_remove`, the reordering is:
```c
pm_runtime_get_sync(pfdev->base.dev); // count=1
panfrost_device_fini(pfdev); // teardown while device is active
pm_runtime_put_noidle(pfdev->base.dev); // count=0
pm_runtime_disable(pfdev->base.dev); // disable PM
```
This is correct. Previously `pm_runtime_disable` was called before `panfrost_device_fini`, which could leave the device in an inconsistent state if the fini path needed PM. The new ordering ensures the device is powered on during teardown and the put is balanced before disable.
The commit message clearly explains the symptoms (devfreq OPP notifications, first tiler heap job timeout) and root cause.
---
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-06-04 20:16 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-04 17:35 [PATCH v2 0/7] RPM, perfcnt and other minor fixes for Panfrost Adrián Larumbe
2026-06-04 17:35 ` [PATCH v2 1/7] drm/panfrost: Check another bo field for cache option query Adrián Larumbe
2026-06-04 17:57 ` Boris Brezillon
2026-06-04 20:16 ` Claude review: " Claude Code Review Bot
2026-06-04 17:35 ` [PATCH v2 2/7] drm/panfrost: Prevent division by 0 Adrián Larumbe
2026-06-04 17:44 ` sashiko-bot
2026-06-04 20:16 ` Claude review: " Claude Code Review Bot
2026-06-04 18:02 ` Boris Brezillon
2026-06-04 17:35 ` [PATCH v2 3/7] drm/panfrost: Move shrinker initialization and unplug one level down Adrián Larumbe
2026-06-04 18:04 ` Boris Brezillon
2026-06-04 20:16 ` Claude review: " Claude Code Review Bot
2026-06-04 17:35 ` [PATCH v2 4/7] drm/panfrost: Move perfcnt GPU disable sequence into a helper Adrián Larumbe
2026-06-04 17:47 ` sashiko-bot
2026-06-04 20:16 ` Claude review: " Claude Code Review Bot
2026-06-04 18:05 ` Boris Brezillon
2026-06-04 17:35 ` [PATCH v2 5/7] drm/panfrost: Make reset sequence deal with an active HWPerf session Adrián Larumbe
2026-06-04 17:49 ` sashiko-bot
2026-06-04 20:16 ` Claude review: " Claude Code Review Bot
2026-06-04 18:26 ` Boris Brezillon
2026-06-04 17:35 ` [PATCH v2 6/7] drm/panfrost: Fix PM usage_count mishandling Adrián Larumbe
2026-06-04 17:50 ` sashiko-bot
2026-06-04 20:16 ` Claude Code Review Bot [this message]
2026-06-04 18:36 ` Boris Brezillon
2026-06-04 17:35 ` [PATCH v2 7/7] drm/panfrost: Explicitly enable MMU interrupts at device init Adrián Larumbe
2026-06-04 17:55 ` sashiko-bot
2026-06-04 20:16 ` Claude review: " Claude Code Review Bot
2026-06-04 20:16 ` Claude review: RPM, perfcnt and other minor fixes for Panfrost Claude Code Review Bot
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=review-patch6-20260604175050.A09181F00893@smtp.kernel.org \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox