dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: "Christian König" <christian.koenig@amd.com>,
	intel-xe@lists.freedesktop.org
Cc: Matthew Brost <matthew.brost@intel.com>,
	Maarten Lankhorst	 <maarten.lankhorst@linux.intel.com>,
	Dave Airlie <airlied@gmail.com>,
	Simona Vetter <simona.vetter@ffwll.ch>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm: Provide a drm_dev_release_barrier() function to wait for device release callbacks
Date: Mon, 16 Mar 2026 21:36:14 +0100	[thread overview]
Message-ID: <942eef488f5b6c75b7961547a5e8200f1f8799ad.camel@linux.intel.com> (raw)
In-Reply-To: <99d0cdb184b5e67634f8306da0ffd7ffce2f041b.camel@linux.intel.com>

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	other threads:[~2026-03-16 20:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-16 16:20 [PATCH 0/2] drm,drm/xe: Relax helper module reference requirement Thomas Hellström
2026-03-16 16:20 ` [PATCH 1/2] drm: Provide a drm_dev_release_barrier() function to wait for device release callbacks Thomas Hellström
2026-03-16 17:42   ` Christian König
2026-03-16 20:10     ` Thomas Hellström
2026-03-16 20:36       ` Thomas Hellström [this message]
2026-03-16 16:20 ` [PATCH 2/2] drm/xe: Don't unload the driver until all drm devices are freed Thomas Hellström

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=942eef488f5b6c75b7961547a5e8200f1f8799ad.camel@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=matthew.brost@intel.com \
    --cc=simona.vetter@ffwll.ch \
    /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