Re: [PATCH v2 02/10] gpu: nova-core: fsp: catch bogus queue pointer issues

From: Alexandre Courbot

Date: Wed Jul 22 2026 - 22:55:37 EST


On Fri Jul 3, 2026 at 3:22 AM PDT, Eliot Courtney wrote:
> Currently, `poll_msgq` will report a message of size 4 if the queue
> pointers are broken. It's easy to catch this if it occurs, so have
> `poll_msgq` return an error in this case.
>
> Reviewed-by: Alistair Popple <apopple@xxxxxxxxxx>
> Signed-off-by: Eliot Courtney <ecourtney@xxxxxxxxxx>

Merged into drm-rust-next, thanks! With the fix mentioned below.

> ---
> drivers/gpu/nova-core/falcon/fsp.rs | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/nova-core/falcon/fsp.rs b/drivers/gpu/nova-core/falcon/fsp.rs
> index 7cd9604d1f4d..3752448df431 100644
> --- a/drivers/gpu/nova-core/falcon/fsp.rs
> +++ b/drivers/gpu/nova-core/falcon/fsp.rs
> @@ -109,19 +109,22 @@ fn read_emem(&mut self, data: &mut [u8]) -> Result {
> /// Poll FSP for incoming data.
> ///
> /// Returns the size of available data in bytes, or 0 if no data is available.
> + /// Returns an error if the queue pointers are bogus (`tail < head`).

Let's say which error since there can only be one in this case.

Also nit: Let's also move this to its own paragraph so the success and
error cases are clearly separate.