public inbox for intel-xe@lists.freedesktop.org
 help / color / mirror / Atom feed
* [CI] drm: Ensure ioctls are drained before device unplug
@ 2026-04-14  9:15 Thomas Hellström
  2026-04-14  9:25 ` ✓ CI.KUnit: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Thomas Hellström @ 2026-04-14  9:15 UTC (permalink / raw)
  To: intel-xe; +Cc: Thomas Hellström

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-04-21 12:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-14  9:15 [CI] drm: Ensure ioctls are drained before device unplug Thomas Hellström
2026-04-14  9:25 ` ✓ CI.KUnit: success for " 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox