Re: [PATCH v3 5/7] gpu: nova-core: transition gen_bootloader to TLV images

Timur Tabi <[email protected]> Thu, 9 Jul 2026 21:27:48 +0000
Newsgroups dev.linux.lists.nova-gpu,dev.linux.lists.driver-core,org.kernel.vger.rust-for-linux
Message-ID <[email protected]>
On Thu, 2026-07-09 at 11:24 +0900, Alexandre Courbot wrote:
> > > 
> > > Also, since `dev_dbg` can be compiled out, the check performed on the
> > > `VERS` tag existing is not guaranteed to be performed. We should
> > > probably extract it out of the `dev_dbg` statement. This is true across
> > > the series; which makes me think it might also benefit from a helper to
> > > factor out the request_t.v/Tlv::new/dev_dbg common sequence.
> > 
> > We don't care about the VERS tag if we're not going to print it out, so we probably should
> > not
> > extract it otherwise.
> 
> The spec mentions that this tag is present in all TLV files, so its
> absence means the file is invalid and should trigger an error.

If a tree falls in the woods and no one is around to hear it, does it make a sound?

I see your point, I'm just not sure I agree with it.  By that logic, we should test for VERS in
the constructor.  My concern is that maybe one day we will have a TLV that doesn't have a VERS
tag because it's not attached to a versioned firmware image, it's just some misc data.  

I need to think about this a little more.  What do you think about testing for VERS in the
constructor?  We could move the dev_dbg! into the constructor, but then we'd have to pass `dev`
as a parameter.

I'm going to post a v4 today in the meantime.