Since we are going to introduce a second type of message, add `rpc` to the names of the relevant command queue methods so we can distinguish between the two.
No functional change intended. Signed-off-by: Alexandre Courbot <[email protected]> Reviewed-by: Eliot Courtney <[email protected]> --- drivers/gpu/nova-core/gsp.rs | 2 +- drivers/gpu/nova-core/gsp/boot.rs | 6 +++--- drivers/gpu/nova-core/gsp/cmdq.rs | 2 +- drivers/gpu/nova-core/gsp/cmdq/rpc.rs | 14 +++++++------- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/nova-core/gsp.rs b/drivers/gpu/nova-core/gsp.rs index 75a3ba7d50f4..ed7eef21e8f9 100644 --- a/drivers/gpu/nova-core/gsp.rs +++ b/drivers/gpu/nova-core/gsp.rs @@ -221,7 +221,7 @@ pub(crate) fn new( /// Query the GSP for the static GPU information. pub(crate) fn get_static_info(&self) -> Result<commands::rpc::GetGspStaticInfoReply> { - self.cmdq.send_command(commands::rpc::GetGspStaticInfo) + self.cmdq.send_rpc_command(commands::rpc::GetGspStaticInfo) } } diff --git a/drivers/gpu/nova-core/gsp/boot.rs b/drivers/gpu/nova-core/gsp/boot.rs index 8e446ad1eac2..0d0b07fafd4f 100644 --- a/drivers/gpu/nova-core/gsp/boot.rs +++ b/drivers/gpu/nova-core/gsp/boot.rs @@ -43,9 +43,9 @@ pub(crate) fn boot( let gsp_fw = KBox::pin_init(GspFirmware::new(dev, chipset), GFP_KERNEL)?; self.cmdq - .send_command_no_wait(commands::rpc::SetSystemInfo::new(pdev, chipset))?; + .send_rpc_command_no_wait(commands::rpc::SetSystemInfo::new(pdev, chipset))?; self.cmdq - .send_command_no_wait(commands::rpc::SetRegistry::new(ctx.vgpu.state())?)?; + .send_rpc_command_no_wait(commands::rpc::SetRegistry::new(ctx.vgpu.state())?)?; // Perform the chipset-specific boot sequence, and retrieve the unload bundle. let unload_bundle = hal.boot(&self, &mut ctx, &gsp_fw)?.or_else(|| { @@ -91,7 +91,7 @@ fn shutdown_gsp( mode: commands::rpc::PowerStateLevel, ) -> Result { // Command to shut the GSP down. - cmdq.send_command(commands::rpc::UnloadingGuestDriver::new(mode))?; + cmdq.send_rpc_command(commands::rpc::UnloadingGuestDriver::new(mode))?; // Wait until GSP signals it is suspended. const LIBOS_INTERRUPT_PROCESSOR_SUSPENDED: u32 = bits::bit_u32(31); diff --git a/drivers/gpu/nova-core/gsp/cmdq.rs b/drivers/gpu/nova-core/gsp/cmdq.rs index c7deb1ae58f4..3ddde743f73c 100644 --- a/drivers/gpu/nova-core/gsp/cmdq.rs +++ b/drivers/gpu/nova-core/gsp/cmdq.rs @@ -58,7 +58,7 @@ use super::regs; /// Marker type representing the absence of a reply for a command. Commands using this as their -/// reply type are sent using [`Cmdq::send_command_no_wait`]. +/// reply type are sent using [`Cmdq::send_rpc_command_no_wait`]. pub(crate) struct NoReply; /// Trait implemented by types that can be sent as a single command queue element. diff --git a/drivers/gpu/nova-core/gsp/cmdq/rpc.rs b/drivers/gpu/nova-core/gsp/cmdq/rpc.rs index 39fc3a9e61fe..f334327f97c1 100644 --- a/drivers/gpu/nova-core/gsp/cmdq/rpc.rs +++ b/drivers/gpu/nova-core/gsp/cmdq/rpc.rs @@ -162,8 +162,8 @@ fn write(&self, dev: &device::Device, seq: u32, dst: &mut GspCommand<'_>) -> Res /// Trait representing messages received from the GSP. /// -/// A reply that [`Cmdq::send_command`] waits for, or an event that [`Cmdq::await_msg`] waits for. -/// The receiver matches a message's function code against [`Self::FUNCTION`] and decodes the +/// A reply that [`Cmdq::send_rpc_command`] waits for, or an event that [`Cmdq::await_msg`] waits +/// for. The receiver matches a message's function code against [`Self::FUNCTION`] and decodes the /// message with [`Self::read`]. pub(crate) trait MessageFromGsp: Sized { /// Function identifying this message from the GSP. @@ -327,7 +327,7 @@ impl Cmdq<'_> { /// written to by its [`CommandToGsp::init_variable_payload`] method. /// /// Error codes returned by the command and reply initializers are propagated as-is. - pub(crate) fn send_command<M>(&self, command: M) -> Result<M::Reply> + pub(crate) fn send_rpc_command<M>(&self, command: M) -> Result<M::Reply> where M: CommandToGsp, M::Reply: MessageFromGsp, @@ -335,7 +335,7 @@ pub(crate) fn send_command<M>(&self, command: M) -> Result<M::Reply> Error: From<<M::Reply as MessageFromGsp>::InitError>, { let mut inner = self.inner.lock(); - inner.send_command(command)?; + inner.send_rpc_command(command)?; inner.await_msg() } @@ -349,12 +349,12 @@ pub(crate) fn send_command<M>(&self, command: M) -> Result<M::Reply> /// written to by its [`CommandToGsp::init_variable_payload`] method. /// /// Error codes returned by the command initializers are propagated as-is. - pub(crate) fn send_command_no_wait<M>(&self, command: M) -> Result + pub(crate) fn send_rpc_command_no_wait<M>(&self, command: M) -> Result where M: CommandToGsp<Reply = NoReply>, Error: From<M::InitError>, { - self.inner.lock().send_command(command) + self.inner.lock().send_rpc_command(command) } /// Waits for an unsolicited GSP event of type `M`. Events that arrive before it are logged and @@ -391,7 +391,7 @@ impl CmdqInner<'_> { /// written to by its [`CommandToGsp::init_variable_payload`] method. /// /// Error codes returned by the command initializers are propagated as-is. - fn send_command<M>(&mut self, command: M) -> Result + fn send_rpc_command<M>(&mut self, command: M) -> Result where M: CommandToGsp, Error: From<M::InitError>, -- 2.56.0
