From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/tyr: replace fixed sleeps with read_poll_timeout
Date: Mon, 09 Mar 2026 08:02:34 +1000 [thread overview]
Message-ID: <review-patch1-20260307204708.60398-1-iprintercanon@gmail.com> (raw)
In-Reply-To: <20260307204708.60398-1-iprintercanon@gmail.com>
Patch Review
**Positive aspects:**
- Commit message is well-written with clear rationale and per-function timeout justification.
- The conversion correctly uses the `read_poll_timeout` API, matching its signature (`op`, `cond`, `sleep_delta`, `timeout_delta`).
- Error code change from `EIO` to `ETIMEDOUT` is appropriate (and the commit message correctly notes no callers inspect the specific error code).
**Issues:**
1. **Polling intervals differ from what landed upstream.** For `l2_power_on`, the patch uses:
```rust
Delta::from_micros(100),
Delta::from_millis(20),
```
The commit message says this "matches the C panthor driver," which may be true for the C driver's values, but the version that landed in drm-next uses `Delta::from_millis(1)` / `Delta::from_millis(100)`. The 100µs poll interval is quite aggressive and may cause unnecessary CPU overhead on slow hardware. On the other hand, 20ms total timeout could be too tight for some platforms. The maintainer clearly chose more conservative values.
2. **`.map(|_| ())` pattern vs `?` + `Ok(())`.** The patch uses:
```rust
.map(|_| ())
.inspect_err(|_| dev_err!(dev, "soft reset timed out\n"))
```
The version that landed uses the more idiomatic:
```rust
.inspect_err(|_| dev_err!(dev, "GPU reset failed."))?;
Ok(())
```
The `.map(|_| ())` approach works but is slightly less clear than the `?` + `Ok(())` pattern, which makes the error propagation path more explicit and is a more common Rust idiom.
3. **Trailing `\n` in error messages.** The patch includes `\n` in `dev_err!` strings (e.g., `"soft reset timed out\n"`). The kernel `dev_err!` macro already appends a newline, so the explicit `\n` would result in a double newline. The landed version correctly omits it (e.g., `"GPU reset failed."`).
4. **Lost diagnostic information in `issue_soft_reset`.** The original code printed the raw register value on failure:
```rust
dev_err!(dev, "GPU_INT_RAWSTAT is {}\n",
regs::GPU_IRQ_RAWSTAT.read(dev, iomem)?
);
```
The patch replaces this with just `"soft reset timed out"`, losing useful debug information. While `read_poll_timeout` makes it harder to report the last polled value (since it's consumed internally), this is a minor regression in debuggability.
**Verdict:** The change itself is correct and addresses a real TODO. However, since this work has already landed in drm-next, this patch is moot. If it were being reviewed for merge, the main feedback would be: fix the double-newline issue, consider using `?` + `Ok(())` instead of `.map(|_| ())`, and verify the timeout values are appropriate for all supported platforms.
---
Generated by Claude Code Patch Reviewer
prev parent reply other threads:[~2026-03-08 22:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-07 20:47 [PATCH] drm/tyr: replace fixed sleeps with read_poll_timeout Artem Lytkin
2026-03-08 22:02 ` Claude review: " Claude Code Review Bot
2026-03-08 22:02 ` Claude Code Review Bot [this message]
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-patch1-20260307204708.60398-1-iprintercanon@gmail.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