mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 12:13:51 -04:00
gpu: nova-core: gsp: replace ARef<Device> with &'a Device in sequencer
GspSequencer, GspSeqIter, and GspSequencerParams are already lifetime-parameterized; the ARef<Device> is unnecessary -- a plain &'a Device reference suffices. Reviewed-by: Eliot Courtney <ecourtney@nvidia.com> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Tested-by: Alexandre Courbot <acourbot@nvidia.com> Link: https://patch.msgid.link/20260525225838.276108-5-dakr@kernel.org Signed-off-by: Danilo Krummrich <dakr@kernel.org>
This commit is contained in:
@@ -234,7 +234,7 @@ pub(crate) fn boot(
|
||||
libos_dma_handle: libos_handle,
|
||||
gsp_falcon,
|
||||
sec2_falcon,
|
||||
dev: pdev.as_ref().into(),
|
||||
dev,
|
||||
bar,
|
||||
};
|
||||
GspSequencer::run(&self.cmdq, seq_params)?;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
Io, //
|
||||
},
|
||||
prelude::*,
|
||||
sync::aref::ARef,
|
||||
time::{
|
||||
delay::fsleep,
|
||||
Delta, //
|
||||
@@ -142,7 +141,7 @@ pub(crate) struct GspSequencer<'a> {
|
||||
/// Bootloader application version.
|
||||
bootloader_app_version: u32,
|
||||
/// Device for logging.
|
||||
dev: ARef<device::Device>,
|
||||
dev: &'a device::Device,
|
||||
}
|
||||
|
||||
impl fw::RegWritePayload {
|
||||
@@ -281,7 +280,7 @@ pub(crate) struct GspSeqIter<'a> {
|
||||
/// Number of commands processed so far.
|
||||
cmds_processed: u32,
|
||||
/// Device for logging.
|
||||
dev: ARef<device::Device>,
|
||||
dev: &'a device::Device,
|
||||
}
|
||||
|
||||
impl<'a> Iterator for GspSeqIter<'a> {
|
||||
@@ -309,7 +308,7 @@ fn next(&mut self) -> Option<Self::Item> {
|
||||
self.cmd_data.len() - offset
|
||||
};
|
||||
buffer[..copy_len].copy_from_slice(&self.cmd_data[offset..offset + copy_len]);
|
||||
let cmd_result = GspSeqCmd::new(&buffer, &self.dev);
|
||||
let cmd_result = GspSeqCmd::new(&buffer, self.dev);
|
||||
|
||||
cmd_result.map_or_else(
|
||||
|_err| {
|
||||
@@ -334,7 +333,7 @@ fn iter(&self) -> GspSeqIter<'_> {
|
||||
current_offset: 0,
|
||||
total_cmds: self.seq_info.cmd_index,
|
||||
cmds_processed: 0,
|
||||
dev: self.dev.clone(),
|
||||
dev: self.dev,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -350,7 +349,7 @@ pub(crate) struct GspSequencerParams<'a> {
|
||||
/// SEC2 falcon for core operations.
|
||||
pub(crate) sec2_falcon: &'a Falcon<Sec2>,
|
||||
/// Device for logging.
|
||||
pub(crate) dev: ARef<device::Device>,
|
||||
pub(crate) dev: &'a device::Device,
|
||||
/// BAR0 for register access.
|
||||
pub(crate) bar: &'a Bar0,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user