From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260409-b4-blackwell-unload-v1-3-0f5a2ff838dd@nvidia.com> References: <20260409-b4-blackwell-unload-v1-0-0f5a2ff838dd@nvidia.com> <20260409-b4-blackwell-unload-v1-3-0f5a2ff838dd@nvidia.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Purpose:** Split the `unload()` function so that SEC2-based architectures= run the full FWSEC-SB + booter unloader sequence, while non-SEC2 architect= ures (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 retu= rn `false`, meaning the GSP falcon has halted. This is the inverse of the b= oot-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-t= ime active poll uses the same values (`Delta::from_millis(10)`, `Delta::fro= m_secs(5)`). This is consistent and seems reasonable for waiting for GSP sh= utdown. - **Error logging**: Good =E2=80=94 `.inspect_err()` provides a clear messa= ge 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 wo= rth changing. - **Pure indentation change on the SEC2 path**: The SEC2 side is just the e= xisting code wrapped in an `if` block with one additional indentation level= . This is clean =E2=80=94 no behavioral changes to the existing path. - **`read_poll_timeout` import**: This function is already imported in `boo= t.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 falc= on halt on non-SEC2 architectures makes hardware sense =E2=80=94 on Hopper+= , the FSP-based boot path means GSP handles its own cleanup during shutdown. --- Generated by Claude Code Patch Reviewer