PowerStateLevel is currently re-exported from gsp::commands::rpc, while the upcoming GSP_SUSPEND GMC command will take it as well.
Re-export PowerStateLevel from gsp::commands alongside GspStaticInfo so both command protocols and their callers can share it. No functional change. Signed-off-by: Alexandre Courbot <[email protected]> --- drivers/gpu/nova-core/gsp/boot.rs | 15 +++++++-------- drivers/gpu/nova-core/gsp/commands.rs | 2 ++ drivers/gpu/nova-core/gsp/commands/rpc.rs | 7 ++++--- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/nova-core/gsp/boot.rs b/drivers/gpu/nova-core/gsp/boot.rs index 09ad11ac74cb..2904f1ac7459 100644 --- a/drivers/gpu/nova-core/gsp/boot.rs +++ b/drivers/gpu/nova-core/gsp/boot.rs @@ -16,7 +16,10 @@ firmware::gsp::GspFirmware, gsp::{ cmdq::Cmdq, - commands, // + commands::{ + self, + PowerStateLevel, // + }, }, }; @@ -98,7 +101,7 @@ pub(crate) fn boot( fn shutdown_gsp( cmdq: &Cmdq<'_>, gsp_falcon: &Falcon<'_, Gsp>, - mode: commands::rpc::PowerStateLevel, + mode: PowerStateLevel, ) -> Result { // Command to shut the GSP down. cmdq.send_rpc_command(commands::rpc::UnloadingGuestDriver::new(mode))?; @@ -118,12 +121,8 @@ pub(crate) fn unload( let dev = ctx.dev(); // Shut down the GSP. Keep going even in case of error. - let mut res = Self::shutdown_gsp( - &self.cmdq, - ctx.gsp_falcon, - commands::rpc::PowerStateLevel::Level0, - ) - .inspect_err(|e| dev_err!(dev, "GSP shutdown failed: {:?}\n", e)); + let mut res = Self::shutdown_gsp(&self.cmdq, ctx.gsp_falcon, PowerStateLevel::Level0) + .inspect_err(|e| dev_err!(dev, "GSP shutdown failed: {:?}\n", e)); // Run the unload bundle to reset the GSP so it can be booted again. if let Some(unload_bundle) = unload_bundle { diff --git a/drivers/gpu/nova-core/gsp/commands.rs b/drivers/gpu/nova-core/gsp/commands.rs index b48cf30978cf..4ffcb4133e02 100644 --- a/drivers/gpu/nova-core/gsp/commands.rs +++ b/drivers/gpu/nova-core/gsp/commands.rs @@ -14,6 +14,8 @@ use kernel::prelude::*; +pub(crate) use crate::gsp::fw::commands::PowerStateLevel; + /// The static GPU configuration, which GSP-RM reports in reply to /// [`GetGspStaticInfo`](rpc::GetGspStaticInfo). pub struct GspStaticInfo { diff --git a/drivers/gpu/nova-core/gsp/commands/rpc.rs b/drivers/gpu/nova-core/gsp/commands/rpc.rs index ab6d1114cead..084214d69f1f 100644 --- a/drivers/gpu/nova-core/gsp/commands/rpc.rs +++ b/drivers/gpu/nova-core/gsp/commands/rpc.rs @@ -27,7 +27,10 @@ Cmdq, NoReply, // }, - commands::GspStaticInfo, + commands::{ + GspStaticInfo, + PowerStateLevel, // + }, fw::{ self, MsgFunction, // @@ -240,8 +243,6 @@ fn read( } } -pub(crate) use fw::commands::PowerStateLevel; - /// The `UnloadingGuestDriver` command, used to shut down the GSP. /// /// Only used within the `gsp` module. -- 2.56.1
