Re: [PATCH v3 5/7] gpu: nova-core: transition gen_bootloader to TLV images
John Hubbard <[email protected]> Thu, 9 Jul 2026 14:49:36 -0700
| Newsgroups | dev.linux.lists.nova-gpu,dev.linux.lists.driver-core,org.kernel.vger.rust-for-linux |
|---|---|
| Message-ID | <[email protected]> |
On 7/9/26 2:27 PM, Timur Tabi wrote: > 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. If you have a spec, then it's either a spec or it's just a waste of time. Assuming that it's a spec, then if it says "shall have a VERS tag", then by gosh we should fail out if that tag is missing. Otherwise, write the spec differently. This is not a fuzzy sort of thing. thanks, -- John Hubbard