public inbox for intel-xe@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: intel-xe@lists.freedesktop.org
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Subject: [CI] drm: Ensure ioctls are drained before device unplug
Date: Tue, 14 Apr 2026 11:15:52 +0200	[thread overview]
Message-ID: <20260414091552.6153-1-thomas.hellstrom@linux.intel.com> (raw)

There is a check that blocks ioctls after device unplug,
but we have no check that running ioctls have actually
completed at unplug time. (And for some IOCTLs like
fence waits, that actually makes sense).
However, implement ioctl draining to have CI check for
lockdep issues.

Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
 drivers/gpu/drm/drm_ioctl.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index ff193155129e..c87a925f0fe4 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -789,19 +789,22 @@ long drm_ioctl_kernel(struct file *file, drm_ioctl_t *func, void *kdata,
 {
 	struct drm_file *file_priv = file->private_data;
 	struct drm_device *dev = file_priv->minor->dev;
-	int ret;
+	int ret, idx;
 
 	/* Update drm_file owner if fd was passed along. */
 	drm_file_update_pid(file_priv);
 
-	if (drm_dev_is_unplugged(dev))
+	if (!drm_dev_enter(dev, &idx))
 		return -ENODEV;
 
 	ret = drm_ioctl_permit(flags, file_priv);
 	if (unlikely(ret))
-		return ret;
+		goto out;
 
-	return func(dev, kdata, file_priv);
+	ret = func(dev, kdata, file_priv);
+ out:
+	drm_dev_exit(idx);
+	return ret;
 }
 EXPORT_SYMBOL(drm_ioctl_kernel);
 
-- 
2.53.0


             reply	other threads:[~2026-04-14  9:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-14  9:15 Thomas Hellström [this message]
2026-04-14  9:25 ` ✓ CI.KUnit: success for drm: Ensure ioctls are drained before device unplug Patchwork
2026-04-14 11:16 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-14 12:24 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-04-21  8:00 ` [CI] " Matthew Brost
2026-04-21 12:56   ` 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=20260414091552.6153-1-thomas.hellstrom@linux.intel.com \
    --to=thomas.hellstrom@linux.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