Linux driver-core infrastructure
 help / color / mirror / Atom feed
From: "Danilo Krummrich" <dakr@kernel.org>
To: "Timur Tabi" <ttabi@nvidia.com>
Cc: "ojeda@kernel.org" <ojeda@kernel.org>,
	"John Hubbard" <jhubbard@nvidia.com>,
	"gary@garyguo.net" <gary@garyguo.net>,
	"Eliot Courtney" <ecourtney@nvidia.com>,
	"Zhi Wang" <zhiw@nvidia.com>,
	"russ.weight@linux.dev" <russ.weight@linux.dev>,
	"mcgrof@kernel.org" <mcgrof@kernel.org>,
	"rust-for-linux@vger.kernel.org" <rust-for-linux@vger.kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"driver-core@lists.linux.dev" <driver-core@lists.linux.dev>,
	"nova-gpu@lists.linux.dev" <nova-gpu@lists.linux.dev>
Subject: Re: [PATCH v7 3/8] gpu: nova-core: add TLV parser for firmware files
Date: Tue, 04 Aug 2026 00:21:18 +0200	[thread overview]
Message-ID: <DKFNQH0FLP11.1JGXFSKVTOBMF@kernel.org> (raw)
In-Reply-To: <0c53c38adec26bc5df6b4658d3da53075001d93a.camel@nvidia.com>

On Tue Aug 4, 2026 at 12:05 AM CEST, Timur Tabi wrote:
> On Mon, 2026-08-03 at 23:36 +0200, Danilo Krummrich wrote:
>> @Miguel: One consideration for you below.
>> 
>> On Fri Jul 31, 2026 at 10:10 PM CEST, Timur Tabi wrote:
>> > +    fn find(&self, tag: &[u8; 4]) -> Result<TlvBlock<'a>> {
>> > +        self.iter().find(|b| b.tag == *tag).ok_or(EINVAL)
>> > +    }
>> 
>> NIT: Do we really know the tag is invalid just because it wasn't found?
>
> Well, maybe this is where we should return ENODATA?

Or maybe just ENOENT.

> I am expecting future Nova code to handle tags that may be legitimately absent, so maybe having
> it return ENODATA if the tag is missing, and EINVAL in all other situations is better.

In this case it makes sense to differenciate; AFAIC this can be a follow-up
patch.

>> > +    /// Return a slice of bytes.  Returns ENODATA if the value is empty.
>> > +    pub(crate) fn get_bytes(&self, tag: &[u8; 4]) -> Result<&'a [u8]> {
>> > +        let tlv = self.find(tag)?;
>> > +
>> > +        // Treat empty value as an error, to avoid trying to parse nothing.
>> > +        if tlv.value.is_empty() {
>> > +            return Err(ENODATA);
>> > +        }
>> 
>> This one seems resonable; but we don't have the error code in place. The commit
>> message says the series depends on [1], but this likely goes through the Rust
>> tree.
>
> Can't you just pick it up from the Rust tree and put it in drm-rust-next?

This is what I refer to below as "signed tag".

Some background on this: We can't have patches as duplicate commits going to
Linus. So in order for me to pull from the Rust tree, it has to guarantee to not
change its histroy (which it does not). Besides that, we don't want all the
commits from another tree, but just a specific one. The normal process for this
is to put the commit on a separate branch based on a commit base, e.g. some -rc,
typically -rc1. Then we can create a signed tag from this that can be merged
into both (or multiple) trees, so the commit only exists exactly once.

However, this kind of logistics typically only makes sense for features, etc. In
order to avoid a trivial conflict, it is usually overkill. Which is also why I
said I'd go for the former.

>> Either we just add this single error code in a separate patch or Miguel provides
>> a signed tag for [1].
>> 
>> Since this is a perfectly trivial conflict, I'd go for the former.
>
> The latter seems simpler to me, and would avoid an annoying merge conflict.

  reply	other threads:[~2026-08-03 22:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-31 20:10 [PATCH v7 0/8] Transition Nova Core to TLV firmware images Timur Tabi
2026-07-31 20:10 ` [PATCH v7 1/8] rust: alloc: add Vec::zeroed method Timur Tabi
2026-08-03 21:22   ` Danilo Krummrich
2026-07-31 20:10 ` [PATCH v7 2/8] rust: firmware: add request_into_buf() Timur Tabi
2026-07-31 20:10 ` [PATCH v7 3/8] gpu: nova-core: add TLV parser for firmware files Timur Tabi
2026-08-03 21:36   ` Danilo Krummrich
2026-08-03 21:38     ` Danilo Krummrich
2026-08-03 22:05     ` Timur Tabi
2026-08-03 22:21       ` Danilo Krummrich [this message]
2026-07-31 20:10 ` [PATCH v7 4/8] gpu: nova-core: transition booter to TLV images Timur Tabi
2026-07-31 20:10 ` [PATCH v7 5/8] gpu: nova-core: transition gsp " Timur Tabi
2026-07-31 20:10 ` [PATCH v7 6/8] gpu: nova-core: transition gen_bootloader " Timur Tabi
2026-07-31 20:10 ` [PATCH v7 7/8] gpu: nova-core: transition fsp " Timur Tabi
2026-07-31 20:10 ` [PATCH v7 8/8] gpu: nova-core: update firmware module info for " Timur Tabi
2026-08-03 13:51 ` [PATCH v7 0/8] Transition Nova Core to TLV firmware images Alexandre Courbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DKFNQH0FLP11.1JGXFSKVTOBMF@kernel.org \
    --to=dakr@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=driver-core@lists.linux.dev \
    --cc=ecourtney@nvidia.com \
    --cc=gary@garyguo.net \
    --cc=jhubbard@nvidia.com \
    --cc=mcgrof@kernel.org \
    --cc=nova-gpu@lists.linux.dev \
    --cc=ojeda@kernel.org \
    --cc=russ.weight@linux.dev \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=ttabi@nvidia.com \
    --cc=zhiw@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox