From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: rust: drm: Higher-Ranked Lifetime private data Date: Thu, 07 May 2026 12:45:08 +1000 Message-ID: In-Reply-To: <20260506221027.858481-1-dakr@kernel.org> References: <20260506221027.858481-1-dakr@kernel.org> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Overall Series Review Subject: rust: drm: Higher-Ranked Lifetime private data Author: Danilo Krummrich Patches: 7 Reviewed: 2026-05-07T12:45:08.215356 --- This is a well-structured 6-patch series from Danilo Krummrich that adds li= fetime-safe access to parent bus device state from DRM ioctl handlers in th= e Rust DRM abstractions. The core problem is real and important: DRM ioctls= run in process context with no guarantee the parent bus device is still bo= und, so drivers need a safe mechanism to check/guard against unbinding. The design is sound: 1. **Type-level parent device declaration** (patch 1) =E2=80=94 ensures the= DRM device knows its parent bus type at compile time. 2. **UnbindGuard** (patch 2) =E2=80=94 wraps `drm_dev_enter/exit` SRCU crit= ical sections, providing a safe Rust guard that proves the device is bound. 3. **RegistrationData with ForLt** (patch 3) =E2=80=94 uses higher-ranked l= ifetimes to store data whose logical lifetime is tied to the device binding= scope, with `mem::transmute` for lifetime erasure/recovery. 4. **Ioctl integration** (patches 4-6) =E2=80=94 wraps every ioctl dispatch= in an UnbindGuard and passes both the bound parent device and registration= data to handlers. The switch from `drm_dev_unregister()` to `drm_dev_unplug()` in patch 2 is = the critical enabler =E2=80=94 it provides the SRCU barrier that makes the = `UnbindGuard` safety argument valid. **Key dependency**: This series requires both the `ForLt` trait (from a sep= arate series [1]) and Lyude's `drm::DeviceContext` work, neither of which a= re in the current drm-next tree. The patches cannot be applied standalone. **Overall**: The design is architecturally sound and well-documented. The s= afety arguments are carefully stated. I have a few specific concerns noted = below. --- Generated by Claude Code Patch Reviewer