From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/v3d: Allocate all resources before enabling the clock
Date: Tue, 31 Mar 2026 17:53:43 +1000 [thread overview]
Message-ID: <review-patch2-20260328-v3d-power-management-v8-2-94336830df5f@igalia.com> (raw)
In-Reply-To: <20260328-v3d-power-management-v8-2-94336830df5f@igalia.com>
Patch Review
**Status: Looks good, one minor nit.**
This patch reorders probe so that all resource allocation (reg mapping, reset control, clk get, IRQ init, perfmon init, DMA alloc, gem init) happens before the clock is enabled and HW is accessed. This is the right preparation for runtime PM.
Key changes:
- `v3d_init_hw_state()` and `v3d_mmu_set_page_table()` are moved out of `v3d_gem_init()` and called explicitly after `clk_prepare_enable()`. `v3d_init_hw_state()` is made non-static (exported via header).
- `v3d_irq_init()` is split: registration happens early, but `v3d_irq_enable()` (which touches HW) is deferred until after the clock is on. The interrupt clearing is moved from `v3d_irq_init()` into `v3d_irq_enable()`, which makes sense since it needs HW access.
- The remove order is corrected to be the reverse of init (clock disable before gem_destroy, as the gem layer shouldn't need HW at teardown).
**Minor nit:** In `v3d_gem.c` after moving `v3d_init_hw_state()`, there's a double blank line:
```c
void
v3d_init_hw_state(struct v3d_dev *v3d)
{
v3d_init_core(v3d, 0);
}
static void
v3d_huge_mnt_init(struct v3d_dev *v3d)
```
One blank line would be sufficient per kernel style.
**One concern about the error paths:** After the reorder, there's a potential issue in the probe error cleanup. The `irq_disable` label calls `v3d_irq_disable(v3d)`, but now falls through to `clk_disable` which calls `v3d_power_off_sms(v3d)` and `clk_disable_unprepare(v3d->clk)`, then to `gem_destroy` and `dma_free`. This ordering looks correct — if `drm_dev_register()` fails, we need to disable IRQs, turn off the clock, then clean up gem/dma. The label ordering in the diff (`irq_disable` → `clk_disable` → `gem_destroy` → `dma_free`) correctly reverses the init sequence.
---
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 Code Review Bot [this message]
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 review: " Claude Code Review Bot
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 2/3] drm/v3d: Allocate all resources before enabling the clock 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 4/5] drm/v3d: Allocate all resources before enabling the clock 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:52 ` [PATCH v5 6/7] drm/v3d: Allocate all resources before enabling the clock 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-patch2-20260328-v3d-power-management-v8-2-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