Re: [PATCH 2/2] gpu: nova-core: remove unnecessary firmware pin-init
From: Alexandre Courbot
Date: Sun Nov 15 2026 - 23:03:11 EST
On Sun Nov 15, 2026 at 8:42 AM JST, Danilo Krummrich wrote:
> Now that SGTable no longer requires pinning, remove the pin-init
> machinery from Radix3 and GspFirmware.
>
> Signed-off-by: Danilo Krummrich <dakr@xxxxxxxxxx>
> ---
> drivers/gpu/nova-core/firmware/gsp.rs | 43 +++++--------
> drivers/gpu/nova-core/firmware/radix3.rs | 82 +++++++++++-------------
> drivers/gpu/nova-core/gsp/boot.rs | 2 +-
> 3 files changed, 56 insertions(+), 71 deletions(-)
>
> diff --git a/drivers/gpu/nova-core/firmware/gsp.rs b/drivers/gpu/nova-core/firmware/gsp.rs
> index 341a8b19aa38..ff92a12b2994 100644
> --- a/drivers/gpu/nova-core/firmware/gsp.rs
> +++ b/drivers/gpu/nova-core/firmware/gsp.rs
> @@ -25,10 +25,8 @@
> };
>
> /// The GSP firmware image, its signatures, and the GSP bootloader.
> -#[pin_data]
> pub(crate) struct GspFirmware<'a> {
> /// The firmware image and the radix3 table that maps it.
> - #[pin]
> radix3: Radix3<'a>,
> /// Device-mapped GSP signatures matching the GPU's [`Chipset`].
> pub(crate) signatures: Coherent<'a, [u8]>,
> @@ -39,34 +37,27 @@ pub(crate) struct GspFirmware<'a> {
> impl<'a> GspFirmware<'a> {
> /// Loads the GSP firmware binaries, map them into `dev`'s address-space, and creates the page
> /// tables expected by the GSP bootloader to load it.
> - pub(crate) fn new(
> - dev: &'a device::Device<device::Bound>,
> - chipset: Chipset,
> - ) -> impl PinInit<Self, Error> + 'a {
> - pin_init::pin_init_scope(move || {
> - let firmware = request_tlv(dev, chipset, "gsp")?;
> - let tlv = Tlv::new(firmware.data())?;
> - dev_dbg!(dev, "loaded gsp firmware v{}\n", tlv.get_string(b"VERS")?);
> + pub(crate) fn new(dev: &'a device::Device<device::Bound>, chipset: Chipset) -> Result<Self> {
`GspFirmware` is 312 bytes, that's not enormous but that's also not
small... Shall we keep returning an `impl Pininit`?
> diff --git a/drivers/gpu/nova-core/firmware/radix3.rs b/drivers/gpu/nova-core/firmware/radix3.rs
> index a3e43fc8ec86..2c8787d5930d 100644
> --- a/drivers/gpu/nova-core/firmware/radix3.rs
> +++ b/drivers/gpu/nova-core/firmware/radix3.rs
> @@ -32,60 +32,54 @@
> };
>
> /// A radix3 page table and the data it maps.
> -#[pin_data]
> pub(crate) struct Radix3<'a> {
> /// The mapped data.
> - data: SGTable<Owned<'a, VVec<u8>>>,
> - /// Level 2: one entry per page of `data`.
> - level2: SGTable<Owned<'a, VVec<u8>>>,
> - /// Level 1: one entry per page of `level2`.
> - level1: SGTable<Owned<'a, VVec<u8>>>,
> - /// Level 0: one page, whose single entry is the DMA address of the first `level1` page.
> + _data: SGTable<Owned<'a, VVec<u8>>>,
> + /// Level 2: one entry per page of `_data`.
> + _level2: SGTable<Owned<'a, VVec<u8>>>,
> + /// Level 1: one entry per page of `_level2`.
> + _level1: SGTable<Owned<'a, VVec<u8>>>,
> + /// Level 0: one page, whose single entry is the DMA address of the first `_level1` page.
> level0: Coherent<'a, [u64]>,
> - /// Length of `data`, in bytes.
> + /// Length of `_data`, in bytes.
> size: usize,
> }
>
> impl<'a> Radix3<'a> {
> /// Builds a radix3 page table over `data`, mapped for `dev` to read. May sleep.
> - pub(crate) fn new(
> - dev: &'a device::Device<device::Bound>,
> - data: VVec<u8>,
> - ) -> impl PinInit<Self, Error> + 'a {
> + pub(crate) fn new(dev: &'a device::Device<device::Bound>, data: VVec<u8>) -> Result<Self> {
Similar comment as `Radix3` is 216 bytes.