Re: [PATCH v2 5/7] rust: drm: wrap fops open with RegistrationGuard

From: Gary Guo

Date: Wed Nov 11 2026 - 04:31:38 EST


On Sat Nov 7, 2026 at 2:03 AM GMT, Danilo Krummrich wrote:
> Add a Minor abstraction with RAII release and a fops_open() wrapper that
> holds a RegistrationGuard (drm_dev_enter / drm_dev_exit) across the
> entire drm_open() call.
>
> This guarantees that drm_dev_unplug() in Registration::drop() waits for
> the full open sequence to complete, so all files are visible in the
> filelist when iterating for cleanup.
>
> Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> Reviewed-by: Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx>
> Signed-off-by: Danilo Krummrich <dakr@xxxxxxxxxx>

I wonder if the logic can be implemented in drm_open instead?

Regardless:

Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>

> ---
> rust/kernel/drm/device.rs | 63 ++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 62 insertions(+), 1 deletion(-)