public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: gpu: nova-core: add non-sec2 unload path
Date: Sun, 12 Apr 2026 11:19:37 +1000	[thread overview]
Message-ID: <review-patch3-20260409-b4-blackwell-unload-v1-3-0f5a2ff838dd@nvidia.com> (raw)
In-Reply-To: <20260409-b4-blackwell-unload-v1-3-0f5a2ff838dd@nvidia.com>

Patch Review

**Purpose:** Split the `unload()` function so that SEC2-based architectures run the full FWSEC-SB + booter unloader sequence, while non-SEC2 architectures (Hopper/Blackwell using FSP) just wait for the GSP falcon to halt.

```rust
+        if chipset.arch().uses_sec2() {
+            /* Run FWSEC-SB to reset the GSP falcon to its pre-libos state. */
             ...existing FWSEC-SB + booter unloader code...
+        } else {
+            // GSP falcon does most of the work of resetting, so just wait for it to finish.
+            read_poll_timeout(
+                || Ok(gsp_falcon.is_riscv_active(bar)),
+                |&active| !active,
+                Delta::from_millis(10),
+                Delta::from_secs(5),
+            )
+            .inspect_err(|_| dev_err!(dev, "GSP falcon failed to halt\n"))?;
+        }
```

**Observations:**

- **Correct polling logic**: The poll waits for `is_riscv_active()` to return `false`, meaning the GSP falcon has halted. This is the inverse of the boot-time poll which waits for RISC-V to become active. The logic `|&active| !active` correctly negates the condition.

- **Timeout values**: 10ms sleep interval with 5 second timeout. The boot-time active poll uses the same values (`Delta::from_millis(10)`, `Delta::from_secs(5)`). This is consistent and seems reasonable for waiting for GSP shutdown.

- **Error logging**: Good — `.inspect_err()` provides a clear message on timeout, unlike patch 1.

- **Mixed comment styles**: Within this patch, the SEC2 path uses C-style `/* ... */` comments (preserved from the original code), while the new else branch uses Rust `//` comments. This is a very minor inconsistency, but it's understandable since the SEC2 side is just indented existing code. Not worth changing.

- **Pure indentation change on the SEC2 path**: The SEC2 side is just the existing code wrapped in an `if` block with one additional indentation level. This is clean — no behavioral changes to the existing path.

- **`read_poll_timeout` import**: This function is already imported in `boot.rs` (line 6 of the current tree shows `io::poll::read_poll_timeout`), and `Delta` is also already imported (line 10). The prerequisite unload series presumably keeps these imports intact, so no additional imports are needed for patch 3.

**Verdict:** Correct and clean. The approach of simply waiting for GSP falcon halt on non-SEC2 architectures makes hardware sense — on Hopper+, the FSP-based boot path means GSP handles its own cleanup during shutdown.

---
Generated by Claude Code Patch Reviewer

  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 review: " Claude Code Review Bot
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 Code Review Bot [this message]
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-patch3-20260409-b4-blackwell-unload-v1-3-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