On Mon, 2026-03-16 at 21:10 +0100, Thomas Hellström wrote:
> On Mon, 2026-03-16 at 18:42 +0100, Christian König wrote:
> > On 3/16/26 17:20, Thomas Hellström wrote:
> > > If helper components, like for example drm_pagemap hold
> > > references
> > > to
> > > drm devices, it's typically possible for the drm driver module to
> > > be
> > > unloaded without that reference being dropped, 
> > 
> > That is an extremely bad idea to begin with, drm_devices should
> > reference the module who issued them.
> 
> They typically don't. If that were the case you wouldn't be able to
> rmmod a module and have device cleanup happen:
> 
> module_exit();
> 
> pci_unregister_driver()-><starts device removal>
> devm_release()-><drop drm device reference>
> drmm_release()
> ...
> <module unloads>
> 
> I was under the impression that this was the behaviour of most device
> drivers and also drm drivers if display isn't enabled.
> (used to work with xe but doesn't anymore for unknown reason).

FWIW, it's display and mei taking an additional reference on the xe
module. Otherwise rmmod triggers an implicit unbind just as expected.

/Thomas

Reply via email to