Re: [PATCH v2 4/5] gpu: nova-core: send UNLOADING_GUEST_DRIVER GSP command upon unloading

From: Alexandre Courbot

Date: Wed Apr 22 2026 - 06:48:10 EST


On Tue Apr 21, 2026 at 11:27 PM JST, Alexandre Courbot wrote:
<snip>
>>> + dev_dbg!(dev, "GSP shut down\n");
>>> +
>>> + Ok(())
>>> + }
>>> }
>>> diff --git a/drivers/gpu/nova-core/gsp/commands.rs b/drivers/gpu/nova-core/gsp/commands.rs
>>> index c80df421702c..fb94460c451e 100644
>>> --- a/drivers/gpu/nova-core/gsp/commands.rs
>>> +++ b/drivers/gpu/nova-core/gsp/commands.rs
>>> @@ -237,3 +237,39 @@ pub(crate) fn gpu_name(&self) -> core::result::Result<&str, GpuNameError> {
>>> pub(crate) fn get_gsp_info(cmdq: &Cmdq, bar: &Bar0) -> Result<GetGspStaticInfoReply> {
>>> cmdq.send_command(bar, GetGspStaticInfo)
>>> }
>>> +
>>> +pub(crate) struct UnloadingGuestDriver {
>>> + suspend: bool,
>>> +}
>>
>> This feels like it only makes sense to call from within the gsp module,
>> so I wonder if it can be pub(super) (prolly a few others in this file
>> could be too, ofc not relevant for this series).
>
> I'll review that, we do want to limit visibility as much as possible.

Mmm looking more closely I am not sure this is something we want/can do.
As the driver expands, it looks likely that some of these types will be
used outside of the `gsp` module - in particular some of the responses
can be used outside, I think this actually happens with the MM series.

So I think I will keep the visibility as-is for now.