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: Fri, 13 Mar 2026 13:47:07 +1000 [thread overview]
Message-ID: <review-patch4-20260312-v3d-power-management-v7-4-9f006a1d4c55@igalia.com> (raw)
In-Reply-To: <20260312-v3d-power-management-v7-4-9f006a1d4c55@igalia.com>
Patch Review
This is the key preparation patch that reorders probe to do all resource allocation before enabling the clock. The reordering is correct: `map_regs`, `devm_reset_control_get_optional_exclusive`, `devm_clk_get_optional`, `v3d_irq_init`, `v3d_perfmon_init`, `dma_alloc_wc`, and `v3d_gem_init` all happen before `clk_prepare_enable`.
A few notes:
1. **Error path ordering concern**: The error cleanup labels are:
```c
clk_disable:
v3d_power_off_sms(v3d);
clk_disable_unprepare(v3d->clk);
gem_destroy:
v3d_gem_destroy(drm);
dma_free:
dma_free_wc(dev, 4096, v3d->mmu_scratch, v3d->mmu_scratch_paddr);
```
The labels fall through, so `clk_disable` falls through to `gem_destroy` and `dma_free`. This is correct — if the clock was enabled and something later fails, all three cleanups happen. But `gem_destroy` and `dma_free` are only reached by `goto` from before the clock is enabled, so `clk_disable` cleanup is never incorrectly reached from those paths. Good.
2. The `v3d_init_hw_state` and `v3d_mmu_set_page_table` calls are correctly moved out of `v3d_gem_init` and into the post-clock-enable section. The `v3d_irq_enable` call is likewise moved out of `v3d_irq_init` and into the post-clock-enable section. This is a clean separation.
3. **Extra blank line** in `v3d_gem.c` after `v3d_init_hw_state()`:
```c
+void
+v3d_init_hw_state(struct v3d_dev *v3d)
+{
+ v3d_init_core(v3d, 0);
+}
+
+
static void
```
There's a double blank line — minor style nit.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-13 3:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
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 1/5] clk: bcm: rpi: Manage clock rate in prepare/unprepare callbacks Maíra Canal
2026-03-13 3:47 ` Claude review: " Claude Code Review Bot
2026-03-12 21:34 ` [PATCH v7 2/5] pmdomain: bcm: bcm2835-power: Increase ASB control timeout Maíra Canal
2026-03-13 3:47 ` Claude review: " Claude Code Review Bot
2026-03-12 21:34 ` [PATCH v7 3/5] drm/v3d: Use devm_reset_control_get_optional_exclusive() Maíra Canal
2026-03-13 3:47 ` Claude review: " Claude Code Review Bot
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 Code Review Bot [this message]
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-03-13 3:47 ` Claude review: Power Management for Raspberry Pi V3D GPU Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-02-13 18:52 [PATCH v5 0/7] " 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-patch4-20260312-v3d-power-management-v7-4-9f006a1d4c55@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