Re: [PATCH v2 5/6] gpu: nova-core: gsp: cmdq: do not use ENOMSG to skip messages

From: Eliot Courtney

Date: Fri Nov 06 2026 - 04:09:27 EST


On Fri Nov 6, 2026 at 4:06 PM JST, Alexandre Courbot wrote:
> `await_msg_with` currently relies on its closure returning `ENOMSG` to
> signal that the message it received is not the one it was waiting for,
> and that it should be dropped. This makes `ENOMSG` an in-band control
> signal, as code running inside the closure that returns `ENOMSG` for an
> unrelated reason makes the queue skip the message instead of reporting
> the error.
>
> Make the closure return `Result<Option<R>>` instead, with `Ok(None)`
> meaning that the message is to be dropped. Errors returned by the
> closure are now always propagated to the caller, so no error code from
> the closure can alter the control flow of the command queue.
>
> Suggested-by: Eliot Courtney <ecourtney@xxxxxxxxxx>
> Link: https://lore.kernel.org/all/DMN62G2CDG3N.ETT4GRFXWKKU@xxxxxxxxxx/
> Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
> ---

Reviewed-by: Eliot Courtney <ecourtney@xxxxxxxxxx>