Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Raag Jadav <raag.jadav@intel.com>
To: "Gote, Nitin R" <nitin.r.gote@intel.com>
Cc: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
	"Brost, Matthew" <matthew.brost@intel.com>,
	"Auld, Matthew" <matthew.auld@intel.com>
Subject: Re: [PATCH] drm/xe/pm: do not warn about missing runtime PM protection after hot-unplug
Date: Thu, 6 Aug 2026 08:27:44 +0200	[thread overview]
Message-ID: <anQpYPO3Ne4a9GzS@black.igk.intel.com> (raw)
In-Reply-To: <SA3PR11MB8118FDD028B722BD940FBE85D0D22@SA3PR11MB8118.namprd11.prod.outlook.com>

On Thu, Aug 06, 2026 at 11:39:50AM +0530, Gote, Nitin R wrote:
> > From: Jadav, Raag <raag.jadav@intel.com>
> > On Thu, Jul 30, 2026 at 05:35:26PM +0530, Gote, Nitin R wrote:
> > > > From: Jadav, Raag <raag.jadav@intel.com> On Thu, Jul 30, 2026 at
> > > > 11:06:36AM +0530, Nitin Gote wrote:
> > > > > After hot-unplug, device_del() disables runtime PM. A deferred fd
> > > > > close can still run later during process exit and destroy
> > > > > remaining exec queues, which may call xe_pm_runtime_get_noresume().
> > > >
> > > > This sounds like could cause many other side effects. Why not make
> > > > sure the exec queues are taken care of as part of hot-unplug path?
> > > >
> > >
> > > Here In igt@core_hotunplug@hotreplug-with-load and
> > > igt@core_hotunplug@hotunplug-rescan-with-load subtests, the workload
> > > keeps the DRM fd open while the device is pci hot-unplugged. Later, fd
> > > close reaches
> > > guc_exec_queue_destroy() -> guc_exec_queue_add_msg() ->
> > > xe_pm_runtime_get_noresume(), after pci_remove/device_del() path has
> > already called pm_runtime_disable() during pci hot-unplug.
> > >
> > > So the WARN is a false-positive for the already-unplugged device case.
> > > I will update the commit message to make this scope clearer.
> > 
> > I guess my question was, is it safe have the exec queues lying around until fd
> > close? Wouldn't it be more appropriate to have them cleaned up as part of hot-
> > unplug itself?
> > 
> 
> The exec queues are owned by user space through open DRM fds, so they're freed when the fd is closed, not forced at unplug. 
> drm_dev_unplug() marks the device unplugged but keeps the drm_device alive while fds are open, 
> we can't destroy a queue while it's still referenced by an open fd.
> 
> The hardware side is already cleaned up at unplug; guc_fini_hw() runs in the remove path and sanitizes GuC.
> So by the time the fd closes, only the software state of the queue is left, and that's what gets freed here.
> And when it does, the cleanup path checks xe_uc_fw_is_running(), sees GuC is gone, and takes the software only teardown.

Makes sense. Although runtime PM is for when you need to interact with the
hardware, so in my understanding we shouldn't be at this point for software
only teardown, but I'll leave it to you all.

Raag

  reply	other threads:[~2026-08-06  6:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30  5:36 [PATCH] drm/xe/pm: do not warn about missing runtime PM protection after hot-unplug Nitin Gote
2026-07-30  5:06 ` ✓ CI.KUnit: success for " Patchwork
2026-07-30  5:45 ` ✓ Xe.CI.BAT: " Patchwork
2026-07-30  5:59 ` [PATCH] " Raag Jadav
2026-07-30 12:05   ` Gote, Nitin R
2026-07-30 12:31     ` Raag Jadav
2026-08-06  6:09       ` Gote, Nitin R
2026-08-06  6:27         ` Raag Jadav [this message]
2026-07-30  6:39 ` ✓ Xe.CI.FULL: success for " Patchwork
2026-07-30 12:35 ` [PATCH] " Matthew Auld
2026-08-06  6:10   ` Gote, Nitin R
  -- strict thread matches above, loose matches on Subject: below --
2026-08-06  8:57 Nitin Gote
2026-08-06  8:30 ` Raag Jadav
2026-08-06  9:38   ` Matthew Brost
2026-08-06 19:01     ` Matthew Brost
2026-08-07 13:38       ` Gote, Nitin R
2026-08-07 18:39         ` Matthew Brost

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=anQpYPO3Ne4a9GzS@black.igk.intel.com \
    --to=raag.jadav@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=nitin.r.gote@intel.com \
    /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