From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: gpu: nova-core: fsp: wait to consume message before sending another
Date: Sun, 12 Apr 2026 11:19:36 +1000 [thread overview]
Message-ID: <review-patch1-20260409-b4-blackwell-unload-v1-1-0f5a2ff838dd@nvidia.com> (raw)
In-Reply-To: <20260409-b4-blackwell-unload-v1-1-0f5a2ff838dd@nvidia.com>
Patch Review
**Purpose:** Before sending a new message to FSP via EMEM, poll until the FSP's queue head equals its queue tail, indicating the previous message has been consumed.
The diff adds:
```rust
+ // Wait for FSP to consume any previous message before sending.
+ read_poll_timeout(
+ || {
+ let head = bar.read(regs::NV_PFSP_QUEUE_HEAD).address().get();
+ let tail = bar.read(regs::NV_PFSP_QUEUE_TAIL).address().get();
+ Ok(head == tail)
+ },
+ |&ready| ready,
+ Delta::from_millis(1),
+ Delta::from_secs(2),
+ )?;
```
**Observations:**
- **Correct use of `read_poll_timeout`**: The signature is `(op, cond, sleep_delta, timeout_delta) -> Result<T>`. The `op` closure returns `Ok(bool)`, the `cond` checks `|&ready| ready`, and the `?` propagates the `ETIMEDOUT` error. This matches the established pattern used in `gfw.rs` and elsewhere in nova-core.
- **Timeout value (2 seconds)**: This is reasonable for FSP message consumption. If the FSP is alive and functioning, it should consume messages quickly. 2 seconds is generous enough to handle edge cases without stalling the driver indefinitely.
- **No error context on timeout**: Unlike patch 3 which uses `.inspect_err()` to log a message on timeout, this poll silently returns `ETIMEDOUT`. Consider adding an `.inspect_err()` call to log a message like `"FSP did not consume previous message"` — this would help debug unload/reload failures in the field. Minor nit, not a blocker.
- **Placement before `write_emem`**: This is the correct location — ensuring the queue is drained before writing new data to EMEM and updating the queue tail.
**Verdict:** Looks good. The only suggestion is adding error logging on timeout for consistency with other error paths in the driver.
---
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-04-12 1:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-09 14:19 [PATCH 0/3] gpu: nova-core: unload extras for Hopper/Blackwell Eliot Courtney
2026-04-09 14:19 ` [PATCH 1/3] gpu: nova-core: fsp: wait to consume message before sending another Eliot Courtney
2026-04-12 1:19 ` Claude Code Review Bot [this message]
2026-04-09 14:19 ` [PATCH 2/3] gpu: nova-core: add Architecture::uses_sec2() helper Eliot Courtney
2026-04-12 1:19 ` Claude review: " Claude Code Review Bot
2026-04-09 14:19 ` [PATCH 3/3] gpu: nova-core: add non-sec2 unload path Eliot Courtney
2026-04-12 1:19 ` Claude review: " Claude Code Review Bot
2026-04-12 1:19 ` Claude review: gpu: nova-core: unload extras for Hopper/Blackwell 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-patch1-20260409-b4-blackwell-unload-v1-1-0f5a2ff838dd@nvidia.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