Re: [PATCH v6 5/8] gpu: nova-core: transition gsp to TLV images
Timur Tabi <[email protected]> Wed, 29 Jul 2026 23:24:09 +0000
| Newsgroups | org.kernel.vger.rust-for-linux,dev.linux.lists.driver-core,dev.linux.lists.nova-gpu |
|---|---|
| Message-ID | <[email protected]> |
On 7/29/26 5:55 PM, Timur Tabi wrote:
> /// 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<'a>(
> dev: &'a device::Device<device::Bound>,
> chipset: Chipset,
> - ver: &'a str,
> ) -> impl PinInit<Self, Error> + 'a {
> pin_init::pin_init_scope(move || {
> - let firmware = super::request_firmware(dev, chipset, "gsp", ver)?;
> + 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")?);
>
> - let fw_section = elf::elf_section(firmware.data(), ".fwimage").ok_or(EINVAL)?;
> + let size = usize::from_safe_cast(tlv.get_u32(b"SIZE")?);
> + let mut fw_vvec = VVec::zeroed(size, GFP_KERNEL).map_err(|_| ENOMEM)?;
>
> - let size = fw_section.len();
> + assert!(fw_vvec.iter().all(|&x| x == 0));
>
Oops, that assert should not be there.