From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/v3d: Introduce Runtime Power Management Date: Tue, 31 Mar 2026 17:53:43 +1000 Message-ID: In-Reply-To: <20260328-v3d-power-management-v8-3-94336830df5f@igalia.com> References: <20260328-v3d-power-management-v8-0-94336830df5f@igalia.com> <20260328-v3d-power-management-v8-3-94336830df5f@igalia.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Status: Looks good overall with minor observations.** This is the main patch. The implementation follows standard runtime PM patt= erns well. **v3d_power.c:** The suspend/resume callbacks are clean =E2=80=94 disable I= RQs, power off SMS, disable clock on suspend; reverse on resume. The `v3d_r= esume_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 `v= 3d_power_resume()` manually is the right pattern. The 100ms autosuspend del= ay (bumped from 50ms in v7 due to RPi 4 issues) seems reasonable. **Job submission (v3d_submit.c):** Acquiring a PM reference in `v3d_job_ini= t()` for non-CPU jobs and releasing it in `v3d_job_free()` is a clean appro= ach =E2=80=94 it keeps the GPU powered while jobs are in flight. The `has_p= m_ref` flag prevents double-put. **MMU flush (v3d_mmu.c):** Using `pm_runtime_get_if_active()` to skip the f= lush when the device is already suspended is correct =E2=80=94 if the GPU i= s off, the page tables will be reloaded on resume anyway. **Perfmon (v3d_perfmon.c):** Similarly using `pm_runtime_get_if_active()` i= n `v3d_perfmon_start()` and `v3d_perfmon_stop()` is correct. In `v3d_perfmo= n_stop()`, the `out_clear` label that clears `active_perfmon` even when the= device is suspended makes sense =E2=80=94 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 =E2=80=94 most dr= ivers 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_runti= me_suspend()` forces the device to suspend state before tearing down resour= ces, which is fine. **One question:** In `v3d_get_param_ioctl()`, the PM get/put wraps the regi= ster reads, but for the `DRM_V3D_PARAM_SUPPORTS_*` cases (which return cons= tant values), the function returns early before hitting the PM calls. This = is correct =E2=80=94 no HW access needed for those params. Overall this is a well-tested series (v8!) with proper review tags. The cod= e is clean and follows kernel runtime PM conventions correctly. --- Generated by Claude Code Patch Reviewer