On Wed Mar 4, 2026 at 11:17 PM JST, Alexandre Courbot wrote:
> On Wed Mar 4, 2026 at 11:46 AM JST, Eliot Courtney wrote:
> <snip>
>>  /// Send the [`GetGspInfo`] command and awaits for its reply.
>>  pub(crate) fn get_gsp_info(cmdq: &mut Cmdq, bar: &Bar0) -> 
>> Result<GetGspStaticInfoReply> {
>> -    cmdq.send_command(bar, GetGspStaticInfo)?;
>> -
>> -    loop {
>> -        match 
>> cmdq.receive_msg::<GetGspStaticInfoReply>(Cmdq::RECEIVE_TIMEOUT) {
>> -            Ok(info) => return Ok(info),
>> -            Err(ERANGE) => continue,
>> -            Err(e) => return Err(e),
>> -        }
>> -    }
>> +    cmdq.send_command(bar, GetGspStaticInfo)
>
> Also noticed something cool while rebasing the unload series on top of
> this one: all these command helpers become one-liners and are not really
> needed anymore! Here we can just make `GetGspStaticInfo` public and call
> `cmdq.send_command` on it directly in `boot`. It removes a layer of
> black magic and makes it easier to understand what is going on.

I think this is ok, but we will still need some helpers (e.g. for RM
control RPCs) that mimic the structure we have here. But there are a
bunch of simple RPCs like this that can just be called without the
helper. Do you think it's better to do this and have mixed helper vs
direct call, or just go all helpers?

Reply via email to