Re: [PATCH 6/7] gpu: nova-core: send UNLOADING_GUEST_DRIVER GSP command GSP upon unloading

Timur Tabi
2025-12-18T22:33:55Z

On Thu, 2025-12-18 at 22:27 +0900, Alexandre Courbot wrote:
> > > +    loop {
> > > +        match cmdq.receive_msg::<UnloadingGuestDriverReply>(Delta::from_secs(5)) {
> > > +            Ok(resp) => return Ok(resp),
> > > +            Err(ERANGE) => continue,
> > > +            Err(e) => return Err(e),
> > > +        }
> >
> > This outer loop can go on infinitely, lets bound it?
> >
> > Either outer timeout or bounded number of tries. Bounded tries better since it has inner
> > timeout.
>
> Yes. And what we really want is a more generic way to do this, because
> this pattern occurs with several commands so far (and more to come).

Isn't the real problem that we are polling for a specific message, when all message should be
handled asynchronously as events, like Nouveau does?

Err(ERANGE) => continue,

This effectively throws out all other messages, including errors and anything else important.