rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "John Hubbard" <jhubbard@nvidia.com>,
	"Timur Tabi" <ttabi@nvidia.com>,
	"dakr@kernel.org" <dakr@kernel.org>
Cc: "Alexandre Courbot" <acourbot@nvidia.com>,
	"lossin@kernel.org" <lossin@kernel.org>,
	"a.hindborg@kernel.org" <a.hindborg@kernel.org>,
	"boqun.feng@gmail.com" <boqun.feng@gmail.com>,
	"aliceryhl@google.com" <aliceryhl@google.com>,
	"Zhi Wang" <zhiw@nvidia.com>, "simona@ffwll.ch" <simona@ffwll.ch>,
	"alex.gaynor@gmail.com" <alex.gaynor@gmail.com>,
	"ojeda@kernel.org" <ojeda@kernel.org>,
	"tmgross@umich.edu" <tmgross@umich.edu>,
	"nouveau@lists.freedesktop.org" <nouveau@lists.freedesktop.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"rust-for-linux@vger.kernel.org" <rust-for-linux@vger.kernel.org>,
	"bjorn3_gh@protonmail.com" <bjorn3_gh@protonmail.com>,
	"Edwin Peer" <epeer@nvidia.com>,
	"airlied@gmail.com" <airlied@gmail.com>,
	"Joel Fernandes" <joelagnelf@nvidia.com>,
	"bhelgaas@google.com" <bhelgaas@google.com>,
	"gary@garyguo.net" <gary@garyguo.net>,
	"Alistair Popple" <apopple@nvidia.com>,
	"Nouveau" <nouveau-bounces@lists.freedesktop.org>
Subject: Re: [PATCH 3/6] gpu: nova-core: Blackwell: basic GPU identification
Date: Wed, 19 Nov 2025 11:45:59 +0900	[thread overview]
Message-ID: <DECBSKQQ8SZ4.1B1D97HLUESDD@nvidia.com> (raw)
In-Reply-To: <4c87b7d6-5ce0-4f08-8f22-578a34ea2bd5@nvidia.com>

On Wed Nov 19, 2025 at 10:46 AM JST, John Hubbard wrote:
> On 11/6/25 2:24 PM, John Hubbard wrote:
>> On 11/6/25 6:44 AM, Timur Tabi wrote:
>>> On Wed, 2025-11-05 at 19:54 -0800, John Hubbard wrote:
>>>>       let hal = match chipset {
>>>> -        GA102 | GA103 | GA104 | GA106 | GA107 | GH100 | AD102 | AD103 | AD104 | AD106 | AD107
>>>> => {
>>>> +        GA102 | GA103 | GA104 | GA106 | GA107 | GH100 | AD102 | AD103 | AD104 | AD106 | AD107
>>>> +        | GB100 | GB102 | GB202 | GB203 | GB205 | GB206 | GB207 => {
>>>>               KBox::new(ga102::Ga102::<E>::new(), GFP_KERNEL)? as KBox<dyn FalconHal<E>>
>>>>           }
>>>
>>> Maybe combine patches 2 and 3?  Also, maybe this should be a range check, instead of listing
>>> every since version?  It seems like everything past GA100 uses the GA102 HAL.
>>>
>> 
>> Sure, I can combine the patches.
>> 
>> I'm not sure why I've been wary of using ranges for these arch's.
>> I'll try it out.
>
> Now I know. :)  Unlike C, Rust does *not* like it when we try to
> treat enums as integers. Casting or other (messier) approaches are
> required, and in no case is the end result a more readable on-screen
> experience. At least not so far.
>
> It is possible to mix in Architecture (Turing, Ampere, etc) checks,
> but I'm not sure that is worth the additional clutter.
>
> Maybe let's just do the long lists of chipsets for now...?

Yeah, I've hit this issue as well. The compiler might remove that
limitation in the future, or maybe we can craft a `chipset_range!()`
macro that hides the messy casting, but this exhaustive listing also has
the benefit of forcing us to consider every critical site whenever we
support a new chipset so I'm actually not too bothered by it.

  reply	other threads:[~2025-11-19  2:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-06  3:54 [PATCH 0/6] gpu: nova-core: Hopper/Blackwell prerequisites John Hubbard
2025-11-06  3:54 ` [PATCH 1/6] gpu: nova-core: print FB sizes, along with ranges John Hubbard
2025-11-19  7:33   ` Alexandre Courbot
2025-11-19  7:36     ` John Hubbard
2025-11-06  3:54 ` [PATCH 2/6] gpu: nova-core: Hopper: basic GPU identification John Hubbard
2025-11-06  3:54 ` [PATCH 3/6] gpu: nova-core: Blackwell: " John Hubbard
2025-11-06 14:44   ` Timur Tabi
2025-11-06 22:24     ` John Hubbard
2025-11-19  1:46       ` John Hubbard
2025-11-19  2:45         ` Alexandre Courbot [this message]
2025-11-19  3:15           ` Dave Airlie
2025-11-19  7:07             ` John Hubbard
2025-11-19  7:15               ` Dave Airlie
2025-11-19  7:20                 ` John Hubbard
2025-11-06  3:54 ` [PATCH 4/6] gpu: nova-core: factor .fwsignature* selection into a new get_gsp_sigs_section() John Hubbard
2025-11-06  3:54 ` [PATCH 5/6] gpu: nova-core: regs.rs: clean up chipset(), architecture() John Hubbard
2025-11-06 14:39   ` Timur Tabi
2025-11-06 22:23     ` John Hubbard
2025-11-06  3:54 ` [PATCH 6/6] gpu: nova-core: use gpu::Architecture instead of long lists of GPUs John Hubbard
2025-11-06 14:41   ` Timur Tabi
2025-11-06 21:42     ` Danilo Krummrich
2025-11-06 22:18       ` John Hubbard
2025-11-06 23:30         ` Danilo Krummrich
2025-11-07  1:27           ` John Hubbard

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=DECBSKQQ8SZ4.1B1D97HLUESDD@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=a.hindborg@kernel.org \
    --cc=airlied@gmail.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=apopple@nvidia.com \
    --cc=bhelgaas@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=epeer@nvidia.com \
    --cc=gary@garyguo.net \
    --cc=jhubbard@nvidia.com \
    --cc=joelagnelf@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=nouveau-bounces@lists.freedesktop.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tmgross@umich.edu \
    --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;
as well as URLs for NNTP newsgroup(s).