Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nitin Gote <nitin.r.gote@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Nitin Gote <nitin.r.gote@intel.com>
Subject: [PATCH 0/2] drm/xe/guc: handle exec queue teardown after hot-unplug
Date: Tue, 11 Aug 2026 19:07:54 +0530	[thread overview]
Message-ID: <20260811133753.1742666-4-nitin.r.gote@intel.com> (raw)

This series moves the hot-unplug handling for GuC exec queue teardown into
the GuC message submision layer.

The issue was seen with the new core_hotunplug "with-load" IGT subtests,
where an exec queue can be destroyed from a deferred fd close after the
device has already been hot-unplugged:

  guc_exec_queue_add_msg()
  guc_exec_queue_destroy()
  xe_exec_queue_destroy()
  xe_file_close()

The warning is:

  Missing outer runtime PM protection

After some debugging, this does not look like a missing runtime PM
reference or a zero usage count. At the warning point I saw:
usage_count=3, status=RPM_SUSPENDED and disable_depth=1

During hot-unplug, the PCI remove path disables runtime PM. The old
struct device can still remain alive because the old drm_device is still
referenced by an open fd. When that fd is finally closed,
guc_exec_queue_destroy() runs on the old device where runtime PM is
already disabled. In that state pm_runtime_get_if_in_use() returns
-EINVAL even with a non-zero usage count, so
xe_pm_runtime_get_noresume() cannot observe the existing PM state and
warns.

Instead of suppressing the warning in xe_pm_runtime_get_noresume(), this
series handles the unplug case where the GuC exec queue message is queued
and processed.

Patch 1 reworks the GuC exec queue message teardown handling.
Patch 2 removes EXEC_QUEUE_FLAG_PERMANENT, which is no longer needed.

Observed with new igt tests:

  igt@core_hotunplug@hotreplug-with-load
  igt@core_hotunplug@hotunplug-rescan-with-load
  
Link: https://patchwork.freedesktop.org/patch/725773/?series=166744&rev=4

v2:
 - Drop the drm_dev_is_unplugged() bypass from guc_exec_queue_destroy()
   and instead exclude hot-unplug from the WARN in
   xe_pm_runtime_get_noresume().

v3:
 - Rework the fix in the message-submission layer instead of touching the
   WARN; gate PM/HW work on drm_dev_enter() and route all queues through
   the CLEANUP message. (Matthew Brost)
 - Prove the root cause (runtime PM disabled on unplug, not a zero
   refcount) and record it in the commit message. (Matt B, Raag Jadav)
 - Also remove EXEC_QUEUE_FLAG_PERMANENT flag in
   separate patch (Matthew Brost)


Nitin Gote (2):
  drm/xe/guc: rework exec queue teardown PM/unplug handling
  drm/xe: remove EXEC_QUEUE_FLAG_PERMANENT

 drivers/gpu/drm/xe/xe_exec_queue.c       |  3 -
 drivers/gpu/drm/xe/xe_exec_queue_types.h | 14 ++--
 drivers/gpu/drm/xe/xe_gsc.c              |  3 +-
 drivers/gpu/drm/xe/xe_guc_submit.c       | 98 ++++++++++++------------
 drivers/gpu/drm/xe/xe_migrate.c          |  2 -
 drivers/gpu/drm/xe/xe_pm.c               |  5 ++
 drivers/gpu/drm/xe/xe_pxp_submit.c       |  5 +-
 drivers/gpu/drm/xe/xe_sriov_vf_ccs.c     |  1 -
 drivers/gpu/drm/xe/xe_vm.c               |  1 -
 9 files changed, 65 insertions(+), 67 deletions(-)

-- 
2.50.1


             reply	other threads:[~2026-08-11 13:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11 13:37 Nitin Gote [this message]
2026-08-11 13:07 ` ✓ CI.KUnit: success for drm/xe/guc: handle exec queue teardown after hot-unplug Patchwork
2026-08-11 13:37 ` [PATCH 1/2] drm/xe/guc: rework exec queue teardown PM/unplug handling Nitin Gote
2026-08-13  6:46   ` Upadhyay, Tejas
2026-08-19  5:29   ` Gupta, Varun
2026-08-19  6:18     ` Gote, Nitin R
2026-08-11 13:37 ` [PATCH 2/2] drm/xe: remove EXEC_QUEUE_FLAG_PERMANENT Nitin Gote
2026-08-11 23:36   ` Matthew Brost
2026-08-13  6:40   ` Upadhyay, Tejas
2026-08-11 13:45 ` ✓ Xe.CI.BAT: success for drm/xe/guc: handle exec queue teardown after hot-unplug Patchwork
2026-08-11 14:50 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-08-14  4:23   ` Gote, Nitin R

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=20260811133753.1742666-4-nitin.r.gote@intel.com \
    --to=nitin.r.gote@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /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