Re: [PATCH v6 11/15] gpu: nova-core: gsp: cmdq: do not sleep when waiting for a message with timeout 0

From: Eliot Courtney

Date: Tue Oct 27 2026 - 04:03:39 EST


On Tue Oct 27, 2026 at 4:35 PM JST, Alexandre Courbot wrote:
> `read_poll_timeout` can potentially sleep for the specified
> `sleep_delta` if `timeout_delta` is `Delta::ZERO` and the system clock
> is coarse enough to not register a tick between the time the function
> has been called and the time the loop test is done. `wait_for_msg` has a
> short test condition and is particularly vulnerable to this condition.
>
> Add a dedicated branch when `timeout` is `Delta::ZERO` to perform the
> test without calling `read_poll_timeout` and avoid potentially sleeping
> for 1ms.
>
> Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
> ---

Reviewed-by: Eliot Courtney <ecourtney@xxxxxxxxxx>