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 mechanism to wait for space on command queue Date: Fri, 27 Feb 2026 12:21:58 +1000 Message-ID: In-Reply-To: <20260226-cmdq-continuation-v3-2-572ab9916766@nvidia.com> References: <20260226-cmdq-continuation-v3-0-572ab9916766@nvidia.com> <20260226-cmdq-continuation-v3-2-572ab9916766@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 Adds `driver_write_area_size()` and changes `allocate_command` from returning `EAGAIN` to polling with `read_poll_timeout`. The 1-second timeout matches nouveau's approach. The circular buffer arithmetic in `driver_write_area_size()` looks correct: ```rust let slots = (rx + MSGQ_NUM_PAGES - tx - 1) % MSGQ_NUM_PAGES; ``` The `-1` reserves one slot to distinguish full from empty, which is standard for circular buffers. **Minor observation**: The `Delta::ZERO` sleep period in `read_poll_timeout` means this is a busy-poll. For a 1-second timeout that's acceptable in this context (the GSP should drain commands quickly), but if this is ever used with longer timeouts it could waste CPU. Not a problem for the current use case. The error code change from `EAGAIN` to `ETIMEDOUT` is appropriate since the caller no longer retries. --- Generated by Claude Code Patch Reviewer