From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: gpu: drm: tyr: use IoMem directly instead of Devres
Date: Wed, 27 May 2026 15:26:03 +1000 [thread overview]
Message-ID: <review-patch2-20260525230152.277820-3-dakr@kernel.org> (raw)
In-Reply-To: <20260525230152.277820-3-dakr@kernel.org>
Patch Review
This patch makes `IoMem` lifetime-parameterized and removes the `Devres`/`Arc` wrapping:
```rust
-pub(crate) type IoMem = kernel::io::mem::IoMem<'static, SZ_2M>;
+pub(crate) type IoMem<'a> = kernel::io::mem::IoMem<'a, SZ_2M>;
```
The probe path is simplified from:
```rust
let iomem = Arc::new(request.iomap_sized::<SZ_2M>()?.into_devres()?, GFP_KERNEL)?;
```
to:
```rust
let iomem = request.iomap_sized::<SZ_2M>()?;
```
And all consumers are simplified by removing the `(*iomem).access(dev)?` pattern — functions now take `&IoMem<'_>` directly and call methods on it.
**Minor issue — unused import of `Bound` in gpu.rs:**
In `gpu.rs`, patch 2 removes both uses of `Bound` (in `GpuInfo::new` and `l2_power_on`), but the import is left behind:
```rust
device::{
Bound, // <-- no longer used after this patch
Device, //
},
```
After this patch, `Bound` has no remaining uses in `gpu.rs`. `Device` is still needed (for `l2_power_on`'s `dev` parameter used in error logging), but `Bound` should be removed from the import list to avoid an unused-import warning/error. Kernel Rust builds typically have strict lint settings that would catch this.
Otherwise the patch is correct and the simplification is welcome — removing the `Devres` access pattern from the polling closures in `issue_soft_reset` and `l2_power_on` is particularly nice, as the previous code had to re-acquire the `Devres` access on every poll iteration.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-27 5:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-25 23:01 [PATCH 0/2] drm: tyr: use lifetime-bound IoMem Danilo Krummrich
2026-05-25 23:01 ` [PATCH 1/2] gpu: drm: tyr: separate driver type from driver data Danilo Krummrich
2026-05-26 1:17 ` Eliot Courtney
2026-05-26 6:43 ` Boris Brezillon
2026-05-27 5:26 ` Claude review: " Claude Code Review Bot
2026-05-25 23:01 ` [PATCH 2/2] gpu: drm: tyr: use IoMem directly instead of Devres Danilo Krummrich
2026-05-26 1:30 ` Alexandre Courbot
2026-05-26 2:43 ` Eliot Courtney
2026-05-27 5:26 ` Claude Code Review Bot [this message]
2026-05-27 5:26 ` Claude review: drm: tyr: use lifetime-bound IoMem 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-20260525230152.277820-3-dakr@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