NVIDIA GPU driver infrastructure
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: "Danilo Krummrich" <dakr@kernel.org>
Cc: "Deborah Brouwer" <deborah.brouwer@collabora.com>,
	<aliceryhl@google.com>, <airlied@gmail.com>, <simona@ffwll.ch>,
	<daniel.almeida@collabora.com>, <acourbot@nvidia.com>,
	<apopple@nvidia.com>, <ecourtney@nvidia.com>, <lyude@redhat.com>,
	<ojeda@kernel.org>, <boqun@kernel.org>, <gary@garyguo.net>,
	<bjorn3_gh@protonmail.com>, <lossin@kernel.org>,
	<a.hindborg@kernel.org>, <tmgross@umich.edu>,
	<driver-core@lists.linux.dev>, <nova-gpu@lists.linux.dev>,
	<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
	<rust-for-linux@vger.kernel.org>
Subject: Re: [PATCH 0/6] rust: drm: Higher-Ranked Lifetime private data
Date: Wed, 20 May 2026 08:38:13 +0200	[thread overview]
Message-ID: <20260520083813.7addec83@fedora> (raw)
In-Reply-To: <DIMWGLNJ922I.3PCET9O1J83TS@kernel.org>

On Tue, 19 May 2026 21:28:17 +0200
"Danilo Krummrich" <dakr@kernel.org> wrote:

> On Tue May 19, 2026 at 8:59 PM CEST, Boris Brezillon wrote:
> > On Thu, 14 May 2026 21:07:11 +0200
> > "Danilo Krummrich" <dakr@kernel.org> wrote:
> >  
> >> On Thu May 14, 2026 at 8:59 PM CEST, Deborah Brouwer wrote:  
> >> > let unreg_dev = drm::UnregisteredDevice::<TyrDrmDriver>::new(pdev, data)?;    
> >> 
> >> You shouldn't need this anymore as the drm::Registration itself has private data
> >> now that is bound to the lifetime of the underlying bus device, which should be
> >> the correct lifetime for juggling the GPU page tables.  
> >
> > The problem we have is that, to initialize some of the sub-components
> > of the driver, we need to be able to allocate GEM objects before the DRM
> > device is exposed (registered), and because the data we want to attach
> > to the final registration contains these sub-components, we need to
> > defer the data assignment to the registration step (which was allowed
> > by [1], but apparently this was dropped from the latest version of
> > the series for some reason).  
> 
> I'm perfectly aware, what I'm saying above is that you probably want to store
> those GEM objects (that you can create with the previously allocated
> drm::Device) in the drm::Registration data. This fulfills this requirement *and*
> ties the lifetime of those GEM objects to the lifetime of the underlying bus
> device being bound to the driver, which is exactly what you want for GEM objects
> that contain the device page tables.

Yeah, I don't think the problem Deborah was mentioning was about not
being able to allocate GEMs early on, or making sure those GEMs don't
outlive the bus-device. Oh, and BTW, we don't use GEMs for the page
tables themselves, those still go through regular page allocation and
are entirely handled by the io-pgtable-arm.c logic. We need early GEM
allocation to populate FW sections, and to map those to the VM attached
to the FW we need GPUVM too (because the FW also lives behind the GPU
MMU and has its own page table that's populated by the driver).

What I think Deborah was pointing out is the chicken-and-egg issue,
where the registration data is only fully populated after all
sub-components of the drivers have been initialized, and one of these
sub-components (the FW) needs to allocate GEMs and map them to its VM.
So, GEM allocation and GPUVM are required are required early on, and
both want a drm::Device of some sort (Unregistered or Registered). So
the question is, are you happy with having [1] applied before/after
your patchset to address this chicken-and-egg issue I mentioned, or are
you proposing something else (Option<Subcomponent> so that we start
with all sub-components set to None and progressively populate those,
which I remember Daniel was strongly opposed to)?

[1]https://lore.kernel.org/dri-devel/20260320233645.950190-4-lyude@redhat.com/  

  reply	other threads:[~2026-05-20  6:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06 22:05 [PATCH 0/6] rust: drm: Higher-Ranked Lifetime private data Danilo Krummrich
2026-05-06 22:05 ` [PATCH 1/6] rust: drm: Add Driver::ParentDevice associated type Danilo Krummrich
2026-05-08 21:49   ` lyude
2026-05-06 22:06 ` [PATCH 2/6] rust: drm: Add UnbindGuard for drm_dev_enter/exit critical sections Danilo Krummrich
2026-05-06 22:06 ` [PATCH 3/6] rust: drm: Add RegistrationData to drm::Driver Danilo Krummrich
2026-05-06 22:06 ` [PATCH 4/6] rust: drm: Wrap ioctl dispatch in UnbindGuard Danilo Krummrich
2026-05-06 22:06 ` [PATCH 5/6] rust: drm: Pass registration data to ioctl handlers Danilo Krummrich
2026-05-06 22:06 ` [PATCH 6/6] rust: drm: Pass bound parent device " Danilo Krummrich
2026-05-07  9:38 ` [PATCH 0/6] rust: drm: Higher-Ranked Lifetime private data Danilo Krummrich
2026-05-14 18:59   ` Deborah Brouwer
2026-05-14 19:07     ` Danilo Krummrich
2026-05-19 18:59       ` Boris Brezillon
2026-05-19 19:02         ` lyude
2026-05-19 19:28         ` Danilo Krummrich
2026-05-20  6:38           ` Boris Brezillon [this message]
2026-05-20 10:55             ` Danilo Krummrich
2026-05-20 11:25               ` Boris Brezillon

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=20260520083813.7addec83@fedora \
    --to=boris.brezillon@collabora.com \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=apopple@nvidia.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=deborah.brouwer@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=driver-core@lists.linux.dev \
    --cc=ecourtney@nvidia.com \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=lyude@redhat.com \
    --cc=nova-gpu@lists.linux.dev \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tmgross@umich.edu \
    /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