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: gsp: add reply/no-reply info to `CommandToGsp` Date: Wed, 11 Mar 2026 13:32:10 +1000 Message-ID: In-Reply-To: <20260310-cmdq-locking-v4-3-4e5c4753c408@nvidia.com> References: <20260310-cmdq-locking-v4-0-4e5c4753c408@nvidia.com> <20260310-cmdq-locking-v4-3-4e5c4753c408@nvidia.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review This is the key design patch. It introduces: 1. A `NoReply` marker type for commands with no expected response 2. An associated `type Reply` on `CommandToGsp` 3. Splits the public API into `send_command` (waits for reply) and `send_command_no_wait` (fire-and-forget) The type-level enforcement is well done: ```rust + pub(crate) fn send_command_no_wait(&mut self, bar: &Bar0, command: M) -> Result + where + M: CommandToGsp, ``` This constrains `send_command_no_wait` to only accept commands whose `Reply` is `NoReply`, which prevents accidentally forgetting to wait for a reply. The `send_command` method absorbs the receive loop pattern that was previously duplicated in `get_gsp_info`: ```rust + loop { + match self.receive_msg::(Self::RECEIVE_TIMEOUT) { + Ok(reply) => break Ok(reply), + Err(ERANGE) => continue, + Err(e) => break Err(e), + } + } ``` This simplifies `get_gsp_info` to a single line, which is nice. The `SplitCommand` wrapper correctly propagates `type Reply = C::Reply`, and `ContinuationRecord` correctly uses `NoReply`. One observation: the `wait_gsp_init_done` function still has its own manual receive loop in `commands.rs` since `GspInitDone` isn't triggered by a specific command -- it's an unsolicited notification. This is correct; it cannot use `send_command`. The `// ` trailing comment on the import formatting (e.g., `NoReply, //`) is the `rustfmt` skip trick to force vertical formatting -- standard practice in the kernel Rust code. No issues. --- Generated by Claude Code Patch Reviewer