intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH 1/5] drm/debugfs: drop debugfs_init() for the render and accel node v2
@ 2023-03-31  9:07 Christian König
  2023-03-31  9:07 ` [Intel-gfx] [PATCH 2/5] drm/debugfs: rework debugfs directory creation v3 Christian König
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Christian König @ 2023-03-31  9:07 UTC (permalink / raw)
  To: intel-gfx

We want to remove per minor debugfs directories. Start by stopping
drivers from adding anything inside of those in the mid layer callback.

v2: drop it for the accel node as well

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/accel/drm_accel.c     | 3 ---
 drivers/gpu/drm/drm_debugfs.c | 2 +-
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/accel/drm_accel.c b/drivers/accel/drm_accel.c
index 1b69824286fd..d473388ee807 100644
--- a/drivers/accel/drm_accel.c
+++ b/drivers/accel/drm_accel.c
@@ -99,9 +99,6 @@ void accel_debugfs_init(struct drm_minor *minor, int minor_id)
 
 	drm_debugfs_create_files(accel_debugfs_list, ACCEL_DEBUGFS_ENTRIES,
 				 minor->debugfs_root, minor);
-
-	if (dev->driver->debugfs_init)
-		dev->driver->debugfs_init(minor);
 }
 
 /**
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index 4855230ba2c6..54376e2400bb 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -242,7 +242,7 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
 		drm_client_debugfs_init(minor);
 	}
 
-	if (dev->driver->debugfs_init)
+	if (dev->driver->debugfs_init && dev->render != minor)
 		dev->driver->debugfs_init(minor);
 
 	list_for_each_entry_safe(entry, tmp, &dev->debugfs_list, list) {
-- 
2.34.1


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

* [Intel-gfx] [PATCH 2/5] drm/debugfs: rework debugfs directory creation v3
  2023-03-31  9:07 [Intel-gfx] [PATCH 1/5] drm/debugfs: drop debugfs_init() for the render and accel node v2 Christian König
@ 2023-03-31  9:07 ` Christian König
  2023-03-31  9:07 ` [Intel-gfx] [PATCH 3/5] drm/debugfs: remove dev->debugfs_list and debugfs_mutex v2 Christian König
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Christian König @ 2023-03-31  9:07 UTC (permalink / raw)
  To: intel-gfx

Instead of the per minor directories only create a single debugfs
directory for the whole device directly when the device is initialized.

For DRM devices each minor gets a symlink to the per device directory
for now until we can be sure that this isn't useful any more in any way.

Accel devices create only the per device directory and also drops the mid
layer callback to create driver specific files.

v2: cleanup accel component as well
v3: fix typo when debugfs is disabled

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/accel/drm_accel.c           | 27 ++++++++-----
 drivers/gpu/drm/drm_atomic.c        |  4 +-
 drivers/gpu/drm/drm_client.c        |  4 +-
 drivers/gpu/drm/drm_crtc_internal.h |  2 +-
 drivers/gpu/drm/drm_debugfs.c       | 60 ++++++++++++++++++-----------
 drivers/gpu/drm/drm_drv.c           | 18 +++++++--
 drivers/gpu/drm/drm_framebuffer.c   |  4 +-
 drivers/gpu/drm/drm_internal.h      | 16 +++++---
 include/drm/drm_accel.h             |  9 ++++-
 include/drm/drm_client.h            |  2 +-
 include/drm/drm_device.h            |  7 ++++
 include/drm/drm_drv.h               |  8 ++++
 include/drm/drm_file.h              |  1 +
 13 files changed, 110 insertions(+), 52 deletions(-)

diff --git a/drivers/accel/drm_accel.c b/drivers/accel/drm_accel.c
index d473388ee807..e28fb64cbd5e 100644
--- a/drivers/accel/drm_accel.c
+++ b/drivers/accel/drm_accel.c
@@ -79,26 +79,33 @@ static const struct drm_info_list accel_debugfs_list[] = {
 #define ACCEL_DEBUGFS_ENTRIES ARRAY_SIZE(accel_debugfs_list)
 
 /**
- * accel_debugfs_init() - Initialize debugfs for accel minor
+ * accel_debugfs_init() - Register debugfs for accel minor
+ * @dev: Pointer to the device instance.
+ *
+ * This function creates a root directory for the device in debugfs.
+ */
+void accel_debugfs_init(struct drm_device *dev)
+{
+	drm_debugfs_dev_init(dev, accel_debugfs_root);
+}
+
+/**
+ * accel_debugfs_register() - Register debugfs for device
  * @minor: Pointer to the drm_minor instance.
  * @minor_id: The minor's id
  *
- * This function initializes the drm minor's debugfs members and creates
- * a root directory for the minor in debugfs. It also creates common files
- * for accelerators and calls the driver's debugfs init callback.
+ * Creates common files for accelerators.
  */
-void accel_debugfs_init(struct drm_minor *minor, int minor_id)
+void accel_debugfs_register(struct drm_device *dev)
 {
-	struct drm_device *dev = minor->dev;
-	char name[64];
+	struct drm_minor *minor = dev->accel;
 
 	INIT_LIST_HEAD(&minor->debugfs_list);
 	mutex_init(&minor->debugfs_lock);
-	sprintf(name, "%d", minor_id);
-	minor->debugfs_root = debugfs_create_dir(name, accel_debugfs_root);
+	minor->debugfs_root = dev->debugfs_root;
 
 	drm_debugfs_create_files(accel_debugfs_list, ACCEL_DEBUGFS_ENTRIES,
-				 minor->debugfs_root, minor);
+				 dev->debugfs_root, minor);
 }
 
 /**
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index fed41800fea7..1cc11b948f64 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -1771,9 +1771,9 @@ static const struct drm_debugfs_info drm_atomic_debugfs_list[] = {
 	{"state", drm_state_info, 0},
 };
 
-void drm_atomic_debugfs_init(struct drm_minor *minor)
+void drm_atomic_debugfs_init(struct drm_device *dev)
 {
-	drm_debugfs_add_files(minor->dev, drm_atomic_debugfs_list,
+	drm_debugfs_add_files(dev, drm_atomic_debugfs_list,
 			      ARRAY_SIZE(drm_atomic_debugfs_list));
 }
 #endif
diff --git a/drivers/gpu/drm/drm_client.c b/drivers/gpu/drm/drm_client.c
index f6292ba0e6fc..a91132276f21 100644
--- a/drivers/gpu/drm/drm_client.c
+++ b/drivers/gpu/drm/drm_client.c
@@ -514,9 +514,9 @@ static const struct drm_debugfs_info drm_client_debugfs_list[] = {
 	{ "internal_clients", drm_client_debugfs_internal_clients, 0 },
 };
 
-void drm_client_debugfs_init(struct drm_minor *minor)
+void drm_client_debugfs_init(struct drm_device *dev)
 {
-	drm_debugfs_add_files(minor->dev, drm_client_debugfs_list,
+	drm_debugfs_add_files(dev, drm_client_debugfs_list,
 			      ARRAY_SIZE(drm_client_debugfs_list));
 }
 #endif
diff --git a/drivers/gpu/drm/drm_crtc_internal.h b/drivers/gpu/drm/drm_crtc_internal.h
index 501a10edd0e1..8556c3b3ff88 100644
--- a/drivers/gpu/drm/drm_crtc_internal.h
+++ b/drivers/gpu/drm/drm_crtc_internal.h
@@ -232,7 +232,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
 /* drm_atomic.c */
 #ifdef CONFIG_DEBUG_FS
 struct drm_minor;
-void drm_atomic_debugfs_init(struct drm_minor *minor);
+void drm_atomic_debugfs_init(struct drm_device *dev);
 #endif
 
 int __drm_atomic_helper_disable_plane(struct drm_plane *plane,
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index 54376e2400bb..59c3d76d28f4 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -218,8 +218,31 @@ void drm_debugfs_create_files(const struct drm_info_list *files, int count,
 }
 EXPORT_SYMBOL(drm_debugfs_create_files);
 
-int drm_debugfs_init(struct drm_minor *minor, int minor_id,
-		     struct dentry *root)
+void drm_debugfs_dev_init(struct drm_device *dev, struct dentry *root)
+{
+	dev->debugfs_root = debugfs_create_dir(dev->unique, root);
+}
+
+void drm_debugfs_dev_fini(struct drm_device *dev)
+{
+	debugfs_remove_recursive(dev->debugfs_root);
+	dev->debugfs_root = NULL;
+}
+
+void drm_debugfs_dev_register(struct drm_device *dev)
+{
+	drm_debugfs_add_files(dev, drm_debugfs_list, DRM_DEBUGFS_ENTRIES);
+
+	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
+		drm_framebuffer_debugfs_init(dev);
+		drm_client_debugfs_init(dev);
+	}
+	if (drm_drv_uses_atomic_modeset(dev))
+		drm_atomic_debugfs_init(dev);
+}
+
+int drm_debugfs_register(struct drm_minor *minor, int minor_id,
+			 struct dentry *root)
 {
 	struct drm_device *dev = minor->dev;
 	struct drm_debugfs_entry *entry, *tmp;
@@ -228,19 +251,11 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
 	INIT_LIST_HEAD(&minor->debugfs_list);
 	mutex_init(&minor->debugfs_lock);
 	sprintf(name, "%d", minor_id);
-	minor->debugfs_root = debugfs_create_dir(name, root);
+	minor->debugfs_symlink = debugfs_create_symlink(name, root,
+							dev->unique);
 
-	drm_debugfs_add_files(minor->dev, drm_debugfs_list, DRM_DEBUGFS_ENTRIES);
-
-	if (drm_drv_uses_atomic_modeset(dev)) {
-		drm_atomic_debugfs_init(minor);
-	}
-
-	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
-		drm_framebuffer_debugfs_init(minor);
-
-		drm_client_debugfs_init(minor);
-	}
+	/* TODO: Only for compatibility with drivers */
+	minor->debugfs_root = dev->debugfs_root;
 
 	if (dev->driver->debugfs_init && dev->render != minor)
 		dev->driver->debugfs_init(minor);
@@ -307,13 +322,12 @@ static void drm_debugfs_remove_all_files(struct drm_minor *minor)
 
 void drm_debugfs_cleanup(struct drm_minor *minor)
 {
-	if (!minor->debugfs_root)
+	if (!minor->debugfs_symlink)
 		return;
 
 	drm_debugfs_remove_all_files(minor);
-
-	debugfs_remove_recursive(minor->debugfs_root);
-	minor->debugfs_root = NULL;
+	debugfs_remove(minor->debugfs_symlink);
+	minor->debugfs_symlink = NULL;
 }
 
 /**
@@ -498,13 +512,13 @@ static const struct file_operations drm_connector_fops = {
 
 void drm_debugfs_connector_add(struct drm_connector *connector)
 {
-	struct drm_minor *minor = connector->dev->primary;
+	struct drm_device *dev = connector->dev;
 	struct dentry *root;
 
-	if (!minor->debugfs_root)
+	if (!dev->debugfs_root)
 		return;
 
-	root = debugfs_create_dir(connector->name, minor->debugfs_root);
+	root = debugfs_create_dir(connector->name, dev->debugfs_root);
 	connector->debugfs_entry = root;
 
 	/* force */
@@ -539,7 +553,7 @@ void drm_debugfs_connector_remove(struct drm_connector *connector)
 
 void drm_debugfs_crtc_add(struct drm_crtc *crtc)
 {
-	struct drm_minor *minor = crtc->dev->primary;
+	struct drm_device *dev = crtc->dev;
 	struct dentry *root;
 	char *name;
 
@@ -547,7 +561,7 @@ void drm_debugfs_crtc_add(struct drm_crtc *crtc)
 	if (!name)
 		return;
 
-	root = debugfs_create_dir(name, minor->debugfs_root);
+	root = debugfs_create_dir(name, dev->debugfs_root);
 	kfree(name);
 
 	crtc->debugfs_entry = root;
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index cee0cc522ed9..05b831f9fe71 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -172,10 +172,9 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type)
 	if (!minor)
 		return 0;
 
-	if (minor->type == DRM_MINOR_ACCEL) {
-		accel_debugfs_init(minor, minor->index);
-	} else {
-		ret = drm_debugfs_init(minor, minor->index, drm_debugfs_root);
+	if (minor->type != DRM_MINOR_ACCEL) {
+		ret = drm_debugfs_register(minor, minor->index,
+					   drm_debugfs_root);
 		if (ret) {
 			DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n");
 			goto err_debugfs;
@@ -697,6 +696,11 @@ static int drm_dev_init(struct drm_device *dev,
 		goto err;
 	}
 
+	if (drm_core_check_feature(dev, DRIVER_COMPUTE_ACCEL))
+		accel_debugfs_init(dev);
+	else
+		drm_debugfs_dev_init(dev, drm_debugfs_root);
+
 	return 0;
 
 err:
@@ -916,6 +920,11 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
 	if (drm_dev_needs_global_mutex(dev))
 		mutex_lock(&drm_global_mutex);
 
+	if (drm_core_check_feature(dev, DRIVER_COMPUTE_ACCEL))
+		accel_debugfs_register(dev);
+	else
+		drm_debugfs_dev_register(dev);
+
 	ret = drm_minor_register(dev, DRM_MINOR_RENDER);
 	if (ret)
 		goto err_minors;
@@ -999,6 +1008,7 @@ void drm_dev_unregister(struct drm_device *dev)
 	drm_minor_unregister(dev, DRM_MINOR_ACCEL);
 	drm_minor_unregister(dev, DRM_MINOR_PRIMARY);
 	drm_minor_unregister(dev, DRM_MINOR_RENDER);
+	drm_debugfs_dev_fini(dev);
 }
 EXPORT_SYMBOL(drm_dev_unregister);
 
diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c
index aff3746dedfb..ba51deb6d042 100644
--- a/drivers/gpu/drm/drm_framebuffer.c
+++ b/drivers/gpu/drm/drm_framebuffer.c
@@ -1222,9 +1222,9 @@ static const struct drm_debugfs_info drm_framebuffer_debugfs_list[] = {
 	{ "framebuffer", drm_framebuffer_info, 0 },
 };
 
-void drm_framebuffer_debugfs_init(struct drm_minor *minor)
+void drm_framebuffer_debugfs_init(struct drm_device *dev)
 {
-	drm_debugfs_add_files(minor->dev, drm_framebuffer_debugfs_list,
+	drm_debugfs_add_files(dev, drm_framebuffer_debugfs_list,
 			      ARRAY_SIZE(drm_framebuffer_debugfs_list));
 }
 #endif
diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
index d7e023bbb0d5..5c6e1cadf09b 100644
--- a/drivers/gpu/drm/drm_internal.h
+++ b/drivers/gpu/drm/drm_internal.h
@@ -180,8 +180,10 @@ void drm_gem_vunmap(struct drm_gem_object *obj, struct iosys_map *map);
 
 /* drm_debugfs.c drm_debugfs_crc.c */
 #if defined(CONFIG_DEBUG_FS)
-int drm_debugfs_init(struct drm_minor *minor, int minor_id,
-		     struct dentry *root);
+void drm_debugfs_dev_fini(struct drm_device *dev);
+void drm_debugfs_dev_register(struct drm_device *dev);
+int drm_debugfs_register(struct drm_minor *minor, int minor_id,
+			 struct dentry *root);
 void drm_debugfs_cleanup(struct drm_minor *minor);
 void drm_debugfs_late_register(struct drm_device *dev);
 void drm_debugfs_connector_add(struct drm_connector *connector);
@@ -190,8 +192,12 @@ void drm_debugfs_crtc_add(struct drm_crtc *crtc);
 void drm_debugfs_crtc_remove(struct drm_crtc *crtc);
 void drm_debugfs_crtc_crc_add(struct drm_crtc *crtc);
 #else
-static inline int drm_debugfs_init(struct drm_minor *minor, int minor_id,
-				   struct dentry *root)
+static inline void drm_debugfs_dev_register(struct drm_device *dev)
+{
+}
+
+static inline int drm_debugfs_register(struct drm_minor *minor, int minor_id,
+				       struct dentry *root)
 {
 	return 0;
 }
@@ -257,4 +263,4 @@ int drm_syncobj_query_ioctl(struct drm_device *dev, void *data,
 /* drm_framebuffer.c */
 void drm_framebuffer_print_info(struct drm_printer *p, unsigned int indent,
 				const struct drm_framebuffer *fb);
-void drm_framebuffer_debugfs_init(struct drm_minor *minor);
+void drm_framebuffer_debugfs_init(struct drm_device *dev);
diff --git a/include/drm/drm_accel.h b/include/drm/drm_accel.h
index d4955062c77e..f4d3784b1dce 100644
--- a/include/drm/drm_accel.h
+++ b/include/drm/drm_accel.h
@@ -58,7 +58,8 @@ int accel_minor_alloc(void);
 void accel_minor_replace(struct drm_minor *minor, int index);
 void accel_set_device_instance_params(struct device *kdev, int index);
 int accel_open(struct inode *inode, struct file *filp);
-void accel_debugfs_init(struct drm_minor *minor, int minor_id);
+void accel_debugfs_init(struct drm_device *dev);
+void accel_debugfs_register(struct drm_device *dev);
 
 #else
 
@@ -89,7 +90,11 @@ static inline void accel_set_device_instance_params(struct device *kdev, int ind
 {
 }
 
-static inline void accel_debugfs_init(struct drm_minor *minor, int minor_id)
+static inline void accel_debugfs_init(struct drm_device *dev)
+{
+}
+
+static inline void accel_debugfs_register(struct drm_device *dev)
 {
 }
 
diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h
index c0a14b40c039..d47458ecdac4 100644
--- a/include/drm/drm_client.h
+++ b/include/drm/drm_client.h
@@ -195,6 +195,6 @@ int drm_client_modeset_dpms(struct drm_client_dev *client, int mode);
 	drm_for_each_connector_iter(connector, iter) \
 		if (connector->connector_type != DRM_MODE_CONNECTOR_WRITEBACK)
 
-void drm_client_debugfs_init(struct drm_minor *minor);
+void drm_client_debugfs_init(struct drm_device *dev);
 
 #endif
diff --git a/include/drm/drm_device.h b/include/drm/drm_device.h
index 7cf4afae2e79..3cf12b14232d 100644
--- a/include/drm/drm_device.h
+++ b/include/drm/drm_device.h
@@ -311,6 +311,13 @@ struct drm_device {
 	 */
 	struct drm_fb_helper *fb_helper;
 
+	/**
+	 * @debugfs_root:
+	 *
+	 * Root directory for debugfs files.
+	 */
+	struct dentry *debugfs_root;
+
 	/**
 	 * @debugfs_mutex:
 	 *
diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
index b419c59c4bef..14d5337f4297 100644
--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -590,4 +590,12 @@ static inline bool drm_firmware_drivers_only(void)
 	return video_firmware_drivers_only();
 }
 
+#if defined(CONFIG_DEBUG_FS)
+void drm_debugfs_dev_init(struct drm_device *dev, struct dentry *root);
+#else
+static void drm_debugfs_dev_init(struct drm_device *dev, struct dentry *root)
+{
+}
+#endif
+
 #endif
diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
index ecffe24e2b1b..1fe08fcaa149 100644
--- a/include/drm/drm_file.h
+++ b/include/drm/drm_file.h
@@ -78,6 +78,7 @@ struct drm_minor {
 	struct device *kdev;		/* Linux device */
 	struct drm_device *dev;
 
+	struct dentry *debugfs_symlink;
 	struct dentry *debugfs_root;
 
 	struct list_head debugfs_list;
-- 
2.34.1


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

* [Intel-gfx] [PATCH 3/5] drm/debugfs: remove dev->debugfs_list and debugfs_mutex v2
  2023-03-31  9:07 [Intel-gfx] [PATCH 1/5] drm/debugfs: drop debugfs_init() for the render and accel node v2 Christian König
  2023-03-31  9:07 ` [Intel-gfx] [PATCH 2/5] drm/debugfs: rework debugfs directory creation v3 Christian König
@ 2023-03-31  9:07 ` Christian König
  2023-03-31  9:07 ` [Intel-gfx] [PATCH 4/5] drm/debugfs: rework drm_debugfs_create_files implementation Christian König
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Christian König @ 2023-03-31  9:07 UTC (permalink / raw)
  To: intel-gfx

The mutex was completely pointless in the first place since any
parallel adding of files to this list would result in random
behavior since the list is filled and consumed multiple times.

Completely drop that approach and just create the files directly but
return -ENODEV while opening the file when the minors are not
registered yet.

v2: rebase on debugfs directory rework, limit access before minors are
    registered.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/drm_debugfs.c     | 27 ++-------------------------
 drivers/gpu/drm/drm_drv.c         |  3 ---
 drivers/gpu/drm/drm_internal.h    |  5 -----
 drivers/gpu/drm/drm_mode_config.c |  2 --
 include/drm/drm_device.h          | 15 ---------------
 5 files changed, 2 insertions(+), 50 deletions(-)

diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index 59c3d76d28f4..427c5eb4eca0 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -245,7 +245,6 @@ int drm_debugfs_register(struct drm_minor *minor, int minor_id,
 			 struct dentry *root)
 {
 	struct drm_device *dev = minor->dev;
-	struct drm_debugfs_entry *entry, *tmp;
 	char name[64];
 
 	INIT_LIST_HEAD(&minor->debugfs_list);
@@ -260,30 +259,9 @@ int drm_debugfs_register(struct drm_minor *minor, int minor_id,
 	if (dev->driver->debugfs_init && dev->render != minor)
 		dev->driver->debugfs_init(minor);
 
-	list_for_each_entry_safe(entry, tmp, &dev->debugfs_list, list) {
-		debugfs_create_file(entry->file.name, 0444,
-				    minor->debugfs_root, entry, &drm_debugfs_entry_fops);
-		list_del(&entry->list);
-	}
-
 	return 0;
 }
 
-void drm_debugfs_late_register(struct drm_device *dev)
-{
-	struct drm_minor *minor = dev->primary;
-	struct drm_debugfs_entry *entry, *tmp;
-
-	if (!minor)
-		return;
-
-	list_for_each_entry_safe(entry, tmp, &dev->debugfs_list, list) {
-		debugfs_create_file(entry->file.name, 0444,
-				    minor->debugfs_root, entry, &drm_debugfs_entry_fops);
-		list_del(&entry->list);
-	}
-}
-
 int drm_debugfs_remove_files(const struct drm_info_list *files, int count,
 			     struct drm_minor *minor)
 {
@@ -353,9 +331,8 @@ void drm_debugfs_add_file(struct drm_device *dev, const char *name,
 	entry->file.data = data;
 	entry->dev = dev;
 
-	mutex_lock(&dev->debugfs_mutex);
-	list_add(&entry->list, &dev->debugfs_list);
-	mutex_unlock(&dev->debugfs_mutex);
+	debugfs_create_file(name, 0444, dev->debugfs_root, entry,
+			    &drm_debugfs_entry_fops);
 }
 EXPORT_SYMBOL(drm_debugfs_add_file);
 
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 05b831f9fe71..f928b4490ece 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -597,7 +597,6 @@ static void drm_dev_init_release(struct drm_device *dev, void *res)
 	mutex_destroy(&dev->clientlist_mutex);
 	mutex_destroy(&dev->filelist_mutex);
 	mutex_destroy(&dev->struct_mutex);
-	mutex_destroy(&dev->debugfs_mutex);
 	drm_legacy_destroy_members(dev);
 }
 
@@ -638,14 +637,12 @@ static int drm_dev_init(struct drm_device *dev,
 	INIT_LIST_HEAD(&dev->filelist_internal);
 	INIT_LIST_HEAD(&dev->clientlist);
 	INIT_LIST_HEAD(&dev->vblank_event_list);
-	INIT_LIST_HEAD(&dev->debugfs_list);
 
 	spin_lock_init(&dev->event_lock);
 	mutex_init(&dev->struct_mutex);
 	mutex_init(&dev->filelist_mutex);
 	mutex_init(&dev->clientlist_mutex);
 	mutex_init(&dev->master_mutex);
-	mutex_init(&dev->debugfs_mutex);
 
 	ret = drmm_add_action_or_reset(dev, drm_dev_init_release, NULL);
 	if (ret)
diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
index 5c6e1cadf09b..c5fadbd3fd7d 100644
--- a/drivers/gpu/drm/drm_internal.h
+++ b/drivers/gpu/drm/drm_internal.h
@@ -185,7 +185,6 @@ void drm_debugfs_dev_register(struct drm_device *dev);
 int drm_debugfs_register(struct drm_minor *minor, int minor_id,
 			 struct dentry *root);
 void drm_debugfs_cleanup(struct drm_minor *minor);
-void drm_debugfs_late_register(struct drm_device *dev);
 void drm_debugfs_connector_add(struct drm_connector *connector);
 void drm_debugfs_connector_remove(struct drm_connector *connector);
 void drm_debugfs_crtc_add(struct drm_crtc *crtc);
@@ -206,10 +205,6 @@ static inline void drm_debugfs_cleanup(struct drm_minor *minor)
 {
 }
 
-static inline void drm_debugfs_late_register(struct drm_device *dev)
-{
-}
-
 static inline void drm_debugfs_connector_add(struct drm_connector *connector)
 {
 }
diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
index 87eb591fe9b5..8525ef851540 100644
--- a/drivers/gpu/drm/drm_mode_config.c
+++ b/drivers/gpu/drm/drm_mode_config.c
@@ -54,8 +54,6 @@ int drm_modeset_register_all(struct drm_device *dev)
 	if (ret)
 		goto err_connector;
 
-	drm_debugfs_late_register(dev);
-
 	return 0;
 
 err_connector:
diff --git a/include/drm/drm_device.h b/include/drm/drm_device.h
index 3cf12b14232d..c490977ee250 100644
--- a/include/drm/drm_device.h
+++ b/include/drm/drm_device.h
@@ -318,21 +318,6 @@ struct drm_device {
 	 */
 	struct dentry *debugfs_root;
 
-	/**
-	 * @debugfs_mutex:
-	 *
-	 * Protects &debugfs_list access.
-	 */
-	struct mutex debugfs_mutex;
-
-	/**
-	 * @debugfs_list:
-	 *
-	 * List of debugfs files to be created by the DRM device. The files
-	 * must be added during drm_dev_register().
-	 */
-	struct list_head debugfs_list;
-
 	/* Everything below here is for legacy driver, never use! */
 	/* private: */
 #if IS_ENABLED(CONFIG_DRM_LEGACY)
-- 
2.34.1


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

* [Intel-gfx] [PATCH 4/5] drm/debugfs: rework drm_debugfs_create_files implementation
  2023-03-31  9:07 [Intel-gfx] [PATCH 1/5] drm/debugfs: drop debugfs_init() for the render and accel node v2 Christian König
  2023-03-31  9:07 ` [Intel-gfx] [PATCH 2/5] drm/debugfs: rework debugfs directory creation v3 Christian König
  2023-03-31  9:07 ` [Intel-gfx] [PATCH 3/5] drm/debugfs: remove dev->debugfs_list and debugfs_mutex v2 Christian König
@ 2023-03-31  9:07 ` Christian König
  2023-03-31  9:07 ` [Intel-gfx] [PATCH 5/5] drm/debugfs: remove debugfs_root pointer from minor Christian König
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Christian König @ 2023-03-31  9:07 UTC (permalink / raw)
  To: intel-gfx

Use managed memory allocation for this. That allows us to not keep
track of all the files any more.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/accel/drm_accel.c      |  2 -
 drivers/gpu/drm/drm_debugfs.c  | 75 +++++++++-------------------------
 drivers/gpu/drm/drm_drv.c      |  2 -
 drivers/gpu/drm/drm_internal.h |  5 ---
 drivers/gpu/drm/tegra/dc.c     |  9 +++-
 drivers/gpu/drm/tegra/dsi.c    |  1 +
 drivers/gpu/drm/tegra/hdmi.c   |  3 +-
 drivers/gpu/drm/tegra/sor.c    |  1 +
 include/drm/drm_debugfs.h      |  4 +-
 include/drm/drm_file.h         |  4 --
 10 files changed, 34 insertions(+), 72 deletions(-)

diff --git a/drivers/accel/drm_accel.c b/drivers/accel/drm_accel.c
index e28fb64cbd5e..82c54bc2dcad 100644
--- a/drivers/accel/drm_accel.c
+++ b/drivers/accel/drm_accel.c
@@ -100,8 +100,6 @@ void accel_debugfs_register(struct drm_device *dev)
 {
 	struct drm_minor *minor = dev->accel;
 
-	INIT_LIST_HEAD(&minor->debugfs_list);
-	mutex_init(&minor->debugfs_lock);
 	minor->debugfs_root = dev->debugfs_root;
 
 	drm_debugfs_create_files(accel_debugfs_list, ACCEL_DEBUGFS_ENTRIES,
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index 427c5eb4eca0..c8e2d4f9f00d 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -201,7 +201,7 @@ void drm_debugfs_create_files(const struct drm_info_list *files, int count,
 		if (features && !drm_core_check_all_features(dev, features))
 			continue;
 
-		tmp = kmalloc(sizeof(struct drm_info_node), GFP_KERNEL);
+		tmp = drmm_kzalloc(dev, sizeof(*tmp), GFP_KERNEL);
 		if (tmp == NULL)
 			continue;
 
@@ -210,14 +210,28 @@ void drm_debugfs_create_files(const struct drm_info_list *files, int count,
 						0444, root, tmp,
 						&drm_debugfs_fops);
 		tmp->info_ent = &files[i];
-
-		mutex_lock(&minor->debugfs_lock);
-		list_add(&tmp->list, &minor->debugfs_list);
-		mutex_unlock(&minor->debugfs_lock);
 	}
 }
 EXPORT_SYMBOL(drm_debugfs_create_files);
 
+int drm_debugfs_remove_files(const struct drm_info_list *files, int count,
+			     struct dentry *root, struct drm_minor *minor)
+{
+	int i;
+
+	for (i = 0; i < count; i++) {
+		struct dentry *dent = debugfs_lookup(files[i].name, root);
+
+		if (!dent)
+			continue;
+
+		drmm_kfree(minor->dev, d_inode(dent)->i_private);
+		debugfs_remove(dent);
+	}
+	return 0;
+}
+EXPORT_SYMBOL(drm_debugfs_remove_files);
+
 void drm_debugfs_dev_init(struct drm_device *dev, struct dentry *root)
 {
 	dev->debugfs_root = debugfs_create_dir(dev->unique, root);
@@ -247,11 +261,8 @@ int drm_debugfs_register(struct drm_minor *minor, int minor_id,
 	struct drm_device *dev = minor->dev;
 	char name[64];
 
-	INIT_LIST_HEAD(&minor->debugfs_list);
-	mutex_init(&minor->debugfs_lock);
 	sprintf(name, "%d", minor_id);
-	minor->debugfs_symlink = debugfs_create_symlink(name, root,
-							dev->unique);
+	debugfs_create_symlink(name, root, dev->unique);
 
 	/* TODO: Only for compatibility with drivers */
 	minor->debugfs_root = dev->debugfs_root;
@@ -262,52 +273,6 @@ int drm_debugfs_register(struct drm_minor *minor, int minor_id,
 	return 0;
 }
 
-int drm_debugfs_remove_files(const struct drm_info_list *files, int count,
-			     struct drm_minor *minor)
-{
-	struct list_head *pos, *q;
-	struct drm_info_node *tmp;
-	int i;
-
-	mutex_lock(&minor->debugfs_lock);
-	for (i = 0; i < count; i++) {
-		list_for_each_safe(pos, q, &minor->debugfs_list) {
-			tmp = list_entry(pos, struct drm_info_node, list);
-			if (tmp->info_ent == &files[i]) {
-				debugfs_remove(tmp->dent);
-				list_del(pos);
-				kfree(tmp);
-			}
-		}
-	}
-	mutex_unlock(&minor->debugfs_lock);
-	return 0;
-}
-EXPORT_SYMBOL(drm_debugfs_remove_files);
-
-static void drm_debugfs_remove_all_files(struct drm_minor *minor)
-{
-	struct drm_info_node *node, *tmp;
-
-	mutex_lock(&minor->debugfs_lock);
-	list_for_each_entry_safe(node, tmp, &minor->debugfs_list, list) {
-		debugfs_remove(node->dent);
-		list_del(&node->list);
-		kfree(node);
-	}
-	mutex_unlock(&minor->debugfs_lock);
-}
-
-void drm_debugfs_cleanup(struct drm_minor *minor)
-{
-	if (!minor->debugfs_symlink)
-		return;
-
-	drm_debugfs_remove_all_files(minor);
-	debugfs_remove(minor->debugfs_symlink);
-	minor->debugfs_symlink = NULL;
-}
-
 /**
  * drm_debugfs_add_file - Add a given file to the DRM device debugfs file list
  * @dev: drm device for the ioctl
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index f928b4490ece..9466349769fa 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -198,7 +198,6 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type)
 	return 0;
 
 err_debugfs:
-	drm_debugfs_cleanup(minor);
 	return ret;
 }
 
@@ -222,7 +221,6 @@ static void drm_minor_unregister(struct drm_device *dev, unsigned int type)
 
 	device_del(minor->kdev);
 	dev_set_drvdata(minor->kdev, NULL); /* safety belt */
-	drm_debugfs_cleanup(minor);
 }
 
 /*
diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
index c5fadbd3fd7d..fb2d6601cba8 100644
--- a/drivers/gpu/drm/drm_internal.h
+++ b/drivers/gpu/drm/drm_internal.h
@@ -184,7 +184,6 @@ void drm_debugfs_dev_fini(struct drm_device *dev);
 void drm_debugfs_dev_register(struct drm_device *dev);
 int drm_debugfs_register(struct drm_minor *minor, int minor_id,
 			 struct dentry *root);
-void drm_debugfs_cleanup(struct drm_minor *minor);
 void drm_debugfs_connector_add(struct drm_connector *connector);
 void drm_debugfs_connector_remove(struct drm_connector *connector);
 void drm_debugfs_crtc_add(struct drm_crtc *crtc);
@@ -201,10 +200,6 @@ static inline int drm_debugfs_register(struct drm_minor *minor, int minor_id,
 	return 0;
 }
 
-static inline void drm_debugfs_cleanup(struct drm_minor *minor)
-{
-}
-
 static inline void drm_debugfs_connector_add(struct drm_connector *connector)
 {
 }
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index a67453cee883..e53d1b88dc99 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -1745,8 +1745,15 @@ static void tegra_dc_early_unregister(struct drm_crtc *crtc)
 	unsigned int count = ARRAY_SIZE(debugfs_files);
 	struct drm_minor *minor = crtc->dev->primary;
 	struct tegra_dc *dc = to_tegra_dc(crtc);
+	struct dentry *root;
+
+#ifdef CONFIG_DEBUG_FS
+	root = crtc->debugfs_entry;
+#else
+	root = NULL;
+#endif
 
-	drm_debugfs_remove_files(dc->debugfs_files, count, minor);
+	drm_debugfs_remove_files(dc->debugfs_files, count, root, minor);
 	kfree(dc->debugfs_files);
 	dc->debugfs_files = NULL;
 }
diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c
index de1333dc0d86..90c6782a663c 100644
--- a/drivers/gpu/drm/tegra/dsi.c
+++ b/drivers/gpu/drm/tegra/dsi.c
@@ -256,6 +256,7 @@ static void tegra_dsi_early_unregister(struct drm_connector *connector)
 	struct tegra_dsi *dsi = to_dsi(output);
 
 	drm_debugfs_remove_files(dsi->debugfs_files, count,
+				 connector->debugfs_entry,
 				 connector->dev->primary);
 	kfree(dsi->debugfs_files);
 	dsi->debugfs_files = NULL;
diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
index 40ec3e6cf204..53387aa8b147 100644
--- a/drivers/gpu/drm/tegra/hdmi.c
+++ b/drivers/gpu/drm/tegra/hdmi.c
@@ -1114,7 +1114,8 @@ static void tegra_hdmi_early_unregister(struct drm_connector *connector)
 	unsigned int count = ARRAY_SIZE(debugfs_files);
 	struct tegra_hdmi *hdmi = to_hdmi(output);
 
-	drm_debugfs_remove_files(hdmi->debugfs_files, count, minor);
+	drm_debugfs_remove_files(hdmi->debugfs_files, count,
+				 connector->debugfs_entry, minor);
 	kfree(hdmi->debugfs_files);
 	hdmi->debugfs_files = NULL;
 }
diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index 8af632740673..cd286a5c2a9f 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -1707,6 +1707,7 @@ static void tegra_sor_early_unregister(struct drm_connector *connector)
 	struct tegra_sor *sor = to_sor(output);
 
 	drm_debugfs_remove_files(sor->debugfs_files, count,
+				 connector->debugfs_entry,
 				 connector->dev->primary);
 	kfree(sor->debugfs_files);
 	sor->debugfs_files = NULL;
diff --git a/include/drm/drm_debugfs.h b/include/drm/drm_debugfs.h
index 7616f457ce70..84ee27dc2317 100644
--- a/include/drm/drm_debugfs.h
+++ b/include/drm/drm_debugfs.h
@@ -126,8 +126,8 @@ struct drm_debugfs_entry {
 void drm_debugfs_create_files(const struct drm_info_list *files,
 			      int count, struct dentry *root,
 			      struct drm_minor *minor);
-int drm_debugfs_remove_files(const struct drm_info_list *files,
-			     int count, struct drm_minor *minor);
+int drm_debugfs_remove_files(const struct drm_info_list *files, int count,
+			     struct dentry *root, struct drm_minor *minor);
 
 void drm_debugfs_add_file(struct drm_device *dev, const char *name,
 			  int (*show)(struct seq_file*, void*), void *data);
diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
index 1fe08fcaa149..e687ce27624e 100644
--- a/include/drm/drm_file.h
+++ b/include/drm/drm_file.h
@@ -78,11 +78,7 @@ struct drm_minor {
 	struct device *kdev;		/* Linux device */
 	struct drm_device *dev;
 
-	struct dentry *debugfs_symlink;
 	struct dentry *debugfs_root;
-
-	struct list_head debugfs_list;
-	struct mutex debugfs_lock; /* Protects debugfs_list. */
 };
 
 /**
-- 
2.34.1


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

* [Intel-gfx] [PATCH 5/5] drm/debugfs: remove debugfs_root pointer from minor
  2023-03-31  9:07 [Intel-gfx] [PATCH 1/5] drm/debugfs: drop debugfs_init() for the render and accel node v2 Christian König
                   ` (2 preceding siblings ...)
  2023-03-31  9:07 ` [Intel-gfx] [PATCH 4/5] drm/debugfs: rework drm_debugfs_create_files implementation Christian König
@ 2023-03-31  9:07 ` Christian König
  2023-04-06 12:30   ` Jani Nikula
  2023-03-31 11:39 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/5] drm/debugfs: drop debugfs_init() for the render and accel node v2 Patchwork
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 9+ messages in thread
From: Christian König @ 2023-03-31  9:07 UTC (permalink / raw)
  To: intel-gfx

We only keept that around for API compatibility with drivers. Clean all
this up and use the per device debugfs directory.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/accel/drm_accel.c                      |  2 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c    |  4 ++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c      |  3 +--
 .../gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c        |  3 +--
 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c         |  3 +--
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c        |  4 +---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c     |  5 ++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c        |  6 +++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c        |  6 +++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c       |  3 +--
 .../gpu/drm/amd/amdgpu/amdgpu_securedisplay.c  |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c        |  3 +--
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c        |  3 +--
 .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c  |  2 +-
 drivers/gpu/drm/amd/pm/amdgpu_pm.c             |  3 +--
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c      |  2 +-
 drivers/gpu/drm/arm/malidp_drv.c               |  2 +-
 drivers/gpu/drm/armada/armada_debugfs.c        |  2 +-
 drivers/gpu/drm/drm_debugfs.c                  |  3 ---
 drivers/gpu/drm/drm_mipi_dbi.c                 |  2 +-
 drivers/gpu/drm/etnaviv/etnaviv_drv.c          |  2 +-
 .../drm/i915/display/intel_display_debugfs.c   |  4 ++--
 drivers/gpu/drm/i915/display/intel_dmc.c       |  2 +-
 drivers/gpu/drm/i915/display/intel_fbc.c       |  2 +-
 drivers/gpu/drm/i915/display/intel_hotplug.c   |  9 ++++++---
 drivers/gpu/drm/i915/display/intel_psr.c       |  6 ++++--
 drivers/gpu/drm/i915/display/intel_wm.c        |  9 ++++++---
 drivers/gpu/drm/i915/display/skl_watermark.c   |  6 ++++--
 drivers/gpu/drm/i915/gt/intel_gt_debugfs.c     |  4 ++--
 drivers/gpu/drm/i915/gvt/debugfs.c             |  6 +++---
 drivers/gpu/drm/i915/i915_debugfs.c            |  6 +++---
 drivers/gpu/drm/i915/i915_debugfs_params.c     |  2 +-
 drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c   |  4 ++--
 drivers/gpu/drm/msm/adreno/a5xx_debugfs.c      |  4 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c    |  2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c        |  2 +-
 drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c       |  2 +-
 drivers/gpu/drm/msm/dp/dp_debug.c              |  2 +-
 drivers/gpu/drm/msm/msm_debugfs.c              | 18 +++++++++---------
 drivers/gpu/drm/msm/msm_perf.c                 |  2 +-
 drivers/gpu/drm/msm/msm_rd.c                   |  2 +-
 drivers/gpu/drm/nouveau/nouveau_debugfs.c      |  6 +++---
 drivers/gpu/drm/omapdrm/omap_debugfs.c         |  4 ++--
 drivers/gpu/drm/pl111/pl111_debugfs.c          |  2 +-
 drivers/gpu/drm/qxl/qxl_debugfs.c              |  4 ++--
 drivers/gpu/drm/qxl/qxl_ttm.c                  |  4 ++--
 drivers/gpu/drm/radeon/r100.c                  |  6 +++---
 drivers/gpu/drm/radeon/r300.c                  |  2 +-
 drivers/gpu/drm/radeon/r420.c                  |  2 +-
 drivers/gpu/drm/radeon/r600.c                  |  2 +-
 drivers/gpu/drm/radeon/radeon_fence.c          |  2 +-
 drivers/gpu/drm/radeon/radeon_gem.c            |  2 +-
 drivers/gpu/drm/radeon/radeon_ib.c             |  2 +-
 drivers/gpu/drm/radeon/radeon_pm.c             |  2 +-
 drivers/gpu/drm/radeon/radeon_ring.c           |  2 +-
 drivers/gpu/drm/radeon/radeon_ttm.c            |  2 +-
 drivers/gpu/drm/radeon/rs400.c                 |  2 +-
 drivers/gpu/drm/radeon/rv515.c                 |  2 +-
 drivers/gpu/drm/sti/sti_cursor.c               |  2 +-
 drivers/gpu/drm/sti/sti_drv.c                  |  4 ++--
 drivers/gpu/drm/sti/sti_dvo.c                  |  2 +-
 drivers/gpu/drm/sti/sti_gdp.c                  |  2 +-
 drivers/gpu/drm/sti/sti_hda.c                  |  2 +-
 drivers/gpu/drm/sti/sti_hdmi.c                 |  2 +-
 drivers/gpu/drm/sti/sti_hqvdp.c                |  2 +-
 drivers/gpu/drm/sti/sti_mixer.c                |  2 +-
 drivers/gpu/drm/sti/sti_tvout.c                |  2 +-
 drivers/gpu/drm/sti/sti_vid.c                  |  2 +-
 drivers/gpu/drm/tegra/drm.c                    |  2 +-
 drivers/gpu/drm/tilcdc/tilcdc_drv.c            |  2 +-
 drivers/gpu/drm/tiny/arcpgu.c                  |  2 +-
 drivers/gpu/drm/vc4/vc4_hvs.c                  |  2 +-
 drivers/gpu/drm/virtio/virtgpu_debugfs.c       |  2 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c            |  2 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_gem.c            |  2 +-
 include/drm/drm_file.h                         |  2 --
 77 files changed, 120 insertions(+), 127 deletions(-)

diff --git a/drivers/accel/drm_accel.c b/drivers/accel/drm_accel.c
index 82c54bc2dcad..7e4176c736a5 100644
--- a/drivers/accel/drm_accel.c
+++ b/drivers/accel/drm_accel.c
@@ -100,8 +100,6 @@ void accel_debugfs_register(struct drm_device *dev)
 {
 	struct drm_minor *minor = dev->accel;
 
-	minor->debugfs_root = dev->debugfs_root;
-
 	drm_debugfs_create_files(accel_debugfs_list, ACCEL_DEBUGFS_ENTRIES,
 				 dev->debugfs_root, minor);
 }
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index f60753f97ac5..54d2b92a9e71 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -1454,7 +1454,7 @@ static const char *debugfs_regs_names[] = {
 int amdgpu_debugfs_regs_init(struct amdgpu_device *adev)
 {
 	struct drm_minor *minor = adev_to_drm(adev)->primary;
-	struct dentry *ent, *root = minor->debugfs_root;
+	struct dentry *ent, *root = minor->dev->debugfs_root;
 	unsigned int i;
 
 	for (i = 0; i < ARRAY_SIZE(debugfs_regs); i++) {
@@ -1926,7 +1926,7 @@ static const struct file_operations amdgpu_reset_dump_register_list = {
 
 int amdgpu_debugfs_init(struct amdgpu_device *adev)
 {
-	struct dentry *root = adev_to_drm(adev)->primary->debugfs_root;
+	struct dentry *root = adev_to_drm(adev)->debugfs_root;
 	struct dentry *ent;
 	int r, i;
 
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
index f52d0ba91a77..eb406870d57b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
@@ -927,8 +927,7 @@ static void amdgpu_debugfs_reset_work(struct work_struct *work)
 void amdgpu_debugfs_fence_init(struct amdgpu_device *adev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	struct drm_minor *minor = adev_to_drm(adev)->primary;
-	struct dentry *root = minor->debugfs_root;
+	struct dentry *root = adev_to_drm(adev)->debugfs_root;
 
 	debugfs_create_file("amdgpu_fence_info", 0444, root, adev,
 			    &amdgpu_debugfs_fence_info_fops);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c
index 2ca3c329de6d..c18f1316ea88 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c
@@ -137,7 +137,7 @@ void amdgpu_fw_attestation_debugfs_init(struct amdgpu_device *adev)
 
 	debugfs_create_file("amdgpu_fw_attestation",
 			    S_IRUSR,
-			    adev_to_drm(adev)->primary->debugfs_root,
+			    adev_to_drm(adev)->debugfs_root,
 			    adev,
 			    &amdgpu_fw_attestation_debugfs_ops);
 }
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index 863cb668e000..d2c8c3491bb6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -994,8 +994,7 @@ DEFINE_SHOW_ATTRIBUTE(amdgpu_debugfs_gem_info);
 void amdgpu_debugfs_gem_init(struct amdgpu_device *adev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	struct drm_minor *minor = adev_to_drm(adev)->primary;
-	struct dentry *root = minor->debugfs_root;
+	struct dentry *root = adev_to_drm(adev)->debugfs_root;
 
 	debugfs_create_file("amdgpu_gem_info", 0444, root, adev,
 			    &amdgpu_debugfs_gem_info_fops);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
index df7eb0b7c4b9..f36b656f91d2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
@@ -457,8 +457,7 @@ DEFINE_SHOW_ATTRIBUTE(amdgpu_debugfs_sa_info);
 void amdgpu_debugfs_sa_init(struct amdgpu_device *adev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	struct drm_minor *minor = adev_to_drm(adev)->primary;
-	struct dentry *root = minor->debugfs_root;
+	struct dentry *root = adev_to_drm(adev)->debugfs_root;
 
 	debugfs_create_file("amdgpu_sa_info", 0444, root, adev,
 			    &amdgpu_debugfs_sa_info_fops);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 0efb38539d70..751351aa598b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -1704,11 +1704,9 @@ DEFINE_SHOW_ATTRIBUTE(amdgpu_debugfs_firmware_info);
 void amdgpu_debugfs_firmware_init(struct amdgpu_device *adev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	struct drm_minor *minor = adev_to_drm(adev)->primary;
-	struct dentry *root = minor->debugfs_root;
+	struct dentry *root = adev_to_drm(adev)->debugfs_root;
 
 	debugfs_create_file("amdgpu_firmware_info", 0444, root,
 			    adev, &amdgpu_debugfs_firmware_info_fops);
-
 #endif
 }
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c
index 468a67b302d4..aff145bcbfe2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c
@@ -373,9 +373,8 @@ static ssize_t ta_if_invoke_debugfs_write(struct file *fp, const char *buf, size
 
 void amdgpu_ta_if_debugfs_init(struct amdgpu_device *adev)
 {
-	struct drm_minor *minor = adev_to_drm(adev)->primary;
-
-	struct dentry *dir = debugfs_create_dir("ta_if", minor->debugfs_root);
+	struct dentry *root = adev_to_drm(adev)->debugfs_root;
+	struct dentry *dir = debugfs_create_dir("ta_if", root);
 
 	debugfs_create_file("ta_load", 0200, dir, adev,
 				     &ta_load_debugfs_fops);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c
index 12010c988c8b..a39aba26710c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c
@@ -117,12 +117,12 @@ static const struct file_operations amdgpu_rap_debugfs_ops = {
 void amdgpu_rap_debugfs_init(struct amdgpu_device *adev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	struct drm_minor *minor = adev_to_drm(adev)->primary;
+	struct dentry *root = adev_to_drm(adev)->debugfs_root;
 
 	if (!adev->psp.rap_context.context.initialized)
 		return;
 
-	debugfs_create_file("rap_test", S_IWUSR, minor->debugfs_root,
-				adev, &amdgpu_rap_debugfs_ops);
+	debugfs_create_file("rap_test", S_IWUSR, root, adev,
+			    &amdgpu_rap_debugfs_ops);
 #endif
 }
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index 11df6ee052b4..f7e6dcca3873 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -1440,10 +1440,10 @@ static int amdgpu_ras_sysfs_remove_all(struct amdgpu_device *adev)
 static struct dentry *amdgpu_ras_debugfs_create_ctrl_node(struct amdgpu_device *adev)
 {
 	struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
-	struct drm_minor  *minor = adev_to_drm(adev)->primary;
-	struct dentry     *dir;
+	struct dentry *root = adev_to_drm(adev)->debugfs_root;
+	struct dentry *dir;
 
-	dir = debugfs_create_dir(RAS_FS_NAME, minor->debugfs_root);
+	dir = debugfs_create_dir(RAS_FS_NAME, root);
 	debugfs_create_file("ras_ctrl", S_IWUGO | S_IRUGO, dir, adev,
 			    &amdgpu_ras_debugfs_ctrl_ops);
 	debugfs_create_file("ras_eeprom_reset", S_IWUGO | S_IRUGO, dir, adev,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
index dc474b809604..b75cd5958c40 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
@@ -484,8 +484,7 @@ void amdgpu_debugfs_ring_init(struct amdgpu_device *adev,
 			      struct amdgpu_ring *ring)
 {
 #if defined(CONFIG_DEBUG_FS)
-	struct drm_minor *minor = adev_to_drm(adev)->primary;
-	struct dentry *root = minor->debugfs_root;
+	struct dentry *root = adev_to_drm(adev)->debugfs_root;
 	char name[32];
 
 	sprintf(name, "amdgpu_ring_%s", ring->name);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c
index 8ed0e073656f..575320c6d48a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c
@@ -177,7 +177,7 @@ void amdgpu_securedisplay_debugfs_init(struct amdgpu_device *adev)
 	if (!adev->psp.securedisplay_context.context.initialized)
 		return;
 
-	debugfs_create_file("securedisplay_test", S_IWUSR, adev_to_drm(adev)->primary->debugfs_root,
+	debugfs_create_file("securedisplay_test", S_IWUSR, adev_to_drm(adev)->debugfs_root,
 				adev, &amdgpu_securedisplay_debugfs_ops);
 #endif
 }
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 2cd081cbf706..2198fef53fdc 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -2371,8 +2371,7 @@ static const struct file_operations amdgpu_ttm_iomem_fops = {
 void amdgpu_ttm_debugfs_init(struct amdgpu_device *adev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	struct drm_minor *minor = adev_to_drm(adev)->primary;
-	struct dentry *root = minor->debugfs_root;
+	struct dentry *root = adev_to_drm(adev)->debugfs_root;
 
 	debugfs_create_file_size("amdgpu_vram", 0444, root, adev,
 				 &amdgpu_ttm_vram_fops, adev->gmc.mc_vram_size);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index e63fcc58e8e0..1d40763939dc 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -1121,8 +1121,7 @@ void amdgpu_debugfs_vcn_fwlog_init(struct amdgpu_device *adev, uint8_t i,
                                    struct amdgpu_vcn_inst *vcn)
 {
 #if defined(CONFIG_DEBUG_FS)
-	struct drm_minor *minor = adev_to_drm(adev)->primary;
-	struct dentry *root = minor->debugfs_root;
+	struct dentry *root = adev_to_drm(adev)->debugfs_root;
 	char name[32];
 
 	sprintf(name, "amdgpu_vcn_%d_fwlog", i);
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
index 827fcb4fb3b3..cec1cafafd0c 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
@@ -3658,7 +3658,7 @@ void dtn_debugfs_init(struct amdgpu_device *adev)
 	};
 
 	struct drm_minor *minor = adev_to_drm(adev)->primary;
-	struct dentry *root = minor->debugfs_root;
+	struct dentry *root = minor->dev->debugfs_root;
 
 	debugfs_create_file("amdgpu_mst_topology", 0444, root,
 			    adev, &mst_topo_fops);
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
index d75a67cfe523..3e900b6f746b 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -3705,8 +3705,7 @@ static const struct file_operations amdgpu_debugfs_pm_prv_buffer_fops = {
 void amdgpu_debugfs_pm_init(struct amdgpu_device *adev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	struct drm_minor *minor = adev_to_drm(adev)->primary;
-	struct dentry *root = minor->debugfs_root;
+	struct dentry *root = adev_to_drm(adev)->debugfs_root;
 
 	if (!adev->pm.dpm_enabled)
 		return;
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index b5d64749990e..9afdd31072ee 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -3215,7 +3215,7 @@ void amdgpu_smu_stb_debug_fs_init(struct amdgpu_device *adev)
 
 	debugfs_create_file_size("amdgpu_smu_stb_dump",
 			    S_IRUSR,
-			    adev_to_drm(adev)->primary->debugfs_root,
+			    adev_to_drm(adev)->debugfs_root,
 			    adev,
 			    &smu_stb_debugfs_fops,
 			    smu->stb_context.stb_buf_size);
diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
index c03cfd57b752..c825a453a03f 100644
--- a/drivers/gpu/drm/arm/malidp_drv.c
+++ b/drivers/gpu/drm/arm/malidp_drv.c
@@ -552,7 +552,7 @@ static void malidp_debugfs_init(struct drm_minor *minor)
 	malidp_error_stats_init(&malidp->de_errors);
 	malidp_error_stats_init(&malidp->se_errors);
 	spin_lock_init(&malidp->errors_lock);
-	debugfs_create_file("debug", S_IRUGO | S_IWUSR, minor->debugfs_root,
+	debugfs_create_file("debug", S_IRUGO | S_IWUSR, minor->dev->debugfs_root,
 			    minor->dev, &malidp_debugfs_fops);
 }
 
diff --git a/drivers/gpu/drm/armada/armada_debugfs.c b/drivers/gpu/drm/armada/armada_debugfs.c
index 29f4b52e3c8d..24b42ca59f02 100644
--- a/drivers/gpu/drm/armada/armada_debugfs.c
+++ b/drivers/gpu/drm/armada/armada_debugfs.c
@@ -105,7 +105,7 @@ static struct drm_info_list armada_debugfs_list[] = {
 int armada_drm_debugfs_init(struct drm_minor *minor)
 {
 	drm_debugfs_create_files(armada_debugfs_list, ARMADA_DEBUGFS_ENTRIES,
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 
 	return 0;
 }
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index c8e2d4f9f00d..e09a4c47b66b 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -264,9 +264,6 @@ int drm_debugfs_register(struct drm_minor *minor, int minor_id,
 	sprintf(name, "%d", minor_id);
 	debugfs_create_symlink(name, root, dev->unique);
 
-	/* TODO: Only for compatibility with drivers */
-	minor->debugfs_root = dev->debugfs_root;
-
 	if (dev->driver->debugfs_init && dev->render != minor)
 		dev->driver->debugfs_init(minor);
 
diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c
index c871d9f096b8..8ffd30885d01 100644
--- a/drivers/gpu/drm/drm_mipi_dbi.c
+++ b/drivers/gpu/drm/drm_mipi_dbi.c
@@ -1454,7 +1454,7 @@ void mipi_dbi_debugfs_init(struct drm_minor *minor)
 
 	if (dbidev->dbi.read_commands)
 		mode |= S_IRUGO;
-	debugfs_create_file("command", mode, minor->debugfs_root, dbidev,
+	debugfs_create_file("command", mode, minor->dev->debugfs_root, dbidev,
 			    &mipi_dbi_debugfs_command_fops);
 }
 EXPORT_SYMBOL(mipi_dbi_debugfs_init);
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
index 31a7f59ccb49..4819b4f9ebb4 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
@@ -242,7 +242,7 @@ static void etnaviv_debugfs_init(struct drm_minor *minor)
 {
 	drm_debugfs_create_files(etnaviv_debugfs_list,
 				 ARRAY_SIZE(etnaviv_debugfs_list),
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 }
 #endif
 
diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
index d5715ccc37f0..37173456f5bc 100644
--- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
+++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
@@ -1083,14 +1083,14 @@ void intel_display_debugfs_register(struct drm_i915_private *i915)
 	for (i = 0; i < ARRAY_SIZE(intel_display_debugfs_files); i++) {
 		debugfs_create_file(intel_display_debugfs_files[i].name,
 				    S_IRUGO | S_IWUSR,
-				    minor->debugfs_root,
+				    minor->dev->debugfs_root,
 				    to_i915(minor->dev),
 				    intel_display_debugfs_files[i].fops);
 	}
 
 	drm_debugfs_create_files(intel_display_debugfs_list,
 				 ARRAY_SIZE(intel_display_debugfs_list),
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 
 	intel_dmc_debugfs_register(i915);
 	intel_fbc_debugfs_register(i915);
diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c b/drivers/gpu/drm/i915/display/intel_dmc.c
index 8a88de67ff0a..4ca2125c0a8a 100644
--- a/drivers/gpu/drm/i915/display/intel_dmc.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc.c
@@ -1229,6 +1229,6 @@ void intel_dmc_debugfs_register(struct drm_i915_private *i915)
 {
 	struct drm_minor *minor = i915->drm.primary;
 
-	debugfs_create_file("i915_dmc_info", 0444, minor->debugfs_root,
+	debugfs_create_file("i915_dmc_info", 0444, minor->dev->debugfs_root,
 			    i915, &intel_dmc_debugfs_status_fops);
 }
diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index b507ff944864..5a83b4e87246 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -1839,5 +1839,5 @@ void intel_fbc_debugfs_register(struct drm_i915_private *i915)
 
 	fbc = i915->display.fbc[INTEL_FBC_A];
 	if (fbc)
-		intel_fbc_debugfs_add(fbc, minor->debugfs_root);
+		intel_fbc_debugfs_add(fbc, minor->dev->debugfs_root);
 }
diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c b/drivers/gpu/drm/i915/display/intel_hotplug.c
index b12900446828..99dedfcefc50 100644
--- a/drivers/gpu/drm/i915/display/intel_hotplug.c
+++ b/drivers/gpu/drm/i915/display/intel_hotplug.c
@@ -943,10 +943,13 @@ void intel_hpd_debugfs_register(struct drm_i915_private *i915)
 {
 	struct drm_minor *minor = i915->drm.primary;
 
-	debugfs_create_file("i915_hpd_storm_ctl", 0644, minor->debugfs_root,
+	debugfs_create_file("i915_hpd_storm_ctl", 0644,
+			    minor->dev->debugfs_root,
 			    i915, &i915_hpd_storm_ctl_fops);
-	debugfs_create_file("i915_hpd_short_storm_ctl", 0644, minor->debugfs_root,
+	debugfs_create_file("i915_hpd_short_storm_ctl", 0644,
+			    minor->dev->debugfs_root,
 			    i915, &i915_hpd_short_storm_ctl_fops);
-	debugfs_create_bool("i915_ignore_long_hpd", 0644, minor->debugfs_root,
+	debugfs_create_bool("i915_ignore_long_hpd", 0644,
+			    minor->dev->debugfs_root,
 			    &i915->display.hotplug.ignore_long_hpd);
 }
diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index ecf1781c1556..5411686c58a8 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -2922,10 +2922,12 @@ void intel_psr_debugfs_register(struct drm_i915_private *i915)
 {
 	struct drm_minor *minor = i915->drm.primary;
 
-	debugfs_create_file("i915_edp_psr_debug", 0644, minor->debugfs_root,
+	debugfs_create_file("i915_edp_psr_debug", 0644,
+			    minor->dev->debugfs_root,
 			    i915, &i915_edp_psr_debug_fops);
 
-	debugfs_create_file("i915_edp_psr_status", 0444, minor->debugfs_root,
+	debugfs_create_file("i915_edp_psr_status", 0444,
+			    minor->dev->debugfs_root,
 			    i915, &i915_edp_psr_status_fops);
 }
 
diff --git a/drivers/gpu/drm/i915/display/intel_wm.c b/drivers/gpu/drm/i915/display/intel_wm.c
index bb99179cd5fd..cfa618da262e 100644
--- a/drivers/gpu/drm/i915/display/intel_wm.c
+++ b/drivers/gpu/drm/i915/display/intel_wm.c
@@ -395,13 +395,16 @@ void intel_wm_debugfs_register(struct drm_i915_private *i915)
 {
 	struct drm_minor *minor = i915->drm.primary;
 
-	debugfs_create_file("i915_pri_wm_latency", 0644, minor->debugfs_root,
+	debugfs_create_file("i915_pri_wm_latency", 0644,
+			    minor->dev->debugfs_root,
 			    i915, &i915_pri_wm_latency_fops);
 
-	debugfs_create_file("i915_spr_wm_latency", 0644, minor->debugfs_root,
+	debugfs_create_file("i915_spr_wm_latency", 0644,
+			    minor->dev->debugfs_root,
 			    i915, &i915_spr_wm_latency_fops);
 
-	debugfs_create_file("i915_cur_wm_latency", 0644, minor->debugfs_root,
+	debugfs_create_file("i915_cur_wm_latency", 0644,
+			    minor->dev->debugfs_root,
 			    i915, &i915_cur_wm_latency_fops);
 
 	skl_watermark_debugfs_register(i915);
diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c b/drivers/gpu/drm/i915/display/skl_watermark.c
index 5296a20d62d3..34cb0c6d0f51 100644
--- a/drivers/gpu/drm/i915/display/skl_watermark.c
+++ b/drivers/gpu/drm/i915/display/skl_watermark.c
@@ -3711,10 +3711,12 @@ void skl_watermark_debugfs_register(struct drm_i915_private *i915)
 	struct drm_minor *minor = i915->drm.primary;
 
 	if (HAS_IPC(i915))
-		debugfs_create_file("i915_ipc_status", 0644, minor->debugfs_root, i915,
+		debugfs_create_file("i915_ipc_status", 0644,
+				    minor->dev->debugfs_root, i915,
 				    &skl_watermark_ipc_status_fops);
 
 	if (HAS_SAGV(i915))
-		debugfs_create_file("i915_sagv_status", 0444, minor->debugfs_root, i915,
+		debugfs_create_file("i915_sagv_status", 0444,
+				    minor->dev->debugfs_root, i915,
 				    &intel_sagv_status_fops);
 }
diff --git a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
index 4dc23b8d3aa2..bcb5407efdbe 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
@@ -85,11 +85,11 @@ void intel_gt_debugfs_register(struct intel_gt *gt)
 	struct dentry *root;
 	char gtname[4];
 
-	if (!gt->i915->drm.primary->debugfs_root)
+	if (!gt->i915->drm.debugfs_root)
 		return;
 
 	snprintf(gtname, sizeof(gtname), "gt%u", gt->info.id);
-	root = debugfs_create_dir(gtname, gt->i915->drm.primary->debugfs_root);
+	root = debugfs_create_dir(gtname, gt->i915->drm.debugfs_root);
 	if (IS_ERR(root))
 		return;
 
diff --git a/drivers/gpu/drm/i915/gvt/debugfs.c b/drivers/gpu/drm/i915/gvt/debugfs.c
index baccbf1761b7..f087986747ac 100644
--- a/drivers/gpu/drm/i915/gvt/debugfs.c
+++ b/drivers/gpu/drm/i915/gvt/debugfs.c
@@ -195,7 +195,7 @@ void intel_gvt_debugfs_remove_vgpu(struct intel_vgpu *vgpu)
 	struct intel_gvt *gvt = vgpu->gvt;
 	struct drm_minor *minor = gvt->gt->i915->drm.primary;
 
-	if (minor->debugfs_root && gvt->debugfs_root) {
+	if (minor->dev->debugfs_root && gvt->debugfs_root) {
 		debugfs_remove_recursive(vgpu->debugfs);
 		vgpu->debugfs = NULL;
 	}
@@ -209,7 +209,7 @@ void intel_gvt_debugfs_init(struct intel_gvt *gvt)
 {
 	struct drm_minor *minor = gvt->gt->i915->drm.primary;
 
-	gvt->debugfs_root = debugfs_create_dir("gvt", minor->debugfs_root);
+	gvt->debugfs_root = debugfs_create_dir("gvt", minor->dev->debugfs_root);
 
 	debugfs_create_ulong("num_tracked_mmio", 0444, gvt->debugfs_root,
 			     &gvt->mmio.num_tracked_mmio);
@@ -223,7 +223,7 @@ void intel_gvt_debugfs_clean(struct intel_gvt *gvt)
 {
 	struct drm_minor *minor = gvt->gt->i915->drm.primary;
 
-	if (minor->debugfs_root) {
+	if (minor->dev->debugfs_root) {
 		debugfs_remove_recursive(gvt->debugfs_root);
 		gvt->debugfs_root = NULL;
 	}
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 80c2bf98e341..6f76850ff6e3 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -811,17 +811,17 @@ void i915_debugfs_register(struct drm_i915_private *dev_priv)
 
 	i915_debugfs_params(dev_priv);
 
-	debugfs_create_file("i915_forcewake_user", S_IRUSR, minor->debugfs_root,
+	debugfs_create_file("i915_forcewake_user", S_IRUSR, minor->dev->debugfs_root,
 			    to_i915(minor->dev), &i915_forcewake_fops);
 	for (i = 0; i < ARRAY_SIZE(i915_debugfs_files); i++) {
 		debugfs_create_file(i915_debugfs_files[i].name,
 				    S_IRUGO | S_IWUSR,
-				    minor->debugfs_root,
+				    minor->dev->debugfs_root,
 				    to_i915(minor->dev),
 				    i915_debugfs_files[i].fops);
 	}
 
 	drm_debugfs_create_files(i915_debugfs_list,
 				 ARRAY_SIZE(i915_debugfs_list),
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 }
diff --git a/drivers/gpu/drm/i915/i915_debugfs_params.c b/drivers/gpu/drm/i915/i915_debugfs_params.c
index 614bde321589..704a016b3520 100644
--- a/drivers/gpu/drm/i915/i915_debugfs_params.c
+++ b/drivers/gpu/drm/i915/i915_debugfs_params.c
@@ -248,7 +248,7 @@ struct dentry *i915_debugfs_params(struct drm_i915_private *i915)
 	struct i915_params *params = &i915->params;
 	struct dentry *dir;
 
-	dir = debugfs_create_dir("i915_params", minor->debugfs_root);
+	dir = debugfs_create_dir("i915_params", minor->dev->debugfs_root);
 	if (IS_ERR(dir))
 		return dir;
 
diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c b/drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c
index 4b8e70caa3ad..264b4832d3d9 100644
--- a/drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c
+++ b/drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c
@@ -72,10 +72,10 @@ void intel_pxp_debugfs_register(struct intel_pxp *pxp)
 		return;
 
 	minor = pxp->ctrl_gt->i915->drm.primary;
-	if (!minor->debugfs_root)
+	if (!minor->dev->debugfs_root)
 		return;
 
-	pxproot = debugfs_create_dir("pxp", minor->debugfs_root);
+	pxproot = debugfs_create_dir("pxp", minor->dev->debugfs_root);
 	if (IS_ERR(pxproot))
 		return;
 
diff --git a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
index 6bd397a85834..b858a1590cf4 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
@@ -152,8 +152,8 @@ void a5xx_debugfs_init(struct msm_gpu *gpu, struct drm_minor *minor)
 
 	drm_debugfs_create_files(a5xx_debugfs_list,
 				 ARRAY_SIZE(a5xx_debugfs_list),
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 
-	debugfs_create_file_unsafe("reset", S_IWUGO, minor->debugfs_root, dev,
+	debugfs_create_file_unsafe("reset", S_IWUGO, minor->dev->debugfs_root, dev,
 				&reset_fops);
 }
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index 758261e8ac73..987c332f216f 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -2137,7 +2137,7 @@ static int _dpu_encoder_init_debugfs(struct drm_encoder *drm_enc)
 
 	/* create overall sub-directory for the encoder */
 	dpu_enc->debugfs_root = debugfs_create_dir(name,
-			drm_enc->dev->primary->debugfs_root);
+			drm_enc->dev->debugfs_root);
 
 	/* don't error check these */
 	debugfs_create_file("status", 0600,
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
index a683bd9b5a04..3fba86e5b4da 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
@@ -269,7 +269,7 @@ static int dpu_kms_debugfs_init(struct msm_kms *kms, struct drm_minor *minor)
 	dev = dpu_kms->dev;
 	priv = dev->dev_private;
 
-	entry = debugfs_create_dir("debug", minor->debugfs_root);
+	entry = debugfs_create_dir("debug", minor->dev->debugfs_root);
 
 	debugfs_create_x32(DPU_DEBUGFS_HWMASKNAME, 0600, entry, p);
 
diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
index 29ae5c9613f3..800c0bf78529 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
@@ -253,7 +253,7 @@ static int mdp5_kms_debugfs_init(struct msm_kms *kms, struct drm_minor *minor)
 {
 	drm_debugfs_create_files(mdp5_debugfs_list,
 				 ARRAY_SIZE(mdp5_debugfs_list),
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 
 	return 0;
 }
diff --git a/drivers/gpu/drm/msm/dp/dp_debug.c b/drivers/gpu/drm/msm/dp/dp_debug.c
index 5e35033ba3e4..eff62032a8f7 100644
--- a/drivers/gpu/drm/msm/dp/dp_debug.c
+++ b/drivers/gpu/drm/msm/dp/dp_debug.c
@@ -213,7 +213,7 @@ static void dp_debug_init(struct dp_debug *dp_debug, struct drm_minor *minor)
 
 	snprintf(path, sizeof(path), "msm_dp-%s", debug->connector->name);
 
-	debug->root = debugfs_create_dir(path, minor->debugfs_root);
+	debug->root = debugfs_create_dir(path, minor->dev->debugfs_root);
 
 	debugfs_create_file("dp_debug", 0444, debug->root,
 			debug, &dp_debug_fops);
diff --git a/drivers/gpu/drm/msm/msm_debugfs.c b/drivers/gpu/drm/msm/msm_debugfs.c
index d6ecff0ab618..4fb5b44073bd 100644
--- a/drivers/gpu/drm/msm/msm_debugfs.c
+++ b/drivers/gpu/drm/msm/msm_debugfs.c
@@ -309,24 +309,24 @@ void msm_debugfs_init(struct drm_minor *minor)
 
 	drm_debugfs_create_files(msm_debugfs_list,
 				 ARRAY_SIZE(msm_debugfs_list),
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 
-	debugfs_create_file("gpu", S_IRUSR, minor->debugfs_root,
+	debugfs_create_file("gpu", S_IRUSR, minor->dev->debugfs_root,
 		dev, &msm_gpu_fops);
 
-	debugfs_create_file("kms", S_IRUSR, minor->debugfs_root,
+	debugfs_create_file("kms", S_IRUSR, minor->dev->debugfs_root,
 		dev, &msm_kms_fops);
 
-	debugfs_create_u32("hangcheck_period_ms", 0600, minor->debugfs_root,
+	debugfs_create_u32("hangcheck_period_ms", 0600, minor->dev->debugfs_root,
 		&priv->hangcheck_period);
 
-	debugfs_create_bool("disable_err_irq", 0600, minor->debugfs_root,
+	debugfs_create_bool("disable_err_irq", 0600, minor->dev->debugfs_root,
 		&priv->disable_err_irq);
 
-	debugfs_create_file("shrink", S_IRWXU, minor->debugfs_root,
+	debugfs_create_file("shrink", S_IRWXU, minor->dev->debugfs_root,
 		dev, &shrink_fops);
 
-	gpu_devfreq = debugfs_create_dir("devfreq", minor->debugfs_root);
+	gpu_devfreq = debugfs_create_dir("devfreq", dev->debugfs_root);
 
 	debugfs_create_bool("idle_clamp",0600, gpu_devfreq,
 			    &priv->gpu_clamp_to_idle);
@@ -341,9 +341,9 @@ void msm_debugfs_init(struct drm_minor *minor)
 		priv->kms->funcs->debugfs_init(priv->kms, minor);
 
 #ifdef CONFIG_FAULT_INJECTION
-	fault_create_debugfs_attr("fail_gem_alloc", minor->debugfs_root,
+	fault_create_debugfs_attr("fail_gem_alloc", minor->dev->debugfs_root,
 				  &fail_gem_alloc);
-	fault_create_debugfs_attr("fail_gem_iova", minor->debugfs_root,
+	fault_create_debugfs_attr("fail_gem_iova", minor->dev->debugfs_root,
 				  &fail_gem_iova);
 #endif
 }
diff --git a/drivers/gpu/drm/msm/msm_perf.c b/drivers/gpu/drm/msm/msm_perf.c
index 3d3da79fec2a..82d8ef9e0e74 100644
--- a/drivers/gpu/drm/msm/msm_perf.c
+++ b/drivers/gpu/drm/msm/msm_perf.c
@@ -214,7 +214,7 @@ int msm_perf_debugfs_init(struct drm_minor *minor)
 	mutex_init(&perf->read_lock);
 	priv->perf = perf;
 
-	debugfs_create_file("perf", S_IFREG | S_IRUGO, minor->debugfs_root,
+	debugfs_create_file("perf", S_IFREG | S_IRUGO, minor->dev->debugfs_root,
 			    perf, &perf_debugfs_fops);
 	return 0;
 }
diff --git a/drivers/gpu/drm/msm/msm_rd.c b/drivers/gpu/drm/msm/msm_rd.c
index db2f847c8535..cd0d4859fef0 100644
--- a/drivers/gpu/drm/msm/msm_rd.c
+++ b/drivers/gpu/drm/msm/msm_rd.c
@@ -261,7 +261,7 @@ static struct msm_rd_state *rd_init(struct drm_minor *minor, const char *name)
 
 	init_waitqueue_head(&rd->fifo_event);
 
-	debugfs_create_file(name, S_IFREG | S_IRUGO, minor->debugfs_root, rd,
+	debugfs_create_file(name, S_IFREG | S_IRUGO, minor->dev->debugfs_root, rd,
 			    &rd_debugfs_fops);
 
 	return rd;
diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
index 2a36d1ca8fda..0ea7c19b8da9 100644
--- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c
+++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
@@ -233,18 +233,18 @@ nouveau_drm_debugfs_init(struct drm_minor *minor)
 	for (i = 0; i < ARRAY_SIZE(nouveau_debugfs_files); i++) {
 		debugfs_create_file(nouveau_debugfs_files[i].name,
 				    S_IRUGO | S_IWUSR,
-				    minor->debugfs_root, minor->dev,
+				    minor->dev->debugfs_root, minor->dev,
 				    nouveau_debugfs_files[i].fops);
 	}
 
 	drm_debugfs_create_files(nouveau_debugfs_list,
 				 NOUVEAU_DEBUGFS_ENTRIES,
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 
 	/* Set the size of the vbios since we know it, and it's confusing to
 	 * userspace if it wants to seek() but the file has a length of 0
 	 */
-	dentry = debugfs_lookup("vbios.rom", minor->debugfs_root);
+	dentry = debugfs_lookup("vbios.rom", minor->dev->debugfs_root);
 	if (!dentry)
 		return;
 
diff --git a/drivers/gpu/drm/omapdrm/omap_debugfs.c b/drivers/gpu/drm/omapdrm/omap_debugfs.c
index bfb2ccb40bd1..ef14bb95326f 100644
--- a/drivers/gpu/drm/omapdrm/omap_debugfs.c
+++ b/drivers/gpu/drm/omapdrm/omap_debugfs.c
@@ -85,12 +85,12 @@ void omap_debugfs_init(struct drm_minor *minor)
 {
 	drm_debugfs_create_files(omap_debugfs_list,
 				 ARRAY_SIZE(omap_debugfs_list),
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 
 	if (dmm_is_available())
 		drm_debugfs_create_files(omap_dmm_debugfs_list,
 					 ARRAY_SIZE(omap_dmm_debugfs_list),
-					 minor->debugfs_root, minor);
+					 minor->dev->debugfs_root, minor);
 }
 
 #endif
diff --git a/drivers/gpu/drm/pl111/pl111_debugfs.c b/drivers/gpu/drm/pl111/pl111_debugfs.c
index 6744fa16f464..2603822bf9f4 100644
--- a/drivers/gpu/drm/pl111/pl111_debugfs.c
+++ b/drivers/gpu/drm/pl111/pl111_debugfs.c
@@ -55,5 +55,5 @@ pl111_debugfs_init(struct drm_minor *minor)
 {
 	drm_debugfs_create_files(pl111_debugfs_list,
 				 ARRAY_SIZE(pl111_debugfs_list),
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 }
diff --git a/drivers/gpu/drm/qxl/qxl_debugfs.c b/drivers/gpu/drm/qxl/qxl_debugfs.c
index 2d9ed3b94574..80e5b12802da 100644
--- a/drivers/gpu/drm/qxl/qxl_debugfs.c
+++ b/drivers/gpu/drm/qxl/qxl_debugfs.c
@@ -90,7 +90,7 @@ qxl_debugfs_init(struct drm_minor *minor)
 	struct qxl_device *dev = to_qxl(minor->dev);
 
 	drm_debugfs_create_files(qxl_debugfs_list, QXL_DEBUGFS_ENTRIES,
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 
 	qxl_ttm_debugfs_init(dev);
 #endif
@@ -120,7 +120,7 @@ void qxl_debugfs_add_files(struct qxl_device *qdev,
 	qdev->debugfs_count = i;
 #if defined(CONFIG_DEBUG_FS)
 	drm_debugfs_create_files(files, nfiles,
-				 qdev->ddev.primary->debugfs_root,
+				 qdev->ddev.debugfs_root,
 				 qdev->ddev.primary);
 #endif
 }
diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
index 1a82629bce3f..f39f3a13e62c 100644
--- a/drivers/gpu/drm/qxl/qxl_ttm.c
+++ b/drivers/gpu/drm/qxl/qxl_ttm.c
@@ -238,9 +238,9 @@ void qxl_ttm_debugfs_init(struct qxl_device *qdev)
 #if defined(CONFIG_DEBUG_FS)
 	ttm_resource_manager_create_debugfs(ttm_manager_type(&qdev->mman.bdev,
 							     TTM_PL_VRAM),
-					    qdev->ddev.primary->debugfs_root, "qxl_mem_mm");
+					    qdev->ddev.debugfs_root, "qxl_mem_mm");
 	ttm_resource_manager_create_debugfs(ttm_manager_type(&qdev->mman.bdev,
 							     TTM_PL_PRIV),
-					    qdev->ddev.primary->debugfs_root, "qxl_surf_mm");
+					    qdev->ddev.debugfs_root, "qxl_surf_mm");
 #endif
 }
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index d4f09ecc3d22..23846346db0f 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -3058,7 +3058,7 @@ DEFINE_SHOW_ATTRIBUTE(r100_debugfs_mc_info);
 void  r100_debugfs_rbbm_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	struct dentry *root = rdev->ddev->primary->debugfs_root;
+	struct dentry *root = rdev->ddev->debugfs_root;
 
 	debugfs_create_file("r100_rbbm_info", 0444, root, rdev,
 			    &r100_debugfs_rbbm_info_fops);
@@ -3068,7 +3068,7 @@ void  r100_debugfs_rbbm_init(struct radeon_device *rdev)
 void r100_debugfs_cp_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	struct dentry *root = rdev->ddev->primary->debugfs_root;
+	struct dentry *root = rdev->ddev->debugfs_root;
 
 	debugfs_create_file("r100_cp_ring_info", 0444, root, rdev,
 			    &r100_debugfs_cp_ring_info_fops);
@@ -3080,7 +3080,7 @@ void r100_debugfs_cp_init(struct radeon_device *rdev)
 void  r100_debugfs_mc_info_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	struct dentry *root = rdev->ddev->primary->debugfs_root;
+	struct dentry *root = rdev->ddev->debugfs_root;
 
 	debugfs_create_file("r100_mc_info", 0444, root, rdev,
 			    &r100_debugfs_mc_info_fops);
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index 7b0cfeaddcec..3038426e465c 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -615,7 +615,7 @@ DEFINE_SHOW_ATTRIBUTE(rv370_debugfs_pcie_gart_info);
 static void rv370_debugfs_pcie_gart_info_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	struct dentry *root = rdev->ddev->primary->debugfs_root;
+	struct dentry *root = rdev->ddev->debugfs_root;
 
 	debugfs_create_file("rv370_pcie_gart_info", 0444, root, rdev,
 			    &rv370_debugfs_pcie_gart_info_fops);
diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c
index 7e6320e8c6a0..24e595db3dbf 100644
--- a/drivers/gpu/drm/radeon/r420.c
+++ b/drivers/gpu/drm/radeon/r420.c
@@ -492,7 +492,7 @@ DEFINE_SHOW_ATTRIBUTE(r420_debugfs_pipes_info);
 void r420_debugfs_pipes_info_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	struct dentry *root = rdev->ddev->primary->debugfs_root;
+	struct dentry *root = rdev->ddev->debugfs_root;
 
 	debugfs_create_file("r420_pipes_info", 0444, root, rdev,
 			    &r420_debugfs_pipes_info_fops);
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index dd78fc499402..1a1cf06f968c 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -4358,7 +4358,7 @@ DEFINE_SHOW_ATTRIBUTE(r600_debugfs_mc_info);
 static void r600_debugfs_mc_info_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	struct dentry *root = rdev->ddev->primary->debugfs_root;
+	struct dentry *root = rdev->ddev->debugfs_root;
 
 	debugfs_create_file("r600_mc_info", 0444, root, rdev,
 			    &r600_debugfs_mc_info_fops);
diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
index 73e3117420bf..20c178e2e9fd 100644
--- a/drivers/gpu/drm/radeon/radeon_fence.c
+++ b/drivers/gpu/drm/radeon/radeon_fence.c
@@ -1004,7 +1004,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(radeon_debugfs_gpu_reset_fops,
 void radeon_debugfs_fence_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	struct dentry *root = rdev->ddev->primary->debugfs_root;
+	struct dentry *root = rdev->ddev->debugfs_root;
 
 	debugfs_create_file("radeon_gpu_reset", 0444, root, rdev,
 			    &radeon_debugfs_gpu_reset_fops);
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
index 261fcbae88d7..7779179c9411 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -892,7 +892,7 @@ DEFINE_SHOW_ATTRIBUTE(radeon_debugfs_gem_info);
 void radeon_gem_debugfs_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	struct dentry *root = rdev->ddev->primary->debugfs_root;
+	struct dentry *root = rdev->ddev->debugfs_root;
 
 	debugfs_create_file("radeon_gem_info", 0444, root, rdev,
 			    &radeon_debugfs_gem_info_fops);
diff --git a/drivers/gpu/drm/radeon/radeon_ib.c b/drivers/gpu/drm/radeon/radeon_ib.c
index 6a45a72488f9..0a4c8ce3c6ca 100644
--- a/drivers/gpu/drm/radeon/radeon_ib.c
+++ b/drivers/gpu/drm/radeon/radeon_ib.c
@@ -307,7 +307,7 @@ DEFINE_SHOW_ATTRIBUTE(radeon_debugfs_sa_info);
 static void radeon_debugfs_sa_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	struct dentry *root = rdev->ddev->primary->debugfs_root;
+	struct dentry *root = rdev->ddev->debugfs_root;
 
 	debugfs_create_file("radeon_sa_info", 0444, root, rdev,
 			    &radeon_debugfs_sa_info_fops);
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index cbc554928bcc..e63aead25682 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -1954,7 +1954,7 @@ DEFINE_SHOW_ATTRIBUTE(radeon_debugfs_pm_info);
 static void radeon_debugfs_pm_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	struct dentry *root = rdev->ddev->primary->debugfs_root;
+	struct dentry *root = rdev->ddev->debugfs_root;
 
 	debugfs_create_file("radeon_pm_info", 0444, root, rdev,
 			    &radeon_debugfs_pm_info_fops);
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c
index 7e207276df37..59f0b97b69eb 100644
--- a/drivers/gpu/drm/radeon/radeon_ring.c
+++ b/drivers/gpu/drm/radeon/radeon_ring.c
@@ -548,7 +548,7 @@ static void radeon_debugfs_ring_init(struct radeon_device *rdev, struct radeon_r
 {
 #if defined(CONFIG_DEBUG_FS)
 	const char *ring_name = radeon_debugfs_ring_idx_to_name(ring->idx);
-	struct dentry *root = rdev->ddev->primary->debugfs_root;
+	struct dentry *root = rdev->ddev->debugfs_root;
 
 	if (ring_name)
 		debugfs_create_file(ring_name, 0444, root, ring,
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 2220cdf6a3f6..202a3db46be0 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -899,7 +899,7 @@ static void radeon_ttm_debugfs_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
 	struct drm_minor *minor = rdev->ddev->primary;
-	struct dentry *root = minor->debugfs_root;
+	struct dentry *root = minor->dev->debugfs_root;
 
 	debugfs_create_file("radeon_vram", 0444, root, rdev,
 			    &radeon_ttm_vram_fops);
diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c
index 6383f7a34bd8..79b968b41006 100644
--- a/drivers/gpu/drm/radeon/rs400.c
+++ b/drivers/gpu/drm/radeon/rs400.c
@@ -378,7 +378,7 @@ DEFINE_SHOW_ATTRIBUTE(rs400_debugfs_gart_info);
 static void rs400_debugfs_pcie_gart_info_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	struct dentry *root = rdev->ddev->primary->debugfs_root;
+	struct dentry *root = rdev->ddev->debugfs_root;
 
 	debugfs_create_file("rs400_gart_info", 0444, root, rdev,
 			    &rs400_debugfs_gart_info_fops);
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
index 63fb06e8e2d7..1ad855b5eb21 100644
--- a/drivers/gpu/drm/radeon/rv515.c
+++ b/drivers/gpu/drm/radeon/rv515.c
@@ -255,7 +255,7 @@ DEFINE_SHOW_ATTRIBUTE(rv515_debugfs_ga_info);
 void rv515_debugfs(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	struct dentry *root = rdev->ddev->primary->debugfs_root;
+	struct dentry *root = rdev->ddev->debugfs_root;
 
 	debugfs_create_file("rv515_pipes_info", 0444, root, rdev,
 			    &rv515_debugfs_pipes_info_fops);
diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/drivers/gpu/drm/sti/sti_cursor.c
index db0a1eb53532..9b2d671e4a66 100644
--- a/drivers/gpu/drm/sti/sti_cursor.c
+++ b/drivers/gpu/drm/sti/sti_cursor.c
@@ -142,7 +142,7 @@ static void cursor_debugfs_init(struct sti_cursor *cursor,
 
 	drm_debugfs_create_files(cursor_debugfs_files,
 				 ARRAY_SIZE(cursor_debugfs_files),
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 }
 
 static void sti_cursor_argb8888_to_clut8(struct sti_cursor *cursor, u32 *src)
diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index 1b87b5899f9e..947e07029ce9 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -95,9 +95,9 @@ static void sti_drm_dbg_init(struct drm_minor *minor)
 {
 	drm_debugfs_create_files(sti_drm_dbg_list,
 				 ARRAY_SIZE(sti_drm_dbg_list),
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 
-	debugfs_create_file("fps_show", S_IRUGO | S_IWUSR, minor->debugfs_root,
+	debugfs_create_file("fps_show", S_IRUGO | S_IWUSR, minor->dev->debugfs_root,
 			    minor->dev, &sti_drm_fps_fops);
 
 	DRM_INFO("%s: debugfs installed\n", DRIVER_NAME);
diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c
index 577c477b5f46..6d214a9cde62 100644
--- a/drivers/gpu/drm/sti/sti_dvo.c
+++ b/drivers/gpu/drm/sti/sti_dvo.c
@@ -205,7 +205,7 @@ static void dvo_debugfs_init(struct sti_dvo *dvo, struct drm_minor *minor)
 
 	drm_debugfs_create_files(dvo_debugfs_files,
 				 ARRAY_SIZE(dvo_debugfs_files),
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 }
 
 static void sti_dvo_disable(struct drm_bridge *bridge)
diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
index 43c72c2604a0..83dbaa67d81e 100644
--- a/drivers/gpu/drm/sti/sti_gdp.c
+++ b/drivers/gpu/drm/sti/sti_gdp.c
@@ -347,7 +347,7 @@ static int gdp_debugfs_init(struct sti_gdp *gdp, struct drm_minor *minor)
 
 	drm_debugfs_create_files(gdp_debugfs_files,
 				 nb_files,
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c
index 15097ac67931..f32dfb85f503 100644
--- a/drivers/gpu/drm/sti/sti_hda.c
+++ b/drivers/gpu/drm/sti/sti_hda.c
@@ -377,7 +377,7 @@ static void hda_debugfs_init(struct sti_hda *hda, struct drm_minor *minor)
 
 	drm_debugfs_create_files(hda_debugfs_files,
 				 ARRAY_SIZE(hda_debugfs_files),
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 }
 
 /**
diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
index 8539fe1fedc4..3827ca9ced90 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.c
+++ b/drivers/gpu/drm/sti/sti_hdmi.c
@@ -743,7 +743,7 @@ static void hdmi_debugfs_init(struct sti_hdmi *hdmi, struct drm_minor *minor)
 
 	drm_debugfs_create_files(hdmi_debugfs_files,
 				 ARRAY_SIZE(hdmi_debugfs_files),
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 }
 
 static void sti_hdmi_disable(struct drm_bridge *bridge)
diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
index 02b77279f6e4..3148e113e2d6 100644
--- a/drivers/gpu/drm/sti/sti_hqvdp.c
+++ b/drivers/gpu/drm/sti/sti_hqvdp.c
@@ -650,7 +650,7 @@ static void hqvdp_debugfs_init(struct sti_hqvdp *hqvdp, struct drm_minor *minor)
 
 	drm_debugfs_create_files(hqvdp_debugfs_files,
 				 ARRAY_SIZE(hqvdp_debugfs_files),
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 }
 
 /**
diff --git a/drivers/gpu/drm/sti/sti_mixer.c b/drivers/gpu/drm/sti/sti_mixer.c
index 7e5f14646625..d708fae682cd 100644
--- a/drivers/gpu/drm/sti/sti_mixer.c
+++ b/drivers/gpu/drm/sti/sti_mixer.c
@@ -202,7 +202,7 @@ void sti_mixer_debugfs_init(struct sti_mixer *mixer, struct drm_minor *minor)
 
 	drm_debugfs_create_files(mixer_debugfs_files,
 				 nb_files,
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 }
 
 void sti_mixer_set_background_status(struct sti_mixer *mixer, bool enable)
diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c
index 2499715a69b7..fefd04719315 100644
--- a/drivers/gpu/drm/sti/sti_tvout.c
+++ b/drivers/gpu/drm/sti/sti_tvout.c
@@ -579,7 +579,7 @@ static void tvout_debugfs_init(struct sti_tvout *tvout, struct drm_minor *minor)
 
 	drm_debugfs_create_files(tvout_debugfs_files,
 				 ARRAY_SIZE(tvout_debugfs_files),
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 }
 
 static void sti_tvout_encoder_dpms(struct drm_encoder *encoder, int mode)
diff --git a/drivers/gpu/drm/sti/sti_vid.c b/drivers/gpu/drm/sti/sti_vid.c
index 2d818397918d..e8aa6e608c69 100644
--- a/drivers/gpu/drm/sti/sti_vid.c
+++ b/drivers/gpu/drm/sti/sti_vid.c
@@ -133,7 +133,7 @@ void vid_debugfs_init(struct sti_vid *vid, struct drm_minor *minor)
 
 	drm_debugfs_create_files(vid_debugfs_files,
 				 ARRAY_SIZE(vid_debugfs_files),
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 }
 
 void sti_vid_commit(struct sti_vid *vid,
diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index 6ca9f396e55b..4b7465464651 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -876,7 +876,7 @@ static void tegra_debugfs_init(struct drm_minor *minor)
 {
 	drm_debugfs_create_files(tegra_debugfs_list,
 				 ARRAY_SIZE(tegra_debugfs_list),
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 }
 #endif
 
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index fe56beea3e93..5a54608d8c83 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -468,7 +468,7 @@ static void tilcdc_debugfs_init(struct drm_minor *minor)
 
 	drm_debugfs_create_files(tilcdc_debugfs_list,
 				 ARRAY_SIZE(tilcdc_debugfs_list),
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 
 	list_for_each_entry(mod, &module_list, list)
 		if (mod->funcs->debugfs_init)
diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c
index e5b10e41554a..770b76701764 100644
--- a/drivers/gpu/drm/tiny/arcpgu.c
+++ b/drivers/gpu/drm/tiny/arcpgu.c
@@ -357,7 +357,7 @@ static void arcpgu_debugfs_init(struct drm_minor *minor)
 {
 	drm_debugfs_create_files(arcpgu_debugfs_list,
 				 ARRAY_SIZE(arcpgu_debugfs_list),
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 }
 #endif
 
diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c
index 4da66ef96783..85fae3ab85c6 100644
--- a/drivers/gpu/drm/vc4/vc4_hvs.c
+++ b/drivers/gpu/drm/vc4/vc4_hvs.c
@@ -769,7 +769,7 @@ int vc4_hvs_debugfs_init(struct drm_minor *minor)
 
 	if (!vc4->is_vc5)
 		debugfs_create_bool("hvs_load_tracker", S_IRUGO | S_IWUSR,
-				    minor->debugfs_root,
+				    minor->dev->debugfs_root,
 				    &vc4->load_tracker_enabled);
 
 	drm_debugfs_add_file(drm, "hvs_dlists", vc4_hvs_debugfs_dlist, NULL);
diff --git a/drivers/gpu/drm/virtio/virtgpu_debugfs.c b/drivers/gpu/drm/virtio/virtgpu_debugfs.c
index 853dd9aa397e..f403d03149bc 100644
--- a/drivers/gpu/drm/virtio/virtgpu_debugfs.c
+++ b/drivers/gpu/drm/virtio/virtgpu_debugfs.c
@@ -107,5 +107,5 @@ virtio_gpu_debugfs_init(struct drm_minor *minor)
 {
 	drm_debugfs_create_files(virtio_gpu_debugfs_list,
 				 VIRTIO_GPU_DEBUGFS_ENTRIES,
-				 minor->debugfs_root, minor);
+				 minor->dev->debugfs_root, minor);
 }
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 2588615a2a38..d5e70d7f9a54 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -1409,7 +1409,7 @@ static void vmw_remove(struct pci_dev *pdev)
 static void vmw_debugfs_resource_managers_init(struct vmw_private *vmw)
 {
 	struct drm_minor *minor = vmw->drm.primary;
-	struct dentry *root = minor->debugfs_root;
+	struct dentry *root = minor->dev->debugfs_root;
 
 	ttm_resource_manager_create_debugfs(ttm_manager_type(&vmw->bdev, TTM_PL_SYSTEM),
 					    root, "system_ttm");
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
index c0da89e16e6f..46ca03d78ad6 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
@@ -267,7 +267,7 @@ void vmw_debugfs_gem_init(struct vmw_private *vdev)
 {
 #if defined(CONFIG_DEBUG_FS)
 	struct drm_minor *minor = vdev->drm.primary;
-	struct dentry *root = minor->debugfs_root;
+	struct dentry *root = minor->dev->debugfs_root;
 
 	debugfs_create_file("vmwgfx_gem_info", 0444, root, vdev,
 			    &vmw_debugfs_gem_info_fops);
diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
index e687ce27624e..3ddbeef8f5de 100644
--- a/include/drm/drm_file.h
+++ b/include/drm/drm_file.h
@@ -77,8 +77,6 @@ struct drm_minor {
 	int type;                       /* Control or render or accel */
 	struct device *kdev;		/* Linux device */
 	struct drm_device *dev;
-
-	struct dentry *debugfs_root;
 };
 
 /**
-- 
2.34.1


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

* [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/5] drm/debugfs: drop debugfs_init() for the render and accel node v2
  2023-03-31  9:07 [Intel-gfx] [PATCH 1/5] drm/debugfs: drop debugfs_init() for the render and accel node v2 Christian König
                   ` (3 preceding siblings ...)
  2023-03-31  9:07 ` [Intel-gfx] [PATCH 5/5] drm/debugfs: remove debugfs_root pointer from minor Christian König
@ 2023-03-31 11:39 ` Patchwork
  2023-03-31 11:39 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
  2023-03-31 11:53 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
  6 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2023-03-31 11:39 UTC (permalink / raw)
  To: Christian König; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/5] drm/debugfs: drop debugfs_init() for the render and accel node v2
URL   : https://patchwork.freedesktop.org/series/115920/
State : warning

== Summary ==

Error: dim checkpatch failed
812a5adda093 drm/debugfs: drop debugfs_init() for the render and accel node v2
-:43: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <ckoenig.leichtzumerken@gmail.com>' != 'Signed-off-by: Christian König <christian.koenig@amd.com>'

total: 0 errors, 1 warnings, 0 checks, 17 lines checked
625098a6a955 drm/debugfs: rework debugfs directory creation v3
-:419: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <ckoenig.leichtzumerken@gmail.com>' != 'Signed-off-by: Christian König <christian.koenig@amd.com>'

total: 0 errors, 1 warnings, 0 checks, 321 lines checked
3724df6e1bab drm/debugfs: remove dev->debugfs_list and debugfs_mutex v2
-:165: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <ckoenig.leichtzumerken@gmail.com>' != 'Signed-off-by: Christian König <christian.koenig@amd.com>'

total: 0 errors, 1 warnings, 0 checks, 115 lines checked
6693df345d8a drm/debugfs: rework drm_debugfs_create_files implementation
-:271: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <ckoenig.leichtzumerken@gmail.com>' != 'Signed-off-by: Christian König <christian.koenig@amd.com>'

total: 0 errors, 1 warnings, 0 checks, 203 lines checked
93e7e1f6dffd drm/debugfs: remove debugfs_root pointer from minor
-:153: WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IWUSR' are not preferred. Consider using octal permissions '0200'.
#153: FILE: drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c:125:
+	debugfs_create_file("rap_test", S_IWUSR, root, adev,

-:198: WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IWUSR' are not preferred. Consider using octal permissions '0200'.
#198: FILE: drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c:180:
+	debugfs_create_file("securedisplay_test", S_IWUSR, adev_to_drm(adev)->debugfs_root,

-:199: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#199: FILE: drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c:181:
+	debugfs_create_file("securedisplay_test", S_IWUSR, adev_to_drm(adev)->debugfs_root,
 				adev, &amdgpu_securedisplay_debugfs_ops);

-:279: WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred. Consider using octal permissions '0644'.
#279: FILE: drivers/gpu/drm/arm/malidp_drv.c:555:
+	debugfs_create_file("debug", S_IRUGO | S_IWUSR, minor->dev->debugfs_root,

-:521: WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUSR' are not preferred. Consider using octal permissions '0400'.
#521: FILE: drivers/gpu/drm/i915/i915_debugfs.c:814:
+	debugfs_create_file("i915_forcewake_user", S_IRUSR, minor->dev->debugfs_root,

-:579: WARNING:EXPORTED_WORLD_WRITABLE: Exporting world writable files is usually an error. Consider more restrictive permissions.
#579: FILE: drivers/gpu/drm/msm/adreno/a5xx_debugfs.c:157:
+	debugfs_create_file_unsafe("reset", S_IWUGO, minor->dev->debugfs_root, dev,

-:579: WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IWUGO' are not preferred. Consider using octal permissions '0222'.
#579: FILE: drivers/gpu/drm/msm/adreno/a5xx_debugfs.c:157:
+	debugfs_create_file_unsafe("reset", S_IWUGO, minor->dev->debugfs_root, dev,

-:580: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#580: FILE: drivers/gpu/drm/msm/adreno/a5xx_debugfs.c:158:
+	debugfs_create_file_unsafe("reset", S_IWUGO, minor->dev->debugfs_root, dev,
 				&reset_fops);

-:646: WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUSR' are not preferred. Consider using octal permissions '0400'.
#646: FILE: drivers/gpu/drm/msm/msm_debugfs.c:314:
+	debugfs_create_file("gpu", S_IRUSR, minor->dev->debugfs_root,

-:647: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#647: FILE: drivers/gpu/drm/msm/msm_debugfs.c:315:
+	debugfs_create_file("gpu", S_IRUSR, minor->dev->debugfs_root,
 		dev, &msm_gpu_fops);

-:650: WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUSR' are not preferred. Consider using octal permissions '0400'.
#650: FILE: drivers/gpu/drm/msm/msm_debugfs.c:317:
+	debugfs_create_file("kms", S_IRUSR, minor->dev->debugfs_root,

-:651: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#651: FILE: drivers/gpu/drm/msm/msm_debugfs.c:318:
+	debugfs_create_file("kms", S_IRUSR, minor->dev->debugfs_root,
 		dev, &msm_kms_fops);

-:655: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#655: FILE: drivers/gpu/drm/msm/msm_debugfs.c:321:
+	debugfs_create_u32("hangcheck_period_ms", 0600, minor->dev->debugfs_root,
 		&priv->hangcheck_period);

-:659: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#659: FILE: drivers/gpu/drm/msm/msm_debugfs.c:324:
+	debugfs_create_bool("disable_err_irq", 0600, minor->dev->debugfs_root,
 		&priv->disable_err_irq);

-:662: WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRWXU' are not preferred. Consider using octal permissions '0700'.
#662: FILE: drivers/gpu/drm/msm/msm_debugfs.c:326:
+	debugfs_create_file("shrink", S_IRWXU, minor->dev->debugfs_root,

-:663: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#663: FILE: drivers/gpu/drm/msm/msm_debugfs.c:327:
+	debugfs_create_file("shrink", S_IRWXU, minor->dev->debugfs_root,
 		dev, &shrink_fops);

-:691: WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'.
#691: FILE: drivers/gpu/drm/msm/msm_perf.c:217:
+	debugfs_create_file("perf", S_IFREG | S_IRUGO, minor->dev->debugfs_root,

-:704: WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'.
#704: FILE: drivers/gpu/drm/msm/msm_rd.c:264:
+	debugfs_create_file(name, S_IFREG | S_IRUGO, minor->dev->debugfs_root, rd,

-:1001: WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred. Consider using octal permissions '0644'.
#1001: FILE: drivers/gpu/drm/sti/sti_drv.c:100:
+	debugfs_create_file("fps_show", S_IRUGO | S_IWUSR, minor->dev->debugfs_root,

-:1210: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: "Christian König" <ckoenig.leichtzumerken@gmail.com>' != 'Signed-off-by: Christian König <christian.koenig@amd.com>'

total: 0 errors, 13 warnings, 7 checks, 805 lines checked



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

* [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/5] drm/debugfs: drop debugfs_init() for the render and accel node v2
  2023-03-31  9:07 [Intel-gfx] [PATCH 1/5] drm/debugfs: drop debugfs_init() for the render and accel node v2 Christian König
                   ` (4 preceding siblings ...)
  2023-03-31 11:39 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/5] drm/debugfs: drop debugfs_init() for the render and accel node v2 Patchwork
@ 2023-03-31 11:39 ` Patchwork
  2023-03-31 11:53 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
  6 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2023-03-31 11:39 UTC (permalink / raw)
  To: Christian König; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/5] drm/debugfs: drop debugfs_init() for the render and accel node v2
URL   : https://patchwork.freedesktop.org/series/115920/
State : warning

== Summary ==

Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.



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

* [Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [1/5] drm/debugfs: drop debugfs_init() for the render and accel node v2
  2023-03-31  9:07 [Intel-gfx] [PATCH 1/5] drm/debugfs: drop debugfs_init() for the render and accel node v2 Christian König
                   ` (5 preceding siblings ...)
  2023-03-31 11:39 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
@ 2023-03-31 11:53 ` Patchwork
  6 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2023-03-31 11:53 UTC (permalink / raw)
  To: Christian König; +Cc: intel-gfx

[-- Attachment #1: Type: text/plain, Size: 5784 bytes --]

== Series Details ==

Series: series starting with [1/5] drm/debugfs: drop debugfs_init() for the render and accel node v2
URL   : https://patchwork.freedesktop.org/series/115920/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_12950 -> Patchwork_115920v1
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with Patchwork_115920v1 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_115920v1, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115920v1/index.html

Participating hosts (37 -> 36)
------------------------------

  Missing    (1): fi-snb-2520m 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in Patchwork_115920v1:

### IGT changes ###

#### Possible regressions ####

  * igt@gem_exec_suspend@basic-s0:
    - fi-kbl-8809g:       NOTRUN -> [FAIL][1] +1 similar issue
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115920v1/fi-kbl-8809g/igt@gem_exec_suspend@basic-s0.html

  * igt@i915_module_load@reload:
    - fi-kbl-8809g:       [PASS][2] -> [FAIL][3]
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12950/fi-kbl-8809g/igt@i915_module_load@reload.html
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115920v1/fi-kbl-8809g/igt@i915_module_load@reload.html

  
#### Warnings ####

  * igt@kms_chamelium_hpd@common-hpd-after-suspend:
    - fi-kbl-8809g:       [SKIP][4] ([fdo#109271]) -> [FAIL][5] +1 similar issue
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12950/fi-kbl-8809g/igt@kms_chamelium_hpd@common-hpd-after-suspend.html
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115920v1/fi-kbl-8809g/igt@kms_chamelium_hpd@common-hpd-after-suspend.html

  
Known issues
------------

  Here are the changes found in Patchwork_115920v1 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_pm_rpm@module-reload:
    - fi-kbl-8809g:       [PASS][6] -> [SKIP][7] ([fdo#109271])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12950/fi-kbl-8809g/igt@i915_pm_rpm@module-reload.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115920v1/fi-kbl-8809g/igt@i915_pm_rpm@module-reload.html

  * igt@i915_selftest@live@reset:
    - bat-rpls-2:         [PASS][8] -> [ABORT][9] ([i915#4983] / [i915#7913])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12950/bat-rpls-2/igt@i915_selftest@live@reset.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115920v1/bat-rpls-2/igt@i915_selftest@live@reset.html

  * igt@i915_suspend@basic-s3-without-i915:
    - bat-rpls-1:         [PASS][10] -> [ABORT][11] ([i915#6687] / [i915#7978])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12950/bat-rpls-1/igt@i915_suspend@basic-s3-without-i915.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115920v1/bat-rpls-1/igt@i915_suspend@basic-s3-without-i915.html

  
#### Possible fixes ####

  * igt@i915_pm_rps@basic-api:
    - bat-dg2-11:         [FAIL][12] ([i915#8308]) -> [PASS][13]
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12950/bat-dg2-11/igt@i915_pm_rps@basic-api.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115920v1/bat-dg2-11/igt@i915_pm_rps@basic-api.html

  * igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-d-dp-1:
    - bat-dg2-8:          [FAIL][14] ([i915#7932]) -> [PASS][15]
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12950/bat-dg2-8/igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-d-dp-1.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115920v1/bat-dg2-8/igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-d-dp-1.html

  
#### Warnings ####

  * igt@gem_lmem_swapping@basic:
    - fi-kbl-8809g:       [SKIP][16] ([fdo#109271] / [i915#4613]) -> [SKIP][17] ([fdo#109271]) +3 similar issues
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12950/fi-kbl-8809g/igt@gem_lmem_swapping@basic.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115920v1/fi-kbl-8809g/igt@gem_lmem_swapping@basic.html

  
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
  [i915#6687]: https://gitlab.freedesktop.org/drm/intel/issues/6687
  [i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
  [i915#7932]: https://gitlab.freedesktop.org/drm/intel/issues/7932
  [i915#7978]: https://gitlab.freedesktop.org/drm/intel/issues/7978
  [i915#8308]: https://gitlab.freedesktop.org/drm/intel/issues/8308


Build changes
-------------

  * Linux: CI_DRM_12950 -> Patchwork_115920v1

  CI-20190529: 20190529
  CI_DRM_12950: 47c4ceabb0ff38d88aed06b1c3ca5196b6659189 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_7230: f0485204004305dd3ee8f8bbbb9c552e53a4e050 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  Patchwork_115920v1: 47c4ceabb0ff38d88aed06b1c3ca5196b6659189 @ git://anongit.freedesktop.org/gfx-ci/linux


### Linux commits

bf2bb04398e6 drm/debugfs: remove debugfs_root pointer from minor
9164b7b554c0 drm/debugfs: rework drm_debugfs_create_files implementation
b6a74846bbe6 drm/debugfs: remove dev->debugfs_list and debugfs_mutex v2
5647e9f1f7b6 drm/debugfs: rework debugfs directory creation v3
3923af6744f2 drm/debugfs: drop debugfs_init() for the render and accel node v2

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_115920v1/index.html

[-- Attachment #2: Type: text/html, Size: 6842 bytes --]

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

* Re: [Intel-gfx] [PATCH 5/5] drm/debugfs: remove debugfs_root pointer from minor
  2023-03-31  9:07 ` [Intel-gfx] [PATCH 5/5] drm/debugfs: remove debugfs_root pointer from minor Christian König
@ 2023-04-06 12:30   ` Jani Nikula
  0 siblings, 0 replies; 9+ messages in thread
From: Jani Nikula @ 2023-04-06 12:30 UTC (permalink / raw)
  To: Christian König, intel-gfx

On Fri, 31 Mar 2023, "Christian König" <ckoenig.leichtzumerken@gmail.com> wrote:
> We only keept that around for API compatibility with drivers. Clean all
> this up and use the per device debugfs directory.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>  drivers/accel/drm_accel.c                      |  2 --
>  drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c    |  4 ++--
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c      |  3 +--
>  .../gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c |  2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c        |  3 +--
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c         |  3 +--
>  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c        |  4 +---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c     |  5 ++---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c        |  6 +++---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c        |  6 +++---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c       |  3 +--
>  .../gpu/drm/amd/amdgpu/amdgpu_securedisplay.c  |  2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c        |  3 +--
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c        |  3 +--
>  .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c  |  2 +-
>  drivers/gpu/drm/amd/pm/amdgpu_pm.c             |  3 +--
>  drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c      |  2 +-
>  drivers/gpu/drm/arm/malidp_drv.c               |  2 +-
>  drivers/gpu/drm/armada/armada_debugfs.c        |  2 +-
>  drivers/gpu/drm/drm_debugfs.c                  |  3 ---
>  drivers/gpu/drm/drm_mipi_dbi.c                 |  2 +-
>  drivers/gpu/drm/etnaviv/etnaviv_drv.c          |  2 +-
>  .../drm/i915/display/intel_display_debugfs.c   |  4 ++--
>  drivers/gpu/drm/i915/display/intel_dmc.c       |  2 +-
>  drivers/gpu/drm/i915/display/intel_fbc.c       |  2 +-
>  drivers/gpu/drm/i915/display/intel_hotplug.c   |  9 ++++++---
>  drivers/gpu/drm/i915/display/intel_psr.c       |  6 ++++--
>  drivers/gpu/drm/i915/display/intel_wm.c        |  9 ++++++---
>  drivers/gpu/drm/i915/display/skl_watermark.c   |  6 ++++--
>  drivers/gpu/drm/i915/gt/intel_gt_debugfs.c     |  4 ++--
>  drivers/gpu/drm/i915/gvt/debugfs.c             |  6 +++---
>  drivers/gpu/drm/i915/i915_debugfs.c            |  6 +++---
>  drivers/gpu/drm/i915/i915_debugfs_params.c     |  2 +-
>  drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c   |  4 ++--
>  drivers/gpu/drm/msm/adreno/a5xx_debugfs.c      |  4 ++--
>  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c    |  2 +-
>  drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c        |  2 +-
>  drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c       |  2 +-
>  drivers/gpu/drm/msm/dp/dp_debug.c              |  2 +-
>  drivers/gpu/drm/msm/msm_debugfs.c              | 18 +++++++++---------
>  drivers/gpu/drm/msm/msm_perf.c                 |  2 +-
>  drivers/gpu/drm/msm/msm_rd.c                   |  2 +-
>  drivers/gpu/drm/nouveau/nouveau_debugfs.c      |  6 +++---
>  drivers/gpu/drm/omapdrm/omap_debugfs.c         |  4 ++--
>  drivers/gpu/drm/pl111/pl111_debugfs.c          |  2 +-
>  drivers/gpu/drm/qxl/qxl_debugfs.c              |  4 ++--
>  drivers/gpu/drm/qxl/qxl_ttm.c                  |  4 ++--
>  drivers/gpu/drm/radeon/r100.c                  |  6 +++---
>  drivers/gpu/drm/radeon/r300.c                  |  2 +-
>  drivers/gpu/drm/radeon/r420.c                  |  2 +-
>  drivers/gpu/drm/radeon/r600.c                  |  2 +-
>  drivers/gpu/drm/radeon/radeon_fence.c          |  2 +-
>  drivers/gpu/drm/radeon/radeon_gem.c            |  2 +-
>  drivers/gpu/drm/radeon/radeon_ib.c             |  2 +-
>  drivers/gpu/drm/radeon/radeon_pm.c             |  2 +-
>  drivers/gpu/drm/radeon/radeon_ring.c           |  2 +-
>  drivers/gpu/drm/radeon/radeon_ttm.c            |  2 +-
>  drivers/gpu/drm/radeon/rs400.c                 |  2 +-
>  drivers/gpu/drm/radeon/rv515.c                 |  2 +-
>  drivers/gpu/drm/sti/sti_cursor.c               |  2 +-
>  drivers/gpu/drm/sti/sti_drv.c                  |  4 ++--
>  drivers/gpu/drm/sti/sti_dvo.c                  |  2 +-
>  drivers/gpu/drm/sti/sti_gdp.c                  |  2 +-
>  drivers/gpu/drm/sti/sti_hda.c                  |  2 +-
>  drivers/gpu/drm/sti/sti_hdmi.c                 |  2 +-
>  drivers/gpu/drm/sti/sti_hqvdp.c                |  2 +-
>  drivers/gpu/drm/sti/sti_mixer.c                |  2 +-
>  drivers/gpu/drm/sti/sti_tvout.c                |  2 +-
>  drivers/gpu/drm/sti/sti_vid.c                  |  2 +-
>  drivers/gpu/drm/tegra/drm.c                    |  2 +-
>  drivers/gpu/drm/tilcdc/tilcdc_drv.c            |  2 +-
>  drivers/gpu/drm/tiny/arcpgu.c                  |  2 +-
>  drivers/gpu/drm/vc4/vc4_hvs.c                  |  2 +-
>  drivers/gpu/drm/virtio/virtgpu_debugfs.c       |  2 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_drv.c            |  2 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_gem.c            |  2 +-
>  include/drm/drm_file.h                         |  2 --
>  77 files changed, 120 insertions(+), 127 deletions(-)
>
> diff --git a/drivers/accel/drm_accel.c b/drivers/accel/drm_accel.c
> index 82c54bc2dcad..7e4176c736a5 100644
> --- a/drivers/accel/drm_accel.c
> +++ b/drivers/accel/drm_accel.c
> @@ -100,8 +100,6 @@ void accel_debugfs_register(struct drm_device *dev)
>  {
>  	struct drm_minor *minor = dev->accel;
>  
> -	minor->debugfs_root = dev->debugfs_root;
> -
>  	drm_debugfs_create_files(accel_debugfs_list, ACCEL_DEBUGFS_ENTRIES,
>  				 dev->debugfs_root, minor);
>  }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> index f60753f97ac5..54d2b92a9e71 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> @@ -1454,7 +1454,7 @@ static const char *debugfs_regs_names[] = {
>  int amdgpu_debugfs_regs_init(struct amdgpu_device *adev)
>  {
>  	struct drm_minor *minor = adev_to_drm(adev)->primary;
> -	struct dentry *ent, *root = minor->debugfs_root;
> +	struct dentry *ent, *root = minor->dev->debugfs_root;
>  	unsigned int i;
>  
>  	for (i = 0; i < ARRAY_SIZE(debugfs_regs); i++) {
> @@ -1926,7 +1926,7 @@ static const struct file_operations amdgpu_reset_dump_register_list = {
>  
>  int amdgpu_debugfs_init(struct amdgpu_device *adev)
>  {
> -	struct dentry *root = adev_to_drm(adev)->primary->debugfs_root;
> +	struct dentry *root = adev_to_drm(adev)->debugfs_root;
>  	struct dentry *ent;
>  	int r, i;
>  
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> index f52d0ba91a77..eb406870d57b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> @@ -927,8 +927,7 @@ static void amdgpu_debugfs_reset_work(struct work_struct *work)
>  void amdgpu_debugfs_fence_init(struct amdgpu_device *adev)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> -	struct drm_minor *minor = adev_to_drm(adev)->primary;
> -	struct dentry *root = minor->debugfs_root;
> +	struct dentry *root = adev_to_drm(adev)->debugfs_root;
>  
>  	debugfs_create_file("amdgpu_fence_info", 0444, root, adev,
>  			    &amdgpu_debugfs_fence_info_fops);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c
> index 2ca3c329de6d..c18f1316ea88 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c
> @@ -137,7 +137,7 @@ void amdgpu_fw_attestation_debugfs_init(struct amdgpu_device *adev)
>  
>  	debugfs_create_file("amdgpu_fw_attestation",
>  			    S_IRUSR,
> -			    adev_to_drm(adev)->primary->debugfs_root,
> +			    adev_to_drm(adev)->debugfs_root,
>  			    adev,
>  			    &amdgpu_fw_attestation_debugfs_ops);
>  }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> index 863cb668e000..d2c8c3491bb6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> @@ -994,8 +994,7 @@ DEFINE_SHOW_ATTRIBUTE(amdgpu_debugfs_gem_info);
>  void amdgpu_debugfs_gem_init(struct amdgpu_device *adev)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> -	struct drm_minor *minor = adev_to_drm(adev)->primary;
> -	struct dentry *root = minor->debugfs_root;
> +	struct dentry *root = adev_to_drm(adev)->debugfs_root;
>  
>  	debugfs_create_file("amdgpu_gem_info", 0444, root, adev,
>  			    &amdgpu_debugfs_gem_info_fops);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
> index df7eb0b7c4b9..f36b656f91d2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
> @@ -457,8 +457,7 @@ DEFINE_SHOW_ATTRIBUTE(amdgpu_debugfs_sa_info);
>  void amdgpu_debugfs_sa_init(struct amdgpu_device *adev)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> -	struct drm_minor *minor = adev_to_drm(adev)->primary;
> -	struct dentry *root = minor->debugfs_root;
> +	struct dentry *root = adev_to_drm(adev)->debugfs_root;
>  
>  	debugfs_create_file("amdgpu_sa_info", 0444, root, adev,
>  			    &amdgpu_debugfs_sa_info_fops);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> index 0efb38539d70..751351aa598b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> @@ -1704,11 +1704,9 @@ DEFINE_SHOW_ATTRIBUTE(amdgpu_debugfs_firmware_info);
>  void amdgpu_debugfs_firmware_init(struct amdgpu_device *adev)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> -	struct drm_minor *minor = adev_to_drm(adev)->primary;
> -	struct dentry *root = minor->debugfs_root;
> +	struct dentry *root = adev_to_drm(adev)->debugfs_root;
>  
>  	debugfs_create_file("amdgpu_firmware_info", 0444, root,
>  			    adev, &amdgpu_debugfs_firmware_info_fops);
> -
>  #endif
>  }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c
> index 468a67b302d4..aff145bcbfe2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c
> @@ -373,9 +373,8 @@ static ssize_t ta_if_invoke_debugfs_write(struct file *fp, const char *buf, size
>  
>  void amdgpu_ta_if_debugfs_init(struct amdgpu_device *adev)
>  {
> -	struct drm_minor *minor = adev_to_drm(adev)->primary;
> -
> -	struct dentry *dir = debugfs_create_dir("ta_if", minor->debugfs_root);
> +	struct dentry *root = adev_to_drm(adev)->debugfs_root;
> +	struct dentry *dir = debugfs_create_dir("ta_if", root);
>  
>  	debugfs_create_file("ta_load", 0200, dir, adev,
>  				     &ta_load_debugfs_fops);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c
> index 12010c988c8b..a39aba26710c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c
> @@ -117,12 +117,12 @@ static const struct file_operations amdgpu_rap_debugfs_ops = {
>  void amdgpu_rap_debugfs_init(struct amdgpu_device *adev)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> -	struct drm_minor *minor = adev_to_drm(adev)->primary;
> +	struct dentry *root = adev_to_drm(adev)->debugfs_root;
>  
>  	if (!adev->psp.rap_context.context.initialized)
>  		return;
>  
> -	debugfs_create_file("rap_test", S_IWUSR, minor->debugfs_root,
> -				adev, &amdgpu_rap_debugfs_ops);
> +	debugfs_create_file("rap_test", S_IWUSR, root, adev,
> +			    &amdgpu_rap_debugfs_ops);
>  #endif
>  }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index 11df6ee052b4..f7e6dcca3873 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -1440,10 +1440,10 @@ static int amdgpu_ras_sysfs_remove_all(struct amdgpu_device *adev)
>  static struct dentry *amdgpu_ras_debugfs_create_ctrl_node(struct amdgpu_device *adev)
>  {
>  	struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
> -	struct drm_minor  *minor = adev_to_drm(adev)->primary;
> -	struct dentry     *dir;
> +	struct dentry *root = adev_to_drm(adev)->debugfs_root;
> +	struct dentry *dir;
>  
> -	dir = debugfs_create_dir(RAS_FS_NAME, minor->debugfs_root);
> +	dir = debugfs_create_dir(RAS_FS_NAME, root);
>  	debugfs_create_file("ras_ctrl", S_IWUGO | S_IRUGO, dir, adev,
>  			    &amdgpu_ras_debugfs_ctrl_ops);
>  	debugfs_create_file("ras_eeprom_reset", S_IWUGO | S_IRUGO, dir, adev,
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> index dc474b809604..b75cd5958c40 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> @@ -484,8 +484,7 @@ void amdgpu_debugfs_ring_init(struct amdgpu_device *adev,
>  			      struct amdgpu_ring *ring)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> -	struct drm_minor *minor = adev_to_drm(adev)->primary;
> -	struct dentry *root = minor->debugfs_root;
> +	struct dentry *root = adev_to_drm(adev)->debugfs_root;
>  	char name[32];
>  
>  	sprintf(name, "amdgpu_ring_%s", ring->name);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c
> index 8ed0e073656f..575320c6d48a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c
> @@ -177,7 +177,7 @@ void amdgpu_securedisplay_debugfs_init(struct amdgpu_device *adev)
>  	if (!adev->psp.securedisplay_context.context.initialized)
>  		return;
>  
> -	debugfs_create_file("securedisplay_test", S_IWUSR, adev_to_drm(adev)->primary->debugfs_root,
> +	debugfs_create_file("securedisplay_test", S_IWUSR, adev_to_drm(adev)->debugfs_root,
>  				adev, &amdgpu_securedisplay_debugfs_ops);
>  #endif
>  }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 2cd081cbf706..2198fef53fdc 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -2371,8 +2371,7 @@ static const struct file_operations amdgpu_ttm_iomem_fops = {
>  void amdgpu_ttm_debugfs_init(struct amdgpu_device *adev)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> -	struct drm_minor *minor = adev_to_drm(adev)->primary;
> -	struct dentry *root = minor->debugfs_root;
> +	struct dentry *root = adev_to_drm(adev)->debugfs_root;
>  
>  	debugfs_create_file_size("amdgpu_vram", 0444, root, adev,
>  				 &amdgpu_ttm_vram_fops, adev->gmc.mc_vram_size);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> index e63fcc58e8e0..1d40763939dc 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> @@ -1121,8 +1121,7 @@ void amdgpu_debugfs_vcn_fwlog_init(struct amdgpu_device *adev, uint8_t i,
>                                     struct amdgpu_vcn_inst *vcn)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> -	struct drm_minor *minor = adev_to_drm(adev)->primary;
> -	struct dentry *root = minor->debugfs_root;
> +	struct dentry *root = adev_to_drm(adev)->debugfs_root;
>  	char name[32];
>  
>  	sprintf(name, "amdgpu_vcn_%d_fwlog", i);
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> index 827fcb4fb3b3..cec1cafafd0c 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> @@ -3658,7 +3658,7 @@ void dtn_debugfs_init(struct amdgpu_device *adev)
>  	};
>  
>  	struct drm_minor *minor = adev_to_drm(adev)->primary;
> -	struct dentry *root = minor->debugfs_root;
> +	struct dentry *root = minor->dev->debugfs_root;
>  
>  	debugfs_create_file("amdgpu_mst_topology", 0444, root,
>  			    adev, &mst_topo_fops);
> diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> index d75a67cfe523..3e900b6f746b 100644
> --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> @@ -3705,8 +3705,7 @@ static const struct file_operations amdgpu_debugfs_pm_prv_buffer_fops = {
>  void amdgpu_debugfs_pm_init(struct amdgpu_device *adev)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> -	struct drm_minor *minor = adev_to_drm(adev)->primary;
> -	struct dentry *root = minor->debugfs_root;
> +	struct dentry *root = adev_to_drm(adev)->debugfs_root;
>  
>  	if (!adev->pm.dpm_enabled)
>  		return;
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> index b5d64749990e..9afdd31072ee 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> @@ -3215,7 +3215,7 @@ void amdgpu_smu_stb_debug_fs_init(struct amdgpu_device *adev)
>  
>  	debugfs_create_file_size("amdgpu_smu_stb_dump",
>  			    S_IRUSR,
> -			    adev_to_drm(adev)->primary->debugfs_root,
> +			    adev_to_drm(adev)->debugfs_root,
>  			    adev,
>  			    &smu_stb_debugfs_fops,
>  			    smu->stb_context.stb_buf_size);
> diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
> index c03cfd57b752..c825a453a03f 100644
> --- a/drivers/gpu/drm/arm/malidp_drv.c
> +++ b/drivers/gpu/drm/arm/malidp_drv.c
> @@ -552,7 +552,7 @@ static void malidp_debugfs_init(struct drm_minor *minor)
>  	malidp_error_stats_init(&malidp->de_errors);
>  	malidp_error_stats_init(&malidp->se_errors);
>  	spin_lock_init(&malidp->errors_lock);
> -	debugfs_create_file("debug", S_IRUGO | S_IWUSR, minor->debugfs_root,
> +	debugfs_create_file("debug", S_IRUGO | S_IWUSR, minor->dev->debugfs_root,
>  			    minor->dev, &malidp_debugfs_fops);
>  }
>  
> diff --git a/drivers/gpu/drm/armada/armada_debugfs.c b/drivers/gpu/drm/armada/armada_debugfs.c
> index 29f4b52e3c8d..24b42ca59f02 100644
> --- a/drivers/gpu/drm/armada/armada_debugfs.c
> +++ b/drivers/gpu/drm/armada/armada_debugfs.c
> @@ -105,7 +105,7 @@ static struct drm_info_list armada_debugfs_list[] = {
>  int armada_drm_debugfs_init(struct drm_minor *minor)
>  {
>  	drm_debugfs_create_files(armada_debugfs_list, ARMADA_DEBUGFS_ENTRIES,
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  
>  	return 0;
>  }
> diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
> index c8e2d4f9f00d..e09a4c47b66b 100644
> --- a/drivers/gpu/drm/drm_debugfs.c
> +++ b/drivers/gpu/drm/drm_debugfs.c
> @@ -264,9 +264,6 @@ int drm_debugfs_register(struct drm_minor *minor, int minor_id,
>  	sprintf(name, "%d", minor_id);
>  	debugfs_create_symlink(name, root, dev->unique);
>  
> -	/* TODO: Only for compatibility with drivers */
> -	minor->debugfs_root = dev->debugfs_root;
> -
>  	if (dev->driver->debugfs_init && dev->render != minor)
>  		dev->driver->debugfs_init(minor);
>  
> diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c
> index c871d9f096b8..8ffd30885d01 100644
> --- a/drivers/gpu/drm/drm_mipi_dbi.c
> +++ b/drivers/gpu/drm/drm_mipi_dbi.c
> @@ -1454,7 +1454,7 @@ void mipi_dbi_debugfs_init(struct drm_minor *minor)
>  
>  	if (dbidev->dbi.read_commands)
>  		mode |= S_IRUGO;
> -	debugfs_create_file("command", mode, minor->debugfs_root, dbidev,
> +	debugfs_create_file("command", mode, minor->dev->debugfs_root, dbidev,
>  			    &mipi_dbi_debugfs_command_fops);
>  }
>  EXPORT_SYMBOL(mipi_dbi_debugfs_init);
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> index 31a7f59ccb49..4819b4f9ebb4 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> @@ -242,7 +242,7 @@ static void etnaviv_debugfs_init(struct drm_minor *minor)
>  {
>  	drm_debugfs_create_files(etnaviv_debugfs_list,
>  				 ARRAY_SIZE(etnaviv_debugfs_list),
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  }
>  #endif
>  
> diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> index d5715ccc37f0..37173456f5bc 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> @@ -1083,14 +1083,14 @@ void intel_display_debugfs_register(struct drm_i915_private *i915)
>  	for (i = 0; i < ARRAY_SIZE(intel_display_debugfs_files); i++) {
>  		debugfs_create_file(intel_display_debugfs_files[i].name,
>  				    S_IRUGO | S_IWUSR,
> -				    minor->debugfs_root,
> +				    minor->dev->debugfs_root,

Mmh, wherever you have struct drm_i915_private *i915 around, this should
be the same as i915->drm.debugfs_root, and minor local could be ditched.

Ditto for pretty much all i915 changes.

BR,
Jani.

>  				    to_i915(minor->dev),
>  				    intel_display_debugfs_files[i].fops);
>  	}
>  
>  	drm_debugfs_create_files(intel_display_debugfs_list,
>  				 ARRAY_SIZE(intel_display_debugfs_list),
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  
>  	intel_dmc_debugfs_register(i915);
>  	intel_fbc_debugfs_register(i915);
> diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c b/drivers/gpu/drm/i915/display/intel_dmc.c
> index 8a88de67ff0a..4ca2125c0a8a 100644
> --- a/drivers/gpu/drm/i915/display/intel_dmc.c
> +++ b/drivers/gpu/drm/i915/display/intel_dmc.c
> @@ -1229,6 +1229,6 @@ void intel_dmc_debugfs_register(struct drm_i915_private *i915)
>  {
>  	struct drm_minor *minor = i915->drm.primary;
>  
> -	debugfs_create_file("i915_dmc_info", 0444, minor->debugfs_root,
> +	debugfs_create_file("i915_dmc_info", 0444, minor->dev->debugfs_root,
>  			    i915, &intel_dmc_debugfs_status_fops);
>  }
> diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
> index b507ff944864..5a83b4e87246 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbc.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbc.c
> @@ -1839,5 +1839,5 @@ void intel_fbc_debugfs_register(struct drm_i915_private *i915)
>  
>  	fbc = i915->display.fbc[INTEL_FBC_A];
>  	if (fbc)
> -		intel_fbc_debugfs_add(fbc, minor->debugfs_root);
> +		intel_fbc_debugfs_add(fbc, minor->dev->debugfs_root);
>  }
> diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c b/drivers/gpu/drm/i915/display/intel_hotplug.c
> index b12900446828..99dedfcefc50 100644
> --- a/drivers/gpu/drm/i915/display/intel_hotplug.c
> +++ b/drivers/gpu/drm/i915/display/intel_hotplug.c
> @@ -943,10 +943,13 @@ void intel_hpd_debugfs_register(struct drm_i915_private *i915)
>  {
>  	struct drm_minor *minor = i915->drm.primary;
>  
> -	debugfs_create_file("i915_hpd_storm_ctl", 0644, minor->debugfs_root,
> +	debugfs_create_file("i915_hpd_storm_ctl", 0644,
> +			    minor->dev->debugfs_root,
>  			    i915, &i915_hpd_storm_ctl_fops);
> -	debugfs_create_file("i915_hpd_short_storm_ctl", 0644, minor->debugfs_root,
> +	debugfs_create_file("i915_hpd_short_storm_ctl", 0644,
> +			    minor->dev->debugfs_root,
>  			    i915, &i915_hpd_short_storm_ctl_fops);
> -	debugfs_create_bool("i915_ignore_long_hpd", 0644, minor->debugfs_root,
> +	debugfs_create_bool("i915_ignore_long_hpd", 0644,
> +			    minor->dev->debugfs_root,
>  			    &i915->display.hotplug.ignore_long_hpd);
>  }
> diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
> index ecf1781c1556..5411686c58a8 100644
> --- a/drivers/gpu/drm/i915/display/intel_psr.c
> +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> @@ -2922,10 +2922,12 @@ void intel_psr_debugfs_register(struct drm_i915_private *i915)
>  {
>  	struct drm_minor *minor = i915->drm.primary;
>  
> -	debugfs_create_file("i915_edp_psr_debug", 0644, minor->debugfs_root,
> +	debugfs_create_file("i915_edp_psr_debug", 0644,
> +			    minor->dev->debugfs_root,
>  			    i915, &i915_edp_psr_debug_fops);
>  
> -	debugfs_create_file("i915_edp_psr_status", 0444, minor->debugfs_root,
> +	debugfs_create_file("i915_edp_psr_status", 0444,
> +			    minor->dev->debugfs_root,
>  			    i915, &i915_edp_psr_status_fops);
>  }
>  
> diff --git a/drivers/gpu/drm/i915/display/intel_wm.c b/drivers/gpu/drm/i915/display/intel_wm.c
> index bb99179cd5fd..cfa618da262e 100644
> --- a/drivers/gpu/drm/i915/display/intel_wm.c
> +++ b/drivers/gpu/drm/i915/display/intel_wm.c
> @@ -395,13 +395,16 @@ void intel_wm_debugfs_register(struct drm_i915_private *i915)
>  {
>  	struct drm_minor *minor = i915->drm.primary;
>  
> -	debugfs_create_file("i915_pri_wm_latency", 0644, minor->debugfs_root,
> +	debugfs_create_file("i915_pri_wm_latency", 0644,
> +			    minor->dev->debugfs_root,
>  			    i915, &i915_pri_wm_latency_fops);
>  
> -	debugfs_create_file("i915_spr_wm_latency", 0644, minor->debugfs_root,
> +	debugfs_create_file("i915_spr_wm_latency", 0644,
> +			    minor->dev->debugfs_root,
>  			    i915, &i915_spr_wm_latency_fops);
>  
> -	debugfs_create_file("i915_cur_wm_latency", 0644, minor->debugfs_root,
> +	debugfs_create_file("i915_cur_wm_latency", 0644,
> +			    minor->dev->debugfs_root,
>  			    i915, &i915_cur_wm_latency_fops);
>  
>  	skl_watermark_debugfs_register(i915);
> diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c b/drivers/gpu/drm/i915/display/skl_watermark.c
> index 5296a20d62d3..34cb0c6d0f51 100644
> --- a/drivers/gpu/drm/i915/display/skl_watermark.c
> +++ b/drivers/gpu/drm/i915/display/skl_watermark.c
> @@ -3711,10 +3711,12 @@ void skl_watermark_debugfs_register(struct drm_i915_private *i915)
>  	struct drm_minor *minor = i915->drm.primary;
>  
>  	if (HAS_IPC(i915))
> -		debugfs_create_file("i915_ipc_status", 0644, minor->debugfs_root, i915,
> +		debugfs_create_file("i915_ipc_status", 0644,
> +				    minor->dev->debugfs_root, i915,
>  				    &skl_watermark_ipc_status_fops);
>  
>  	if (HAS_SAGV(i915))
> -		debugfs_create_file("i915_sagv_status", 0444, minor->debugfs_root, i915,
> +		debugfs_create_file("i915_sagv_status", 0444,
> +				    minor->dev->debugfs_root, i915,
>  				    &intel_sagv_status_fops);
>  }
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> index 4dc23b8d3aa2..bcb5407efdbe 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
> @@ -85,11 +85,11 @@ void intel_gt_debugfs_register(struct intel_gt *gt)
>  	struct dentry *root;
>  	char gtname[4];
>  
> -	if (!gt->i915->drm.primary->debugfs_root)
> +	if (!gt->i915->drm.debugfs_root)
>  		return;
>  
>  	snprintf(gtname, sizeof(gtname), "gt%u", gt->info.id);
> -	root = debugfs_create_dir(gtname, gt->i915->drm.primary->debugfs_root);
> +	root = debugfs_create_dir(gtname, gt->i915->drm.debugfs_root);
>  	if (IS_ERR(root))
>  		return;
>  
> diff --git a/drivers/gpu/drm/i915/gvt/debugfs.c b/drivers/gpu/drm/i915/gvt/debugfs.c
> index baccbf1761b7..f087986747ac 100644
> --- a/drivers/gpu/drm/i915/gvt/debugfs.c
> +++ b/drivers/gpu/drm/i915/gvt/debugfs.c
> @@ -195,7 +195,7 @@ void intel_gvt_debugfs_remove_vgpu(struct intel_vgpu *vgpu)
>  	struct intel_gvt *gvt = vgpu->gvt;
>  	struct drm_minor *minor = gvt->gt->i915->drm.primary;
>  
> -	if (minor->debugfs_root && gvt->debugfs_root) {
> +	if (minor->dev->debugfs_root && gvt->debugfs_root) {
>  		debugfs_remove_recursive(vgpu->debugfs);
>  		vgpu->debugfs = NULL;
>  	}
> @@ -209,7 +209,7 @@ void intel_gvt_debugfs_init(struct intel_gvt *gvt)
>  {
>  	struct drm_minor *minor = gvt->gt->i915->drm.primary;
>  
> -	gvt->debugfs_root = debugfs_create_dir("gvt", minor->debugfs_root);
> +	gvt->debugfs_root = debugfs_create_dir("gvt", minor->dev->debugfs_root);
>  
>  	debugfs_create_ulong("num_tracked_mmio", 0444, gvt->debugfs_root,
>  			     &gvt->mmio.num_tracked_mmio);
> @@ -223,7 +223,7 @@ void intel_gvt_debugfs_clean(struct intel_gvt *gvt)
>  {
>  	struct drm_minor *minor = gvt->gt->i915->drm.primary;
>  
> -	if (minor->debugfs_root) {
> +	if (minor->dev->debugfs_root) {
>  		debugfs_remove_recursive(gvt->debugfs_root);
>  		gvt->debugfs_root = NULL;
>  	}
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 80c2bf98e341..6f76850ff6e3 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -811,17 +811,17 @@ void i915_debugfs_register(struct drm_i915_private *dev_priv)
>  
>  	i915_debugfs_params(dev_priv);
>  
> -	debugfs_create_file("i915_forcewake_user", S_IRUSR, minor->debugfs_root,
> +	debugfs_create_file("i915_forcewake_user", S_IRUSR, minor->dev->debugfs_root,
>  			    to_i915(minor->dev), &i915_forcewake_fops);
>  	for (i = 0; i < ARRAY_SIZE(i915_debugfs_files); i++) {
>  		debugfs_create_file(i915_debugfs_files[i].name,
>  				    S_IRUGO | S_IWUSR,
> -				    minor->debugfs_root,
> +				    minor->dev->debugfs_root,
>  				    to_i915(minor->dev),
>  				    i915_debugfs_files[i].fops);
>  	}
>  
>  	drm_debugfs_create_files(i915_debugfs_list,
>  				 ARRAY_SIZE(i915_debugfs_list),
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  }
> diff --git a/drivers/gpu/drm/i915/i915_debugfs_params.c b/drivers/gpu/drm/i915/i915_debugfs_params.c
> index 614bde321589..704a016b3520 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs_params.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs_params.c
> @@ -248,7 +248,7 @@ struct dentry *i915_debugfs_params(struct drm_i915_private *i915)
>  	struct i915_params *params = &i915->params;
>  	struct dentry *dir;
>  
> -	dir = debugfs_create_dir("i915_params", minor->debugfs_root);
> +	dir = debugfs_create_dir("i915_params", minor->dev->debugfs_root);
>  	if (IS_ERR(dir))
>  		return dir;
>  
> diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c b/drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c
> index 4b8e70caa3ad..264b4832d3d9 100644
> --- a/drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c
> +++ b/drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c
> @@ -72,10 +72,10 @@ void intel_pxp_debugfs_register(struct intel_pxp *pxp)
>  		return;
>  
>  	minor = pxp->ctrl_gt->i915->drm.primary;
> -	if (!minor->debugfs_root)
> +	if (!minor->dev->debugfs_root)
>  		return;
>  
> -	pxproot = debugfs_create_dir("pxp", minor->debugfs_root);
> +	pxproot = debugfs_create_dir("pxp", minor->dev->debugfs_root);
>  	if (IS_ERR(pxproot))
>  		return;
>  
> diff --git a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
> index 6bd397a85834..b858a1590cf4 100644
> --- a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
> +++ b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
> @@ -152,8 +152,8 @@ void a5xx_debugfs_init(struct msm_gpu *gpu, struct drm_minor *minor)
>  
>  	drm_debugfs_create_files(a5xx_debugfs_list,
>  				 ARRAY_SIZE(a5xx_debugfs_list),
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  
> -	debugfs_create_file_unsafe("reset", S_IWUGO, minor->debugfs_root, dev,
> +	debugfs_create_file_unsafe("reset", S_IWUGO, minor->dev->debugfs_root, dev,
>  				&reset_fops);
>  }
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> index 758261e8ac73..987c332f216f 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> @@ -2137,7 +2137,7 @@ static int _dpu_encoder_init_debugfs(struct drm_encoder *drm_enc)
>  
>  	/* create overall sub-directory for the encoder */
>  	dpu_enc->debugfs_root = debugfs_create_dir(name,
> -			drm_enc->dev->primary->debugfs_root);
> +			drm_enc->dev->debugfs_root);
>  
>  	/* don't error check these */
>  	debugfs_create_file("status", 0600,
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> index a683bd9b5a04..3fba86e5b4da 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> @@ -269,7 +269,7 @@ static int dpu_kms_debugfs_init(struct msm_kms *kms, struct drm_minor *minor)
>  	dev = dpu_kms->dev;
>  	priv = dev->dev_private;
>  
> -	entry = debugfs_create_dir("debug", minor->debugfs_root);
> +	entry = debugfs_create_dir("debug", minor->dev->debugfs_root);
>  
>  	debugfs_create_x32(DPU_DEBUGFS_HWMASKNAME, 0600, entry, p);
>  
> diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
> index 29ae5c9613f3..800c0bf78529 100644
> --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
> +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
> @@ -253,7 +253,7 @@ static int mdp5_kms_debugfs_init(struct msm_kms *kms, struct drm_minor *minor)
>  {
>  	drm_debugfs_create_files(mdp5_debugfs_list,
>  				 ARRAY_SIZE(mdp5_debugfs_list),
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  
>  	return 0;
>  }
> diff --git a/drivers/gpu/drm/msm/dp/dp_debug.c b/drivers/gpu/drm/msm/dp/dp_debug.c
> index 5e35033ba3e4..eff62032a8f7 100644
> --- a/drivers/gpu/drm/msm/dp/dp_debug.c
> +++ b/drivers/gpu/drm/msm/dp/dp_debug.c
> @@ -213,7 +213,7 @@ static void dp_debug_init(struct dp_debug *dp_debug, struct drm_minor *minor)
>  
>  	snprintf(path, sizeof(path), "msm_dp-%s", debug->connector->name);
>  
> -	debug->root = debugfs_create_dir(path, minor->debugfs_root);
> +	debug->root = debugfs_create_dir(path, minor->dev->debugfs_root);
>  
>  	debugfs_create_file("dp_debug", 0444, debug->root,
>  			debug, &dp_debug_fops);
> diff --git a/drivers/gpu/drm/msm/msm_debugfs.c b/drivers/gpu/drm/msm/msm_debugfs.c
> index d6ecff0ab618..4fb5b44073bd 100644
> --- a/drivers/gpu/drm/msm/msm_debugfs.c
> +++ b/drivers/gpu/drm/msm/msm_debugfs.c
> @@ -309,24 +309,24 @@ void msm_debugfs_init(struct drm_minor *minor)
>  
>  	drm_debugfs_create_files(msm_debugfs_list,
>  				 ARRAY_SIZE(msm_debugfs_list),
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  
> -	debugfs_create_file("gpu", S_IRUSR, minor->debugfs_root,
> +	debugfs_create_file("gpu", S_IRUSR, minor->dev->debugfs_root,
>  		dev, &msm_gpu_fops);
>  
> -	debugfs_create_file("kms", S_IRUSR, minor->debugfs_root,
> +	debugfs_create_file("kms", S_IRUSR, minor->dev->debugfs_root,
>  		dev, &msm_kms_fops);
>  
> -	debugfs_create_u32("hangcheck_period_ms", 0600, minor->debugfs_root,
> +	debugfs_create_u32("hangcheck_period_ms", 0600, minor->dev->debugfs_root,
>  		&priv->hangcheck_period);
>  
> -	debugfs_create_bool("disable_err_irq", 0600, minor->debugfs_root,
> +	debugfs_create_bool("disable_err_irq", 0600, minor->dev->debugfs_root,
>  		&priv->disable_err_irq);
>  
> -	debugfs_create_file("shrink", S_IRWXU, minor->debugfs_root,
> +	debugfs_create_file("shrink", S_IRWXU, minor->dev->debugfs_root,
>  		dev, &shrink_fops);
>  
> -	gpu_devfreq = debugfs_create_dir("devfreq", minor->debugfs_root);
> +	gpu_devfreq = debugfs_create_dir("devfreq", dev->debugfs_root);
>  
>  	debugfs_create_bool("idle_clamp",0600, gpu_devfreq,
>  			    &priv->gpu_clamp_to_idle);
> @@ -341,9 +341,9 @@ void msm_debugfs_init(struct drm_minor *minor)
>  		priv->kms->funcs->debugfs_init(priv->kms, minor);
>  
>  #ifdef CONFIG_FAULT_INJECTION
> -	fault_create_debugfs_attr("fail_gem_alloc", minor->debugfs_root,
> +	fault_create_debugfs_attr("fail_gem_alloc", minor->dev->debugfs_root,
>  				  &fail_gem_alloc);
> -	fault_create_debugfs_attr("fail_gem_iova", minor->debugfs_root,
> +	fault_create_debugfs_attr("fail_gem_iova", minor->dev->debugfs_root,
>  				  &fail_gem_iova);
>  #endif
>  }
> diff --git a/drivers/gpu/drm/msm/msm_perf.c b/drivers/gpu/drm/msm/msm_perf.c
> index 3d3da79fec2a..82d8ef9e0e74 100644
> --- a/drivers/gpu/drm/msm/msm_perf.c
> +++ b/drivers/gpu/drm/msm/msm_perf.c
> @@ -214,7 +214,7 @@ int msm_perf_debugfs_init(struct drm_minor *minor)
>  	mutex_init(&perf->read_lock);
>  	priv->perf = perf;
>  
> -	debugfs_create_file("perf", S_IFREG | S_IRUGO, minor->debugfs_root,
> +	debugfs_create_file("perf", S_IFREG | S_IRUGO, minor->dev->debugfs_root,
>  			    perf, &perf_debugfs_fops);
>  	return 0;
>  }
> diff --git a/drivers/gpu/drm/msm/msm_rd.c b/drivers/gpu/drm/msm/msm_rd.c
> index db2f847c8535..cd0d4859fef0 100644
> --- a/drivers/gpu/drm/msm/msm_rd.c
> +++ b/drivers/gpu/drm/msm/msm_rd.c
> @@ -261,7 +261,7 @@ static struct msm_rd_state *rd_init(struct drm_minor *minor, const char *name)
>  
>  	init_waitqueue_head(&rd->fifo_event);
>  
> -	debugfs_create_file(name, S_IFREG | S_IRUGO, minor->debugfs_root, rd,
> +	debugfs_create_file(name, S_IFREG | S_IRUGO, minor->dev->debugfs_root, rd,
>  			    &rd_debugfs_fops);
>  
>  	return rd;
> diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
> index 2a36d1ca8fda..0ea7c19b8da9 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
> @@ -233,18 +233,18 @@ nouveau_drm_debugfs_init(struct drm_minor *minor)
>  	for (i = 0; i < ARRAY_SIZE(nouveau_debugfs_files); i++) {
>  		debugfs_create_file(nouveau_debugfs_files[i].name,
>  				    S_IRUGO | S_IWUSR,
> -				    minor->debugfs_root, minor->dev,
> +				    minor->dev->debugfs_root, minor->dev,
>  				    nouveau_debugfs_files[i].fops);
>  	}
>  
>  	drm_debugfs_create_files(nouveau_debugfs_list,
>  				 NOUVEAU_DEBUGFS_ENTRIES,
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  
>  	/* Set the size of the vbios since we know it, and it's confusing to
>  	 * userspace if it wants to seek() but the file has a length of 0
>  	 */
> -	dentry = debugfs_lookup("vbios.rom", minor->debugfs_root);
> +	dentry = debugfs_lookup("vbios.rom", minor->dev->debugfs_root);
>  	if (!dentry)
>  		return;
>  
> diff --git a/drivers/gpu/drm/omapdrm/omap_debugfs.c b/drivers/gpu/drm/omapdrm/omap_debugfs.c
> index bfb2ccb40bd1..ef14bb95326f 100644
> --- a/drivers/gpu/drm/omapdrm/omap_debugfs.c
> +++ b/drivers/gpu/drm/omapdrm/omap_debugfs.c
> @@ -85,12 +85,12 @@ void omap_debugfs_init(struct drm_minor *minor)
>  {
>  	drm_debugfs_create_files(omap_debugfs_list,
>  				 ARRAY_SIZE(omap_debugfs_list),
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  
>  	if (dmm_is_available())
>  		drm_debugfs_create_files(omap_dmm_debugfs_list,
>  					 ARRAY_SIZE(omap_dmm_debugfs_list),
> -					 minor->debugfs_root, minor);
> +					 minor->dev->debugfs_root, minor);
>  }
>  
>  #endif
> diff --git a/drivers/gpu/drm/pl111/pl111_debugfs.c b/drivers/gpu/drm/pl111/pl111_debugfs.c
> index 6744fa16f464..2603822bf9f4 100644
> --- a/drivers/gpu/drm/pl111/pl111_debugfs.c
> +++ b/drivers/gpu/drm/pl111/pl111_debugfs.c
> @@ -55,5 +55,5 @@ pl111_debugfs_init(struct drm_minor *minor)
>  {
>  	drm_debugfs_create_files(pl111_debugfs_list,
>  				 ARRAY_SIZE(pl111_debugfs_list),
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  }
> diff --git a/drivers/gpu/drm/qxl/qxl_debugfs.c b/drivers/gpu/drm/qxl/qxl_debugfs.c
> index 2d9ed3b94574..80e5b12802da 100644
> --- a/drivers/gpu/drm/qxl/qxl_debugfs.c
> +++ b/drivers/gpu/drm/qxl/qxl_debugfs.c
> @@ -90,7 +90,7 @@ qxl_debugfs_init(struct drm_minor *minor)
>  	struct qxl_device *dev = to_qxl(minor->dev);
>  
>  	drm_debugfs_create_files(qxl_debugfs_list, QXL_DEBUGFS_ENTRIES,
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  
>  	qxl_ttm_debugfs_init(dev);
>  #endif
> @@ -120,7 +120,7 @@ void qxl_debugfs_add_files(struct qxl_device *qdev,
>  	qdev->debugfs_count = i;
>  #if defined(CONFIG_DEBUG_FS)
>  	drm_debugfs_create_files(files, nfiles,
> -				 qdev->ddev.primary->debugfs_root,
> +				 qdev->ddev.debugfs_root,
>  				 qdev->ddev.primary);
>  #endif
>  }
> diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
> index 1a82629bce3f..f39f3a13e62c 100644
> --- a/drivers/gpu/drm/qxl/qxl_ttm.c
> +++ b/drivers/gpu/drm/qxl/qxl_ttm.c
> @@ -238,9 +238,9 @@ void qxl_ttm_debugfs_init(struct qxl_device *qdev)
>  #if defined(CONFIG_DEBUG_FS)
>  	ttm_resource_manager_create_debugfs(ttm_manager_type(&qdev->mman.bdev,
>  							     TTM_PL_VRAM),
> -					    qdev->ddev.primary->debugfs_root, "qxl_mem_mm");
> +					    qdev->ddev.debugfs_root, "qxl_mem_mm");
>  	ttm_resource_manager_create_debugfs(ttm_manager_type(&qdev->mman.bdev,
>  							     TTM_PL_PRIV),
> -					    qdev->ddev.primary->debugfs_root, "qxl_surf_mm");
> +					    qdev->ddev.debugfs_root, "qxl_surf_mm");
>  #endif
>  }
> diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
> index d4f09ecc3d22..23846346db0f 100644
> --- a/drivers/gpu/drm/radeon/r100.c
> +++ b/drivers/gpu/drm/radeon/r100.c
> @@ -3058,7 +3058,7 @@ DEFINE_SHOW_ATTRIBUTE(r100_debugfs_mc_info);
>  void  r100_debugfs_rbbm_init(struct radeon_device *rdev)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> -	struct dentry *root = rdev->ddev->primary->debugfs_root;
> +	struct dentry *root = rdev->ddev->debugfs_root;
>  
>  	debugfs_create_file("r100_rbbm_info", 0444, root, rdev,
>  			    &r100_debugfs_rbbm_info_fops);
> @@ -3068,7 +3068,7 @@ void  r100_debugfs_rbbm_init(struct radeon_device *rdev)
>  void r100_debugfs_cp_init(struct radeon_device *rdev)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> -	struct dentry *root = rdev->ddev->primary->debugfs_root;
> +	struct dentry *root = rdev->ddev->debugfs_root;
>  
>  	debugfs_create_file("r100_cp_ring_info", 0444, root, rdev,
>  			    &r100_debugfs_cp_ring_info_fops);
> @@ -3080,7 +3080,7 @@ void r100_debugfs_cp_init(struct radeon_device *rdev)
>  void  r100_debugfs_mc_info_init(struct radeon_device *rdev)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> -	struct dentry *root = rdev->ddev->primary->debugfs_root;
> +	struct dentry *root = rdev->ddev->debugfs_root;
>  
>  	debugfs_create_file("r100_mc_info", 0444, root, rdev,
>  			    &r100_debugfs_mc_info_fops);
> diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
> index 7b0cfeaddcec..3038426e465c 100644
> --- a/drivers/gpu/drm/radeon/r300.c
> +++ b/drivers/gpu/drm/radeon/r300.c
> @@ -615,7 +615,7 @@ DEFINE_SHOW_ATTRIBUTE(rv370_debugfs_pcie_gart_info);
>  static void rv370_debugfs_pcie_gart_info_init(struct radeon_device *rdev)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> -	struct dentry *root = rdev->ddev->primary->debugfs_root;
> +	struct dentry *root = rdev->ddev->debugfs_root;
>  
>  	debugfs_create_file("rv370_pcie_gart_info", 0444, root, rdev,
>  			    &rv370_debugfs_pcie_gart_info_fops);
> diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c
> index 7e6320e8c6a0..24e595db3dbf 100644
> --- a/drivers/gpu/drm/radeon/r420.c
> +++ b/drivers/gpu/drm/radeon/r420.c
> @@ -492,7 +492,7 @@ DEFINE_SHOW_ATTRIBUTE(r420_debugfs_pipes_info);
>  void r420_debugfs_pipes_info_init(struct radeon_device *rdev)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> -	struct dentry *root = rdev->ddev->primary->debugfs_root;
> +	struct dentry *root = rdev->ddev->debugfs_root;
>  
>  	debugfs_create_file("r420_pipes_info", 0444, root, rdev,
>  			    &r420_debugfs_pipes_info_fops);
> diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
> index dd78fc499402..1a1cf06f968c 100644
> --- a/drivers/gpu/drm/radeon/r600.c
> +++ b/drivers/gpu/drm/radeon/r600.c
> @@ -4358,7 +4358,7 @@ DEFINE_SHOW_ATTRIBUTE(r600_debugfs_mc_info);
>  static void r600_debugfs_mc_info_init(struct radeon_device *rdev)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> -	struct dentry *root = rdev->ddev->primary->debugfs_root;
> +	struct dentry *root = rdev->ddev->debugfs_root;
>  
>  	debugfs_create_file("r600_mc_info", 0444, root, rdev,
>  			    &r600_debugfs_mc_info_fops);
> diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
> index 73e3117420bf..20c178e2e9fd 100644
> --- a/drivers/gpu/drm/radeon/radeon_fence.c
> +++ b/drivers/gpu/drm/radeon/radeon_fence.c
> @@ -1004,7 +1004,7 @@ DEFINE_DEBUGFS_ATTRIBUTE(radeon_debugfs_gpu_reset_fops,
>  void radeon_debugfs_fence_init(struct radeon_device *rdev)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> -	struct dentry *root = rdev->ddev->primary->debugfs_root;
> +	struct dentry *root = rdev->ddev->debugfs_root;
>  
>  	debugfs_create_file("radeon_gpu_reset", 0444, root, rdev,
>  			    &radeon_debugfs_gpu_reset_fops);
> diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
> index 261fcbae88d7..7779179c9411 100644
> --- a/drivers/gpu/drm/radeon/radeon_gem.c
> +++ b/drivers/gpu/drm/radeon/radeon_gem.c
> @@ -892,7 +892,7 @@ DEFINE_SHOW_ATTRIBUTE(radeon_debugfs_gem_info);
>  void radeon_gem_debugfs_init(struct radeon_device *rdev)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> -	struct dentry *root = rdev->ddev->primary->debugfs_root;
> +	struct dentry *root = rdev->ddev->debugfs_root;
>  
>  	debugfs_create_file("radeon_gem_info", 0444, root, rdev,
>  			    &radeon_debugfs_gem_info_fops);
> diff --git a/drivers/gpu/drm/radeon/radeon_ib.c b/drivers/gpu/drm/radeon/radeon_ib.c
> index 6a45a72488f9..0a4c8ce3c6ca 100644
> --- a/drivers/gpu/drm/radeon/radeon_ib.c
> +++ b/drivers/gpu/drm/radeon/radeon_ib.c
> @@ -307,7 +307,7 @@ DEFINE_SHOW_ATTRIBUTE(radeon_debugfs_sa_info);
>  static void radeon_debugfs_sa_init(struct radeon_device *rdev)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> -	struct dentry *root = rdev->ddev->primary->debugfs_root;
> +	struct dentry *root = rdev->ddev->debugfs_root;
>  
>  	debugfs_create_file("radeon_sa_info", 0444, root, rdev,
>  			    &radeon_debugfs_sa_info_fops);
> diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
> index cbc554928bcc..e63aead25682 100644
> --- a/drivers/gpu/drm/radeon/radeon_pm.c
> +++ b/drivers/gpu/drm/radeon/radeon_pm.c
> @@ -1954,7 +1954,7 @@ DEFINE_SHOW_ATTRIBUTE(radeon_debugfs_pm_info);
>  static void radeon_debugfs_pm_init(struct radeon_device *rdev)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> -	struct dentry *root = rdev->ddev->primary->debugfs_root;
> +	struct dentry *root = rdev->ddev->debugfs_root;
>  
>  	debugfs_create_file("radeon_pm_info", 0444, root, rdev,
>  			    &radeon_debugfs_pm_info_fops);
> diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c
> index 7e207276df37..59f0b97b69eb 100644
> --- a/drivers/gpu/drm/radeon/radeon_ring.c
> +++ b/drivers/gpu/drm/radeon/radeon_ring.c
> @@ -548,7 +548,7 @@ static void radeon_debugfs_ring_init(struct radeon_device *rdev, struct radeon_r
>  {
>  #if defined(CONFIG_DEBUG_FS)
>  	const char *ring_name = radeon_debugfs_ring_idx_to_name(ring->idx);
> -	struct dentry *root = rdev->ddev->primary->debugfs_root;
> +	struct dentry *root = rdev->ddev->debugfs_root;
>  
>  	if (ring_name)
>  		debugfs_create_file(ring_name, 0444, root, ring,
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> index 2220cdf6a3f6..202a3db46be0 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -899,7 +899,7 @@ static void radeon_ttm_debugfs_init(struct radeon_device *rdev)
>  {
>  #if defined(CONFIG_DEBUG_FS)
>  	struct drm_minor *minor = rdev->ddev->primary;
> -	struct dentry *root = minor->debugfs_root;
> +	struct dentry *root = minor->dev->debugfs_root;
>  
>  	debugfs_create_file("radeon_vram", 0444, root, rdev,
>  			    &radeon_ttm_vram_fops);
> diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c
> index 6383f7a34bd8..79b968b41006 100644
> --- a/drivers/gpu/drm/radeon/rs400.c
> +++ b/drivers/gpu/drm/radeon/rs400.c
> @@ -378,7 +378,7 @@ DEFINE_SHOW_ATTRIBUTE(rs400_debugfs_gart_info);
>  static void rs400_debugfs_pcie_gart_info_init(struct radeon_device *rdev)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> -	struct dentry *root = rdev->ddev->primary->debugfs_root;
> +	struct dentry *root = rdev->ddev->debugfs_root;
>  
>  	debugfs_create_file("rs400_gart_info", 0444, root, rdev,
>  			    &rs400_debugfs_gart_info_fops);
> diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
> index 63fb06e8e2d7..1ad855b5eb21 100644
> --- a/drivers/gpu/drm/radeon/rv515.c
> +++ b/drivers/gpu/drm/radeon/rv515.c
> @@ -255,7 +255,7 @@ DEFINE_SHOW_ATTRIBUTE(rv515_debugfs_ga_info);
>  void rv515_debugfs(struct radeon_device *rdev)
>  {
>  #if defined(CONFIG_DEBUG_FS)
> -	struct dentry *root = rdev->ddev->primary->debugfs_root;
> +	struct dentry *root = rdev->ddev->debugfs_root;
>  
>  	debugfs_create_file("rv515_pipes_info", 0444, root, rdev,
>  			    &rv515_debugfs_pipes_info_fops);
> diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/drivers/gpu/drm/sti/sti_cursor.c
> index db0a1eb53532..9b2d671e4a66 100644
> --- a/drivers/gpu/drm/sti/sti_cursor.c
> +++ b/drivers/gpu/drm/sti/sti_cursor.c
> @@ -142,7 +142,7 @@ static void cursor_debugfs_init(struct sti_cursor *cursor,
>  
>  	drm_debugfs_create_files(cursor_debugfs_files,
>  				 ARRAY_SIZE(cursor_debugfs_files),
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  }
>  
>  static void sti_cursor_argb8888_to_clut8(struct sti_cursor *cursor, u32 *src)
> diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
> index 1b87b5899f9e..947e07029ce9 100644
> --- a/drivers/gpu/drm/sti/sti_drv.c
> +++ b/drivers/gpu/drm/sti/sti_drv.c
> @@ -95,9 +95,9 @@ static void sti_drm_dbg_init(struct drm_minor *minor)
>  {
>  	drm_debugfs_create_files(sti_drm_dbg_list,
>  				 ARRAY_SIZE(sti_drm_dbg_list),
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  
> -	debugfs_create_file("fps_show", S_IRUGO | S_IWUSR, minor->debugfs_root,
> +	debugfs_create_file("fps_show", S_IRUGO | S_IWUSR, minor->dev->debugfs_root,
>  			    minor->dev, &sti_drm_fps_fops);
>  
>  	DRM_INFO("%s: debugfs installed\n", DRIVER_NAME);
> diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c
> index 577c477b5f46..6d214a9cde62 100644
> --- a/drivers/gpu/drm/sti/sti_dvo.c
> +++ b/drivers/gpu/drm/sti/sti_dvo.c
> @@ -205,7 +205,7 @@ static void dvo_debugfs_init(struct sti_dvo *dvo, struct drm_minor *minor)
>  
>  	drm_debugfs_create_files(dvo_debugfs_files,
>  				 ARRAY_SIZE(dvo_debugfs_files),
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  }
>  
>  static void sti_dvo_disable(struct drm_bridge *bridge)
> diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
> index 43c72c2604a0..83dbaa67d81e 100644
> --- a/drivers/gpu/drm/sti/sti_gdp.c
> +++ b/drivers/gpu/drm/sti/sti_gdp.c
> @@ -347,7 +347,7 @@ static int gdp_debugfs_init(struct sti_gdp *gdp, struct drm_minor *minor)
>  
>  	drm_debugfs_create_files(gdp_debugfs_files,
>  				 nb_files,
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  	return 0;
>  }
>  
> diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c
> index 15097ac67931..f32dfb85f503 100644
> --- a/drivers/gpu/drm/sti/sti_hda.c
> +++ b/drivers/gpu/drm/sti/sti_hda.c
> @@ -377,7 +377,7 @@ static void hda_debugfs_init(struct sti_hda *hda, struct drm_minor *minor)
>  
>  	drm_debugfs_create_files(hda_debugfs_files,
>  				 ARRAY_SIZE(hda_debugfs_files),
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  }
>  
>  /**
> diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
> index 8539fe1fedc4..3827ca9ced90 100644
> --- a/drivers/gpu/drm/sti/sti_hdmi.c
> +++ b/drivers/gpu/drm/sti/sti_hdmi.c
> @@ -743,7 +743,7 @@ static void hdmi_debugfs_init(struct sti_hdmi *hdmi, struct drm_minor *minor)
>  
>  	drm_debugfs_create_files(hdmi_debugfs_files,
>  				 ARRAY_SIZE(hdmi_debugfs_files),
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  }
>  
>  static void sti_hdmi_disable(struct drm_bridge *bridge)
> diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
> index 02b77279f6e4..3148e113e2d6 100644
> --- a/drivers/gpu/drm/sti/sti_hqvdp.c
> +++ b/drivers/gpu/drm/sti/sti_hqvdp.c
> @@ -650,7 +650,7 @@ static void hqvdp_debugfs_init(struct sti_hqvdp *hqvdp, struct drm_minor *minor)
>  
>  	drm_debugfs_create_files(hqvdp_debugfs_files,
>  				 ARRAY_SIZE(hqvdp_debugfs_files),
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  }
>  
>  /**
> diff --git a/drivers/gpu/drm/sti/sti_mixer.c b/drivers/gpu/drm/sti/sti_mixer.c
> index 7e5f14646625..d708fae682cd 100644
> --- a/drivers/gpu/drm/sti/sti_mixer.c
> +++ b/drivers/gpu/drm/sti/sti_mixer.c
> @@ -202,7 +202,7 @@ void sti_mixer_debugfs_init(struct sti_mixer *mixer, struct drm_minor *minor)
>  
>  	drm_debugfs_create_files(mixer_debugfs_files,
>  				 nb_files,
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  }
>  
>  void sti_mixer_set_background_status(struct sti_mixer *mixer, bool enable)
> diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c
> index 2499715a69b7..fefd04719315 100644
> --- a/drivers/gpu/drm/sti/sti_tvout.c
> +++ b/drivers/gpu/drm/sti/sti_tvout.c
> @@ -579,7 +579,7 @@ static void tvout_debugfs_init(struct sti_tvout *tvout, struct drm_minor *minor)
>  
>  	drm_debugfs_create_files(tvout_debugfs_files,
>  				 ARRAY_SIZE(tvout_debugfs_files),
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  }
>  
>  static void sti_tvout_encoder_dpms(struct drm_encoder *encoder, int mode)
> diff --git a/drivers/gpu/drm/sti/sti_vid.c b/drivers/gpu/drm/sti/sti_vid.c
> index 2d818397918d..e8aa6e608c69 100644
> --- a/drivers/gpu/drm/sti/sti_vid.c
> +++ b/drivers/gpu/drm/sti/sti_vid.c
> @@ -133,7 +133,7 @@ void vid_debugfs_init(struct sti_vid *vid, struct drm_minor *minor)
>  
>  	drm_debugfs_create_files(vid_debugfs_files,
>  				 ARRAY_SIZE(vid_debugfs_files),
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  }
>  
>  void sti_vid_commit(struct sti_vid *vid,
> diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
> index 6ca9f396e55b..4b7465464651 100644
> --- a/drivers/gpu/drm/tegra/drm.c
> +++ b/drivers/gpu/drm/tegra/drm.c
> @@ -876,7 +876,7 @@ static void tegra_debugfs_init(struct drm_minor *minor)
>  {
>  	drm_debugfs_create_files(tegra_debugfs_list,
>  				 ARRAY_SIZE(tegra_debugfs_list),
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  }
>  #endif
>  
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> index fe56beea3e93..5a54608d8c83 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> @@ -468,7 +468,7 @@ static void tilcdc_debugfs_init(struct drm_minor *minor)
>  
>  	drm_debugfs_create_files(tilcdc_debugfs_list,
>  				 ARRAY_SIZE(tilcdc_debugfs_list),
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  
>  	list_for_each_entry(mod, &module_list, list)
>  		if (mod->funcs->debugfs_init)
> diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c
> index e5b10e41554a..770b76701764 100644
> --- a/drivers/gpu/drm/tiny/arcpgu.c
> +++ b/drivers/gpu/drm/tiny/arcpgu.c
> @@ -357,7 +357,7 @@ static void arcpgu_debugfs_init(struct drm_minor *minor)
>  {
>  	drm_debugfs_create_files(arcpgu_debugfs_list,
>  				 ARRAY_SIZE(arcpgu_debugfs_list),
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  }
>  #endif
>  
> diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c
> index 4da66ef96783..85fae3ab85c6 100644
> --- a/drivers/gpu/drm/vc4/vc4_hvs.c
> +++ b/drivers/gpu/drm/vc4/vc4_hvs.c
> @@ -769,7 +769,7 @@ int vc4_hvs_debugfs_init(struct drm_minor *minor)
>  
>  	if (!vc4->is_vc5)
>  		debugfs_create_bool("hvs_load_tracker", S_IRUGO | S_IWUSR,
> -				    minor->debugfs_root,
> +				    minor->dev->debugfs_root,
>  				    &vc4->load_tracker_enabled);
>  
>  	drm_debugfs_add_file(drm, "hvs_dlists", vc4_hvs_debugfs_dlist, NULL);
> diff --git a/drivers/gpu/drm/virtio/virtgpu_debugfs.c b/drivers/gpu/drm/virtio/virtgpu_debugfs.c
> index 853dd9aa397e..f403d03149bc 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_debugfs.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_debugfs.c
> @@ -107,5 +107,5 @@ virtio_gpu_debugfs_init(struct drm_minor *minor)
>  {
>  	drm_debugfs_create_files(virtio_gpu_debugfs_list,
>  				 VIRTIO_GPU_DEBUGFS_ENTRIES,
> -				 minor->debugfs_root, minor);
> +				 minor->dev->debugfs_root, minor);
>  }
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> index 2588615a2a38..d5e70d7f9a54 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
> @@ -1409,7 +1409,7 @@ static void vmw_remove(struct pci_dev *pdev)
>  static void vmw_debugfs_resource_managers_init(struct vmw_private *vmw)
>  {
>  	struct drm_minor *minor = vmw->drm.primary;
> -	struct dentry *root = minor->debugfs_root;
> +	struct dentry *root = minor->dev->debugfs_root;
>  
>  	ttm_resource_manager_create_debugfs(ttm_manager_type(&vmw->bdev, TTM_PL_SYSTEM),
>  					    root, "system_ttm");
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
> index c0da89e16e6f..46ca03d78ad6 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
> @@ -267,7 +267,7 @@ void vmw_debugfs_gem_init(struct vmw_private *vdev)
>  {
>  #if defined(CONFIG_DEBUG_FS)
>  	struct drm_minor *minor = vdev->drm.primary;
> -	struct dentry *root = minor->debugfs_root;
> +	struct dentry *root = minor->dev->debugfs_root;
>  
>  	debugfs_create_file("vmwgfx_gem_info", 0444, root, vdev,
>  			    &vmw_debugfs_gem_info_fops);
> diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
> index e687ce27624e..3ddbeef8f5de 100644
> --- a/include/drm/drm_file.h
> +++ b/include/drm/drm_file.h
> @@ -77,8 +77,6 @@ struct drm_minor {
>  	int type;                       /* Control or render or accel */
>  	struct device *kdev;		/* Linux device */
>  	struct drm_device *dev;
> -
> -	struct dentry *debugfs_root;
>  };
>  
>  /**

-- 
Jani Nikula, Intel Open Source Graphics Center

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

end of thread, other threads:[~2023-04-06 12:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-31  9:07 [Intel-gfx] [PATCH 1/5] drm/debugfs: drop debugfs_init() for the render and accel node v2 Christian König
2023-03-31  9:07 ` [Intel-gfx] [PATCH 2/5] drm/debugfs: rework debugfs directory creation v3 Christian König
2023-03-31  9:07 ` [Intel-gfx] [PATCH 3/5] drm/debugfs: remove dev->debugfs_list and debugfs_mutex v2 Christian König
2023-03-31  9:07 ` [Intel-gfx] [PATCH 4/5] drm/debugfs: rework drm_debugfs_create_files implementation Christian König
2023-03-31  9:07 ` [Intel-gfx] [PATCH 5/5] drm/debugfs: remove debugfs_root pointer from minor Christian König
2023-04-06 12:30   ` Jani Nikula
2023-03-31 11:39 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/5] drm/debugfs: drop debugfs_init() for the render and accel node v2 Patchwork
2023-03-31 11:39 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-03-31 11:53 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).