[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <05cdeb51-2731-43f0-b24e-53534b524a44@nvidia.com>
Date: Fri, 7 Nov 2025 21:08:39 -0800
From: John Hubbard <jhubbard@...dia.com>
To: Timur Tabi <ttabi@...dia.com>, "dakr@...nel.org" <dakr@...nel.org>
Cc: Alexandre Courbot <acourbot@...dia.com>,
"lossin@...nel.org" <lossin@...nel.org>,
"a.hindborg@...nel.org" <a.hindborg@...nel.org>,
"boqun.feng@...il.com" <boqun.feng@...il.com>,
"aliceryhl@...gle.com" <aliceryhl@...gle.com>, Zhi Wang <zhiw@...dia.com>,
"simona@...ll.ch" <simona@...ll.ch>,
"alex.gaynor@...il.com" <alex.gaynor@...il.com>,
"ojeda@...nel.org" <ojeda@...nel.org>, "tmgross@...ch.edu"
<tmgross@...ch.edu>,
"nouveau@...ts.freedesktop.org" <nouveau@...ts.freedesktop.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"rust-for-linux@...r.kernel.org" <rust-for-linux@...r.kernel.org>,
"bjorn3_gh@...tonmail.com" <bjorn3_gh@...tonmail.com>,
Edwin Peer <epeer@...dia.com>, "airlied@...il.com" <airlied@...il.com>,
Joel Fernandes <joelagnelf@...dia.com>,
"bhelgaas@...gle.com" <bhelgaas@...gle.com>,
"gary@...yguo.net" <gary@...yguo.net>, Alistair Popple <apopple@...dia.com>
Subject: Re: [PATCH v6 3/4] gpu: nova-core: make Architecture behave as a u8
type
On 11/7/25 9:03 PM, Timur Tabi wrote:
> On Fri, 2025-11-07 at 20:39 -0800, John Hubbard wrote:
>> /// Enum representation of the GPU generation.
>> -#[derive(fmt::Debug)]
>> +#[derive(fmt::Debug, Default, Copy, Clone)]
>> +#[repr(u8)]
>> pub(crate) enum Architecture {
>> + #[default]
>> Turing = 0x16,
>> Ampere = 0x17,
>> Ada = 0x19,
>> @@ -142,6 +144,13 @@ fn try_from(value: u8) -> Result<Self> {
>> }
>> }
>
> Does it make sense to designate a default Architecture? Turing is not a fallback for Ampere --
Definitely not! However, we do want to use Architecture in places
(register! and bitfield! macros) that expect u8 or u32, and that also
expect to use integer defaults.
So that's why we have to supply it.
thanks,
--
John Hubbard
Powered by blists - more mailing lists