From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/v3d: Introduce Runtime Power Management
Date: Tue, 31 Mar 2026 17:53:43 +1000 [thread overview]
Message-ID: <review-patch3-20260328-v3d-power-management-v8-3-94336830df5f@igalia.com> (raw)
In-Reply-To: <20260328-v3d-power-management-v8-3-94336830df5f@igalia.com>
Patch Review
**Status: Looks good overall with minor observations.**
This is the main patch. The implementation follows standard runtime PM patterns well.
**v3d_power.c:** The suspend/resume callbacks are clean — disable IRQs, power off SMS, disable clock on suspend; reverse on resume. The `v3d_resume_sms`/`v3d_suspend_sms` are direct moves from the old `v3d_idle_sms`/`v3d_power_off_sms` with appropriate renames.
**Probe changes:** The transition from direct `clk_prepare_enable()` to `pm_runtime_resume_and_get()` is correct. The `CONFIG_PM` guard for calling `v3d_power_resume()` manually is the right pattern. The 100ms autosuspend delay (bumped from 50ms in v7 due to RPi 4 issues) seems reasonable.
**Job submission (v3d_submit.c):** Acquiring a PM reference in `v3d_job_init()` for non-CPU jobs and releasing it in `v3d_job_free()` is a clean approach — it keeps the GPU powered while jobs are in flight. The `has_pm_ref` flag prevents double-put.
**MMU flush (v3d_mmu.c):** Using `pm_runtime_get_if_active()` to skip the flush when the device is already suspended is correct — if the GPU is off, the page tables will be reloaded on resume anyway.
**Perfmon (v3d_perfmon.c):** Similarly using `pm_runtime_get_if_active()` in `v3d_perfmon_start()` and `v3d_perfmon_stop()` is correct. In `v3d_perfmon_stop()`, the `out_clear` label that clears `active_perfmon` even when the device is suspended makes sense — we still need to track that the perfmon is no longer active.
**Debugfs:** Adding `v3d_pm_runtime_get()`/`v3d_pm_runtime_put()` around HW register reads in debugfs is correct.
**Minor observation on v3d_platform_drm_remove():**
```c
pm_runtime_suspend(dev);
/* If PM is disabled, we need to call v3d_power_suspend() manually. */
if (!IS_ENABLED(CONFIG_PM))
v3d_power_suspend(dev);
```
Using `pm_runtime_suspend()` directly is slightly unusual — most drivers use `pm_runtime_disable()` + `pm_runtime_set_suspended()` or rely on `devm_pm_runtime_enable()` cleanup. However since `devm_pm_runtime_enable()` is used, the disable will happen via devm cleanup. The explicit `pm_runtime_suspend()` forces the device to suspend state before tearing down resources, which is fine.
**One question:** In `v3d_get_param_ioctl()`, the PM get/put wraps the register reads, but for the `DRM_V3D_PARAM_SUPPORTS_*` cases (which return constant values), the function returns early before hitting the PM calls. This is correct — no HW access needed for those params.
Overall this is a well-tested series (v8!) with proper review tags. The code is clean and follows kernel runtime PM conventions correctly.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-31 7:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-28 18:52 [PATCH v8 0/3] Power Management for Raspberry Pi V3D GPU Maíra Canal
2026-03-28 18:52 ` [PATCH v8 1/3] drm/v3d: Use devm_reset_control_get_optional_exclusive() Maíra Canal
2026-03-30 18:43 ` Florian Fainelli
2026-03-31 7:53 ` Claude review: " Claude Code Review Bot
2026-03-28 18:52 ` [PATCH v8 2/3] drm/v3d: Allocate all resources before enabling the clock Maíra Canal
2026-03-30 18:44 ` Florian Fainelli
2026-03-31 7:53 ` Claude review: " Claude Code Review Bot
2026-03-28 18:52 ` [PATCH v8 3/3] drm/v3d: Introduce Runtime Power Management Maíra Canal
2026-03-30 18:46 ` Florian Fainelli
2026-03-31 7:53 ` Claude Code Review Bot [this message]
2026-03-31 7:53 ` Claude review: Power Management for Raspberry Pi V3D GPU Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-03-31 12:35 [PATCH v9 0/3] " Maíra Canal
2026-03-31 12:35 ` [PATCH v9 3/3] drm/v3d: Introduce Runtime Power Management Maíra Canal
2026-03-31 21:45 ` Claude review: " Claude Code Review Bot
2026-03-12 21:34 [PATCH v7 0/5] Power Management for Raspberry Pi V3D GPU Maíra Canal
2026-03-12 21:34 ` [PATCH v7 5/5] drm/v3d: Introduce Runtime Power Management Maíra Canal
2026-03-13 3:47 ` Claude review: " Claude Code Review Bot
2026-02-13 18:52 [PATCH v5 0/7] Power Management for Raspberry Pi V3D GPU Maíra Canal
2026-02-13 18:53 ` [PATCH v5 7/7] drm/v3d: Introduce Runtime Power Management Maíra Canal
2026-02-13 21:21 ` Claude review: " 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-patch3-20260328-v3d-power-management-v8-3-94336830df5f@igalia.com \
--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