On Sun Jun 28, 2026 at 11:53 PM JST, Danilo Krummrich wrote: > Restrict AlwaysRefCounted for gem::Object and gem::shmem::Object to the > Normal context, since only Normal objects should be independently > reference-counted. > > To avoid cascading through IntoGEMObject (which had AlwaysRefCounted as > a supertrait), remove AlwaysRefCounted from IntoGEMObject's supertraits > and instead add it as an explicit bound on lookup_handle(), which is the > only BaseObject method that returns an ARef. > > Since Object::new() and shmem::Object::new() return ARef<Self>, move > them to Normal-only impl blocks. Similarly, simplify ObjectConfig and > shmem's parent_resv_obj field to the Normal context. > > Remove the DeviceContext generic from DriverObject::new() and > Driver::Object, since GEM objects can only be constructed in the Normal > context. Simplify DriverAllocImpl accordingly.
I think this last item could be its own patch - it wouldn't introduce any extra churn, and would separate the concepts (restricting GEM references to `Normal` context, and updating the API) nicely, making the first patch a bit more focused (~+20/-35 LoCs extracted from it). But even without this, Reviewed-by: Alexandre Courbot <[email protected]>
