Re: [PATCH v5 5/8] gpu: nova-core: transition gsp to TLV images
"Alexandre Courbot" <[email protected]> Mon, 27 Jul 2026 20:29:43 +0900
| Newsgroups | dev.linux.lists.nova-gpu,dev.linux.lists.driver-core,org.kernel.vger.rust-for-linux |
|---|---|
| Message-ID | <[email protected]> |
On Sat Jul 11, 2026 at 8:04 AM JST, Timur Tabi wrote:
<...>
> diff --git a/drivers/gpu/nova-core/firmware/gsp.rs b/drivers/gpu/nova-cor=
e/firmware/gsp.rs
> index 99a302bae567..185cae0689a3 100644
> --- a/drivers/gpu/nova-core/firmware/gsp.rs
> +++ b/drivers/gpu/nova-core/firmware/gsp.rs
> @@ -8,6 +8,7 @@
> DataDirection,
> DmaAddress, //
> },
> + firmware,
> prelude::*,
> scatterlist::{
> Owned,
> @@ -17,13 +18,14 @@
> =20
> use crate::{
> firmware::{
> - elf,
> riscv::RiscvFirmware, //
> + tlv::{
> + request_tlv, //
> + Tlv,
> + },
> + CString,
`CString` should be imported from `kernel`, not `crate`. I guess this
only works because `crate::firmware` also imports it and we are below it.
<...>
> -impl RmRiscvUCodeDesc {
> - /// Interprets the header of `bin_fw` as a [`RmRiscvUCodeDesc`] and =
returns it.
> - ///
> - /// Fails if the header pointed at by `bin_fw` is not within the bou=
nds of the firmware image.
> - fn new(bin_fw: &BinFirmware<'_>) -> Result<Self> {
> - let offset =3D usize::from_safe_cast(bin_fw.hdr.header_offset);
> - let end =3D offset.checked_add(size_of::<Self>()).ok_or(EINVAL)?=
;
> -
> - bin_fw
> - .fw
> - .get(offset..end)
> - .and_then(Self::from_bytes_copy)
> - .ok_or(EINVAL)
> - }
> -}
> +use crate::firmware::tlv::Tlv;
> =20
> /// A parsed firmware for a RISC-V core, ready to be loaded and run.
> pub(crate) struct RiscvFirmware {
> @@ -70,26 +27,27 @@ pub(crate) struct RiscvFirmware {
> }
> =20
> impl RiscvFirmware {
> - /// Parses the RISC-V firmware image contained in `fw`.
Why remove this doccomment?