From 4a19823f6c033f69d56f73d27fce020bbd4bf262 Mon Sep 17 00:00:00 2001 From: John Hubbard Date: Sun, 13 Sep 2026 12:54:11 -0700 Subject: [PATCH] gpu: nova-core: generalize radix3 buffer names The extracted table builder can map buffers other than the GSP firmware image. Rename its `fw` field and `fw_vvec` parameter to `data`, updating the existing documentation references to match. [acourbot: split the original patch into logical changes.] Assisted-by: LLM Signed-off-by: John Hubbard Reviewed-by: Timur Tabi Link: https://patch.msgid.link/20260913195413.742143-2-jhubbard@nvidia.com Signed-off-by: Alexandre Courbot --- drivers/gpu/nova-core/firmware/radix3.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/nova-core/firmware/radix3.rs b/drivers/gpu/nova-core/firmware/radix3.rs index 225a3dd1b4a9..9051509cabaa 100644 --- a/drivers/gpu/nova-core/firmware/radix3.rs +++ b/drivers/gpu/nova-core/firmware/radix3.rs @@ -38,7 +38,7 @@ use crate::{ pub(crate) struct Radix3<'a> { /// The GSP firmware inside a [`VVec`], device-mapped via a SG table. #[pin] - fw: SGTable>>, + data: SGTable>>, /// Level 2 page table whose entries contain DMA addresses of firmware pages. #[pin] level2: SGTable>>, @@ -47,30 +47,30 @@ pub(crate) struct Radix3<'a> { level1: SGTable>>, /// Level 0 page table (single 4KB page) with one entry: DMA address of first level 1 page. level0: Coherent<'a, [u64]>, - /// Size in bytes of the firmware contained in [`Self::fw`]. + /// Size in bytes of the firmware contained in [`Self::data`]. size: usize, } impl<'a> Radix3<'a> { - /// Builds a radix3 page table over `fw_vvec`, mapped for `dev` to read. May sleep. + /// Builds a radix3 page table over `data`, mapped for `dev` to read. May sleep. pub(crate) fn new( dev: &'a device::Device, - fw_vvec: VVec, + data: VVec, ) -> impl PinInit + 'a { - let size = fw_vvec.len(); + let size = data.len(); pin_init::pin_init_scope(move || { Ok(try_pin_init!(Self { - fw <- SGTable::new(dev, fw_vvec, DataDirection::ToDevice, GFP_KERNEL), + data <- SGTable::new(dev, data, DataDirection::ToDevice, GFP_KERNEL), level2 <- { // Allocate the level 2 page table, map the firmware onto it, and map it into // the device address space. VVec::::with_capacity( - fw.iter().count() * core::mem::size_of::(), + data.iter().count() * core::mem::size_of::(), GFP_KERNEL, ) .map_err(|_| ENOMEM) - .and_then(|level2| map_into_lvl(&fw, level2)) + .and_then(|level2| map_into_lvl(&data, level2)) .map(|level2| SGTable::new(dev, level2, DataDirection::ToDevice, GFP_KERNEL))? }, level1 <- { -- knotmirror 0.0.1