From: "Gary Guo" <gary@garyguo.net>
To: "Danilo Krummrich" <dakr@kernel.org>, <aliceryhl@google.com>,
<acourbot@nvidia.com>, <daniel.almeida@collabora.com>,
<ojeda@kernel.org>, <boqun@kernel.org>, <gary@garyguo.net>,
<bjorn3_gh@protonmail.com>, <lossin@kernel.org>,
<a.hindborg@kernel.org>, <tmgross@umich.edu>, <tamird@kernel.org>,
<work@onurozkan.dev>, <brauner@kernel.org>, <lyude@redhat.com>,
<j@jananu.net>, <alvin.sun@linux.dev>,
<deborah.brouwer@collabora.com>, <laura.nao@collabora.com>,
<beata.michalska@arm.com>
Cc: <nova-gpu@lists.linux.dev>, <dri-devel@lists.freedesktop.org>,
<rust-for-linux@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 7/7] rust: drm: make Driver::File lifetime-parameterized
Date: Thu, 19 Nov 2026 11:21:10 +0000 [thread overview]
Message-ID: <DMZ5BVNPA3LK.13FNSF2VLYTWD@garyguo.net> (raw)
In-Reply-To: <20261118163203.2483856-8-dakr@kernel.org>
On Wed Nov 18, 2026 at 4:29 PM GMT, Danilo Krummrich wrote:
> Make the DRM file private data lifetime-parameterized, allowing drivers
> to borrow from RegistrationData in their per-file data.
>
> Introduce DriverFile<'a> as a lifetime-parameterized trait that receives
> both the device and registration data in open(). Parametrize File<D> on
> the driver type rather than the file data type, deriving the concrete
> file type through Driver::File<'a>.
>
> Add inner_with() to access the driver file data from a File<D> reference.
>
> Ensure file data is always dropped before registration data:
>
> - In Registration::drop(), detach driver_priv for all open files under
> filelist_mutex, then drop the detached data after releasing the mutex
> and wait for file-data destruction in concurrent postclose_callback()
> calls via an open_count / WaitQueue pair on drm::Device.
>
> - In postclose_callback(), skip the drop if driver_priv has already
> been NULLed by the filelist iteration. The NULL write is visible
> through the filelist_mutex acquire/release chain in
> drm_close_helper().
>
> Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
> Reviewed-by: Alice Ryhl <aliceryhl@google.com>
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Reviewed-by: Gary Guo <gary@garyguo.net>
> ---
> drivers/gpu/drm/nova/driver.rs | 2 +-
> drivers/gpu/drm/nova/file.rs | 13 ++-
> drivers/gpu/drm/nova/gem.rs | 8 +-
> drivers/gpu/drm/tyr/driver.rs | 2 +-
> drivers/gpu/drm/tyr/file.rs | 11 ++-
> rust/kernel/drm/device.rs | 31 +++++-
> rust/kernel/drm/driver.rs | 113 +++++++++++++++++++--
> rust/kernel/drm/file.rs | 173 ++++++++++++++++++++++++---------
> rust/kernel/drm/gem/mod.rs | 44 ++++++---
> rust/kernel/drm/gem/shmem.rs | 9 +-
> rust/kernel/drm/ioctl.rs | 6 +-
> 11 files changed, 322 insertions(+), 90 deletions(-)
prev parent reply other threads:[~2026-11-19 11:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 16:29 [PATCH v3 0/7] lifetime-parameterized DRM File private data Danilo Krummrich
2026-11-18 16:29 ` [PATCH v3 1/7] rust: drm: rename Ioctl device context to Userspace Danilo Krummrich
2026-11-18 16:29 ` [PATCH v3 2/7] rust: drm: gem: gate open/close callbacks with RegistrationGuard Danilo Krummrich
2026-11-18 16:29 ` [PATCH v3 3/7] rust: drm: move file_operations from gem to device Danilo Krummrich
2026-11-18 16:29 ` [PATCH v3 4/7] rust: fs: add iminor() helper Danilo Krummrich
2026-11-18 16:29 ` [PATCH v3 5/7] rust: drm: wrap fops open with RegistrationGuard Danilo Krummrich
2026-11-18 16:29 ` [PATCH v3 6/7] rust: drm: return impl PinInit from DriverFile::open() Danilo Krummrich
2026-11-18 16:29 ` [PATCH v3 7/7] rust: drm: make Driver::File lifetime-parameterized Danilo Krummrich
2026-11-19 11:17 ` Alice Ryhl
2026-11-19 11:21 ` Gary Guo [this message]
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=DMZ5BVNPA3LK.13FNSF2VLYTWD@garyguo.net \
--to=gary@garyguo.net \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=aliceryhl@google.com \
--cc=alvin.sun@linux.dev \
--cc=beata.michalska@arm.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=brauner@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=deborah.brouwer@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=j@jananu.net \
--cc=laura.nao@collabora.com \
--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=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.dev \
/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
all inboxes | Powered by JetHome®