Hi Joel, On Wed Nov 5, 2025 at 8:26 AM JST, Joel Fernandes wrote: > Refactor GspSequencer::run() to follow the same pattern as gsp_init_done() > by wrapping message reception in a loop that ignores unknown messages > (ERANGE errors).
Can you squash this code into the appropriate patch when you respin the series? > > Suggested-by: Timur Tabi <[email protected]> > Signed-off-by: Joel Fernandes <[email protected]> > --- > Additional patch to cure probe issue on Timur's GA102 (which happens to > receive > too many NOCAT records). > > drivers/gpu/nova-core/gsp/sequencer.rs | 86 +++++++++++++++----------- > 1 file changed, 49 insertions(+), 37 deletions(-) > > diff --git a/drivers/gpu/nova-core/gsp/sequencer.rs > b/drivers/gpu/nova-core/gsp/sequencer.rs > index ecc80f668dc8..b98e5146abd8 100644 > --- a/drivers/gpu/nova-core/gsp/sequencer.rs > +++ b/drivers/gpu/nova-core/gsp/sequencer.rs > @@ -35,8 +35,8 @@ impl MessageFromGsp for fw::rpc_run_cpu_sequencer_v17_00 { > > const CMD_SIZE: usize = size_of::<fw::GSP_SEQUENCER_BUFFER_CMD>(); > > -struct GspSequencerInfo<'a> { > - info: &'a fw::rpc_run_cpu_sequencer_v17_00, > +struct GspSequencerInfo { > + cmd_index: u32, > cmd_data: KVec<u8>, > } > > @@ -125,7 +125,7 @@ pub(crate) fn size_bytes(&self) -> usize { > } > > pub(crate) struct GspSequencer<'a> { > - seq_info: GspSequencerInfo<'a>, > + seq_info: GspSequencerInfo, I've looked at how `GspSequencere`, `GspSequencerParams` and `GspSequencerInfo` interact after this patch, and I think we can simplify the design a bit (based on the v9 of the GSP boot series). `GspSequencerInfo` is actually the sequence (so we should name it `GspSequence`?) we want to run. As such, it can be created by implementing the `MessageFromGsp` trait, and received directly from `boot.rs` by moving the loop at the beginning of `GspSequencer::run` to `boot.rs`. This allows to remove the `cmdq` argument from the `run` method, which looked a bit out of place. In its place, we can pass the sequence to `run`. It doesn't need to be stored in the `GspSequencer` struct, as we can just implement `Iterator` on it and read its commands from `run` directly. Once you remove it from `GspSequencer`, something interesting happens: `GspSequencer` and `GspSequencerParams` are now exactly the same! So we can remove the params, simply build the sequencer using a regular constructor, and call `run` on it with the sequence.
