All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] dri: cleanup debugfs error handling
@ 2021-10-08  9:17 ` Nirmoy Das
  0 siblings, 0 replies; 37+ messages in thread
From: Nirmoy Das @ 2021-10-08  9:17 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, Nirmoy Das, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter

Debugfs API returns encoded error instead of NULL.
This patch cleanups drm debugfs error handling to
properly set dri and its minor's root dentry to NULL.

Also do not error out if dri/minor debugfs directory
creation fails as a debugfs error is not a fatal error.

CC: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
CC: Maxime Ripard <mripard@kernel.org>
CC: Thomas Zimmermann <tzimmermann@suse.de>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
---
 drivers/gpu/drm/drm_debugfs.c  | 25 +++++++++++++++++++++++--
 drivers/gpu/drm/drm_drv.c      | 16 ++++++++++------
 drivers/gpu/drm/drm_internal.h |  7 +++----
 3 files changed, 36 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index b0a826489488..af275a0c09b4 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -180,6 +180,9 @@ void drm_debugfs_create_files(const struct drm_info_list *files, int count,
 	struct drm_info_node *tmp;
 	int i;

+	if (!minor->debugfs_root)
+		return;
+
 	for (i = 0; i < count; i++) {
 		u32 features = files[i].driver_features;

@@ -203,7 +206,7 @@ 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,
+void drm_debugfs_init(struct drm_minor *minor, int minor_id,
 		     struct dentry *root)
 {
 	struct drm_device *dev = minor->dev;
@@ -212,8 +215,16 @@ 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);
+
+	if (!root)
+		goto error;
+
 	minor->debugfs_root = debugfs_create_dir(name, root);

+	if (IS_ERR(minor->debugfs_root))
+		goto error;
+
+
 	drm_debugfs_create_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES,
 				 minor->debugfs_root, minor);

@@ -230,7 +241,11 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
 	if (dev->driver->debugfs_init)
 		dev->driver->debugfs_init(minor);

-	return 0;
+	return;
+
+error:
+	minor->debugfs_root = NULL;
+	return;
 }


@@ -241,6 +256,9 @@ int drm_debugfs_remove_files(const struct drm_info_list *files, int count,
 	struct drm_info_node *tmp;
 	int i;

+	if (!minor->debugfs_root)
+		return 0;
+
 	mutex_lock(&minor->debugfs_lock);
 	for (i = 0; i < count; i++) {
 		list_for_each_safe(pos, q, &minor->debugfs_list) {
@@ -261,6 +279,9 @@ static void drm_debugfs_remove_all_files(struct drm_minor *minor)
 {
 	struct drm_info_node *node, *tmp;

+	if (!minor->debugfs_root)
+		return;
+
 	mutex_lock(&minor->debugfs_lock);
 	list_for_each_entry_safe(node, tmp, &minor->debugfs_list, list) {
 		debugfs_remove(node->dent);
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 7a5097467ba5..fa57ec2d49bf 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -160,11 +160,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type)
 	if (!minor)
 		return 0;

-	ret = drm_debugfs_init(minor, minor->index, drm_debugfs_root);
-	if (ret) {
-		DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n");
-		goto err_debugfs;
-	}
+	drm_debugfs_init(minor, minor->index, drm_debugfs_root);

 	ret = device_add(minor->kdev);
 	if (ret)
@@ -1050,7 +1046,15 @@ static int __init drm_core_init(void)
 		goto error;
 	}

-	drm_debugfs_root = debugfs_create_dir("dri", NULL);
+	if (!debugfs_initialized()) {
+		drm_debugfs_root = NULL;
+	} else {
+		drm_debugfs_root = debugfs_create_dir("dri", NULL);
+		if (IS_ERR(drm_debugfs_root)) {
+			DRM_WARN("DRM: Failed to initialize /sys/kernel/debug/dri.\n");
+			drm_debugfs_root = NULL;
+		}
+	}

 	ret = register_chrdev(DRM_MAJOR, "drm", &drm_stub_fops);
 	if (ret < 0)
diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
index 17f3548c8ed2..e27a40166178 100644
--- a/drivers/gpu/drm/drm_internal.h
+++ b/drivers/gpu/drm/drm_internal.h
@@ -182,8 +182,8 @@ int drm_gem_dumb_destroy(struct drm_file *file, struct drm_device *dev,

 /* 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_init(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);
@@ -191,10 +191,9 @@ 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,
+static inline void drm_debugfs_init(struct drm_minor *minor, int minor_id,
 				   struct dentry *root)
 {
-	return 0;
 }

 static inline void drm_debugfs_cleanup(struct drm_minor *minor)
--
2.32.0


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

* [Intel-gfx] [PATCH 1/5] dri: cleanup debugfs error handling
@ 2021-10-08  9:17 ` Nirmoy Das
  0 siblings, 0 replies; 37+ messages in thread
From: Nirmoy Das @ 2021-10-08  9:17 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, Nirmoy Das, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter

Debugfs API returns encoded error instead of NULL.
This patch cleanups drm debugfs error handling to
properly set dri and its minor's root dentry to NULL.

Also do not error out if dri/minor debugfs directory
creation fails as a debugfs error is not a fatal error.

CC: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
CC: Maxime Ripard <mripard@kernel.org>
CC: Thomas Zimmermann <tzimmermann@suse.de>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
---
 drivers/gpu/drm/drm_debugfs.c  | 25 +++++++++++++++++++++++--
 drivers/gpu/drm/drm_drv.c      | 16 ++++++++++------
 drivers/gpu/drm/drm_internal.h |  7 +++----
 3 files changed, 36 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index b0a826489488..af275a0c09b4 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -180,6 +180,9 @@ void drm_debugfs_create_files(const struct drm_info_list *files, int count,
 	struct drm_info_node *tmp;
 	int i;

+	if (!minor->debugfs_root)
+		return;
+
 	for (i = 0; i < count; i++) {
 		u32 features = files[i].driver_features;

@@ -203,7 +206,7 @@ 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,
+void drm_debugfs_init(struct drm_minor *minor, int minor_id,
 		     struct dentry *root)
 {
 	struct drm_device *dev = minor->dev;
@@ -212,8 +215,16 @@ 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);
+
+	if (!root)
+		goto error;
+
 	minor->debugfs_root = debugfs_create_dir(name, root);

+	if (IS_ERR(minor->debugfs_root))
+		goto error;
+
+
 	drm_debugfs_create_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES,
 				 minor->debugfs_root, minor);

@@ -230,7 +241,11 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
 	if (dev->driver->debugfs_init)
 		dev->driver->debugfs_init(minor);

-	return 0;
+	return;
+
+error:
+	minor->debugfs_root = NULL;
+	return;
 }


@@ -241,6 +256,9 @@ int drm_debugfs_remove_files(const struct drm_info_list *files, int count,
 	struct drm_info_node *tmp;
 	int i;

+	if (!minor->debugfs_root)
+		return 0;
+
 	mutex_lock(&minor->debugfs_lock);
 	for (i = 0; i < count; i++) {
 		list_for_each_safe(pos, q, &minor->debugfs_list) {
@@ -261,6 +279,9 @@ static void drm_debugfs_remove_all_files(struct drm_minor *minor)
 {
 	struct drm_info_node *node, *tmp;

+	if (!minor->debugfs_root)
+		return;
+
 	mutex_lock(&minor->debugfs_lock);
 	list_for_each_entry_safe(node, tmp, &minor->debugfs_list, list) {
 		debugfs_remove(node->dent);
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 7a5097467ba5..fa57ec2d49bf 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -160,11 +160,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type)
 	if (!minor)
 		return 0;

-	ret = drm_debugfs_init(minor, minor->index, drm_debugfs_root);
-	if (ret) {
-		DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n");
-		goto err_debugfs;
-	}
+	drm_debugfs_init(minor, minor->index, drm_debugfs_root);

 	ret = device_add(minor->kdev);
 	if (ret)
@@ -1050,7 +1046,15 @@ static int __init drm_core_init(void)
 		goto error;
 	}

-	drm_debugfs_root = debugfs_create_dir("dri", NULL);
+	if (!debugfs_initialized()) {
+		drm_debugfs_root = NULL;
+	} else {
+		drm_debugfs_root = debugfs_create_dir("dri", NULL);
+		if (IS_ERR(drm_debugfs_root)) {
+			DRM_WARN("DRM: Failed to initialize /sys/kernel/debug/dri.\n");
+			drm_debugfs_root = NULL;
+		}
+	}

 	ret = register_chrdev(DRM_MAJOR, "drm", &drm_stub_fops);
 	if (ret < 0)
diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
index 17f3548c8ed2..e27a40166178 100644
--- a/drivers/gpu/drm/drm_internal.h
+++ b/drivers/gpu/drm/drm_internal.h
@@ -182,8 +182,8 @@ int drm_gem_dumb_destroy(struct drm_file *file, struct drm_device *dev,

 /* 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_init(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);
@@ -191,10 +191,9 @@ 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,
+static inline void drm_debugfs_init(struct drm_minor *minor, int minor_id,
 				   struct dentry *root)
 {
-	return 0;
 }

 static inline void drm_debugfs_cleanup(struct drm_minor *minor)
--
2.32.0


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

* [PATCH 2/5] drm/i915: check dri root before debugfs init
  2021-10-08  9:17 ` [Intel-gfx] " Nirmoy Das
@ 2021-10-08  9:17   ` Nirmoy Das
  -1 siblings, 0 replies; 37+ messages in thread
From: Nirmoy Das @ 2021-10-08  9:17 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, Nirmoy Das, Zhenyu Wang, Zhi Wang, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, David Airlie, Daniel Vetter

Return early if dri minor root dentry is NULL.

CC: Zhenyu Wang <zhenyuw@linux.intel.com>
CC: Zhi Wang <zhi.a.wang@intel.com>
CC: Jani Nikula <jani.nikula@linux.intel.com>
CC: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
CC: Rodrigo Vivi <rodrigo.vivi@intel.com>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
---
 drivers/gpu/drm/i915/gvt/debugfs.c  | 3 +++
 drivers/gpu/drm/i915/i915_debugfs.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/i915/gvt/debugfs.c b/drivers/gpu/drm/i915/gvt/debugfs.c
index 9f1c209d9251..2d47acaa03ee 100644
--- a/drivers/gpu/drm/i915/gvt/debugfs.c
+++ b/drivers/gpu/drm/i915/gvt/debugfs.c
@@ -187,6 +187,9 @@ void intel_gvt_debugfs_init(struct intel_gvt *gvt)
 {
 	struct drm_minor *minor = gvt->gt->i915->drm.primary;

+	if (!minor->debugfs_root)
+		return;
+
 	gvt->debugfs_root = debugfs_create_dir("gvt", minor->debugfs_root);

 	debugfs_create_ulong("num_tracked_mmio", 0444, gvt->debugfs_root,
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 44969f5dde50..d572b686edeb 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1012,6 +1012,9 @@ void i915_debugfs_register(struct drm_i915_private *dev_priv)
 	struct drm_minor *minor = dev_priv->drm.primary;
 	int i;

+	if (!minor->debugfs_root)
+		return;
+
 	i915_debugfs_params(dev_priv);

 	debugfs_create_file("i915_forcewake_user", S_IRUSR, minor->debugfs_root,
--
2.32.0


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

* [Intel-gfx] [PATCH 2/5] drm/i915: check dri root before debugfs init
@ 2021-10-08  9:17   ` Nirmoy Das
  0 siblings, 0 replies; 37+ messages in thread
From: Nirmoy Das @ 2021-10-08  9:17 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, Nirmoy Das, Zhenyu Wang, Zhi Wang, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, David Airlie, Daniel Vetter

Return early if dri minor root dentry is NULL.

CC: Zhenyu Wang <zhenyuw@linux.intel.com>
CC: Zhi Wang <zhi.a.wang@intel.com>
CC: Jani Nikula <jani.nikula@linux.intel.com>
CC: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
CC: Rodrigo Vivi <rodrigo.vivi@intel.com>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
---
 drivers/gpu/drm/i915/gvt/debugfs.c  | 3 +++
 drivers/gpu/drm/i915/i915_debugfs.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/i915/gvt/debugfs.c b/drivers/gpu/drm/i915/gvt/debugfs.c
index 9f1c209d9251..2d47acaa03ee 100644
--- a/drivers/gpu/drm/i915/gvt/debugfs.c
+++ b/drivers/gpu/drm/i915/gvt/debugfs.c
@@ -187,6 +187,9 @@ void intel_gvt_debugfs_init(struct intel_gvt *gvt)
 {
 	struct drm_minor *minor = gvt->gt->i915->drm.primary;

+	if (!minor->debugfs_root)
+		return;
+
 	gvt->debugfs_root = debugfs_create_dir("gvt", minor->debugfs_root);

 	debugfs_create_ulong("num_tracked_mmio", 0444, gvt->debugfs_root,
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 44969f5dde50..d572b686edeb 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1012,6 +1012,9 @@ void i915_debugfs_register(struct drm_i915_private *dev_priv)
 	struct drm_minor *minor = dev_priv->drm.primary;
 	int i;

+	if (!minor->debugfs_root)
+		return;
+
 	i915_debugfs_params(dev_priv);

 	debugfs_create_file("i915_forcewake_user", S_IRUSR, minor->debugfs_root,
--
2.32.0


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

* [PATCH 3/5] drm/radeon: check dri root before debugfs init
  2021-10-08  9:17 ` [Intel-gfx] " Nirmoy Das
@ 2021-10-08  9:17   ` Nirmoy Das
  -1 siblings, 0 replies; 37+ messages in thread
From: Nirmoy Das @ 2021-10-08  9:17 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, Nirmoy Das, Alex Deucher, Christian König, Pan, Xinhui

Return early if dri minor root dentry is NULL.

CC: Alex Deucher <alexander.deucher@amd.com>
CC: "Christian König" <christian.koenig@amd.com>
CC: "Pan, Xinhui" <Xinhui.Pan@amd.com>

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
---
 drivers/gpu/drm/radeon/r100.c          | 9 +++++++++
 drivers/gpu/drm/radeon/r300.c          | 3 +++
 drivers/gpu/drm/radeon/r420.c          | 3 +++
 drivers/gpu/drm/radeon/r600.c          | 3 +++
 drivers/gpu/drm/radeon/radeon_dp_mst.c | 3 +++
 drivers/gpu/drm/radeon/radeon_fence.c  | 3 +++
 drivers/gpu/drm/radeon/radeon_gem.c    | 3 +++
 drivers/gpu/drm/radeon/radeon_ib.c     | 3 +++
 drivers/gpu/drm/radeon/radeon_pm.c     | 5 ++++-
 drivers/gpu/drm/radeon/radeon_ring.c   | 3 +++
 drivers/gpu/drm/radeon/radeon_ttm.c    | 3 +++
 drivers/gpu/drm/radeon/rs400.c         | 3 +++
 drivers/gpu/drm/radeon/rv515.c         | 3 +++
 13 files changed, 46 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 2dd85ba1faa2..ae6c95b34013 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -3059,6 +3059,9 @@ void  r100_debugfs_rbbm_init(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	debugfs_create_file("r100_rbbm_info", 0444, root, rdev,
 			    &r100_debugfs_rbbm_info_fops);
 #endif
@@ -3069,6 +3072,9 @@ void r100_debugfs_cp_init(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	debugfs_create_file("r100_cp_ring_info", 0444, root, rdev,
 			    &r100_debugfs_cp_ring_info_fops);
 	debugfs_create_file("r100_cp_csq_fifo", 0444, root, rdev,
@@ -3081,6 +3087,9 @@ void  r100_debugfs_mc_info_init(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	debugfs_create_file("r100_mc_info", 0444, root, rdev,
 			    &r100_debugfs_mc_info_fops);
 #endif
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index 621ff174dff3..b22969e2394f 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -618,6 +618,9 @@ 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;

+	if (!root)
+		return;
+
 	debugfs_create_file("rv370_pcie_gart_info", 0444, root, rdev,
 			    &rv370_debugfs_pcie_gart_info_fops);
 #endif
diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c
index 7e6320e8c6a0..cdb4ac3e346b 100644
--- a/drivers/gpu/drm/radeon/r420.c
+++ b/drivers/gpu/drm/radeon/r420.c
@@ -494,6 +494,9 @@ void r420_debugfs_pipes_info_init(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	debugfs_create_file("r420_pipes_info", 0444, root, rdev,
 			    &r420_debugfs_pipes_info_fops);
 #endif
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index ca3fcae2adb5..d8f525cf0c3b 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -4360,6 +4360,9 @@ static void r600_debugfs_mc_info_init(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	debugfs_create_file("r600_mc_info", 0444, root, rdev,
 			    &r600_debugfs_mc_info_fops);

diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c b/drivers/gpu/drm/radeon/radeon_dp_mst.c
index ec867fa880a4..cf06da89bb7c 100644
--- a/drivers/gpu/drm/radeon/radeon_dp_mst.c
+++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c
@@ -771,6 +771,9 @@ void radeon_mst_debugfs_init(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	debugfs_create_file("radeon_mst_info", 0444, root, rdev,
 			    &radeon_debugfs_mst_info_fops);

diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
index 73e3117420bf..11f30349de46 100644
--- a/drivers/gpu/drm/radeon/radeon_fence.c
+++ b/drivers/gpu/drm/radeon/radeon_fence.c
@@ -1006,6 +1006,9 @@ void radeon_debugfs_fence_init(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	debugfs_create_file("radeon_gpu_reset", 0444, root, rdev,
 			    &radeon_debugfs_gpu_reset_fops);
 	debugfs_create_file("radeon_fence_info", 0444, root, rdev,
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
index 458f92a70887..e6df1451af37 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -890,6 +890,9 @@ void radeon_gem_debugfs_init(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	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 62b116727b4f..28316eb4fd49 100644
--- a/drivers/gpu/drm/radeon/radeon_ib.c
+++ b/drivers/gpu/drm/radeon/radeon_ib.c
@@ -311,6 +311,9 @@ static void radeon_debugfs_sa_init(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	debugfs_create_file("radeon_sa_info", 0444, root, rdev,
 			    &radeon_debugfs_sa_info_fops);
 #endif
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index c67b6ddb29a4..c09e574d04f0 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -1958,6 +1958,9 @@ static void radeon_debugfs_pm_init(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	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..31a5b1ebf7c9 100644
--- a/drivers/gpu/drm/radeon/radeon_ring.c
+++ b/drivers/gpu/drm/radeon/radeon_ring.c
@@ -550,6 +550,9 @@ static void radeon_debugfs_ring_init(struct radeon_device *rdev, struct radeon_r
 	const char *ring_name = radeon_debugfs_ring_idx_to_name(ring->idx);
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	if (ring_name)
 		debugfs_create_file(ring_name, 0444, root, ring,
 				    &radeon_debugfs_ring_info_fops);
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 11b21d605584..2e18ec93768d 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -942,6 +942,9 @@ static void radeon_ttm_debugfs_init(struct radeon_device *rdev)
 	struct drm_minor *minor = rdev->ddev->primary;
 	struct dentry *root = minor->debugfs_root;

+	if (!root)
+		return;
+
 	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..b41a903a29c3 100644
--- a/drivers/gpu/drm/radeon/rs400.c
+++ b/drivers/gpu/drm/radeon/rs400.c
@@ -380,6 +380,9 @@ 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;

+	if (!root)
+		return;
+
 	debugfs_create_file("rs400_gart_info", 0444, root, rdev,
 			    &rs400_debugfs_gart_info_fops);
 #endif
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
index 63fb06e8e2d7..f39b6ab554f2 100644
--- a/drivers/gpu/drm/radeon/rv515.c
+++ b/drivers/gpu/drm/radeon/rv515.c
@@ -257,6 +257,9 @@ void rv515_debugfs(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	debugfs_create_file("rv515_pipes_info", 0444, root, rdev,
 			    &rv515_debugfs_pipes_info_fops);
 	debugfs_create_file("rv515_ga_info", 0444, root, rdev,
--
2.32.0


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

* [Intel-gfx] [PATCH 3/5] drm/radeon: check dri root before debugfs init
@ 2021-10-08  9:17   ` Nirmoy Das
  0 siblings, 0 replies; 37+ messages in thread
From: Nirmoy Das @ 2021-10-08  9:17 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, Nirmoy Das, Alex Deucher, Christian König, Pan, Xinhui

Return early if dri minor root dentry is NULL.

CC: Alex Deucher <alexander.deucher@amd.com>
CC: "Christian König" <christian.koenig@amd.com>
CC: "Pan, Xinhui" <Xinhui.Pan@amd.com>

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
---
 drivers/gpu/drm/radeon/r100.c          | 9 +++++++++
 drivers/gpu/drm/radeon/r300.c          | 3 +++
 drivers/gpu/drm/radeon/r420.c          | 3 +++
 drivers/gpu/drm/radeon/r600.c          | 3 +++
 drivers/gpu/drm/radeon/radeon_dp_mst.c | 3 +++
 drivers/gpu/drm/radeon/radeon_fence.c  | 3 +++
 drivers/gpu/drm/radeon/radeon_gem.c    | 3 +++
 drivers/gpu/drm/radeon/radeon_ib.c     | 3 +++
 drivers/gpu/drm/radeon/radeon_pm.c     | 5 ++++-
 drivers/gpu/drm/radeon/radeon_ring.c   | 3 +++
 drivers/gpu/drm/radeon/radeon_ttm.c    | 3 +++
 drivers/gpu/drm/radeon/rs400.c         | 3 +++
 drivers/gpu/drm/radeon/rv515.c         | 3 +++
 13 files changed, 46 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 2dd85ba1faa2..ae6c95b34013 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -3059,6 +3059,9 @@ void  r100_debugfs_rbbm_init(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	debugfs_create_file("r100_rbbm_info", 0444, root, rdev,
 			    &r100_debugfs_rbbm_info_fops);
 #endif
@@ -3069,6 +3072,9 @@ void r100_debugfs_cp_init(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	debugfs_create_file("r100_cp_ring_info", 0444, root, rdev,
 			    &r100_debugfs_cp_ring_info_fops);
 	debugfs_create_file("r100_cp_csq_fifo", 0444, root, rdev,
@@ -3081,6 +3087,9 @@ void  r100_debugfs_mc_info_init(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	debugfs_create_file("r100_mc_info", 0444, root, rdev,
 			    &r100_debugfs_mc_info_fops);
 #endif
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index 621ff174dff3..b22969e2394f 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -618,6 +618,9 @@ 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;

+	if (!root)
+		return;
+
 	debugfs_create_file("rv370_pcie_gart_info", 0444, root, rdev,
 			    &rv370_debugfs_pcie_gart_info_fops);
 #endif
diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c
index 7e6320e8c6a0..cdb4ac3e346b 100644
--- a/drivers/gpu/drm/radeon/r420.c
+++ b/drivers/gpu/drm/radeon/r420.c
@@ -494,6 +494,9 @@ void r420_debugfs_pipes_info_init(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	debugfs_create_file("r420_pipes_info", 0444, root, rdev,
 			    &r420_debugfs_pipes_info_fops);
 #endif
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index ca3fcae2adb5..d8f525cf0c3b 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -4360,6 +4360,9 @@ static void r600_debugfs_mc_info_init(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	debugfs_create_file("r600_mc_info", 0444, root, rdev,
 			    &r600_debugfs_mc_info_fops);

diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c b/drivers/gpu/drm/radeon/radeon_dp_mst.c
index ec867fa880a4..cf06da89bb7c 100644
--- a/drivers/gpu/drm/radeon/radeon_dp_mst.c
+++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c
@@ -771,6 +771,9 @@ void radeon_mst_debugfs_init(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	debugfs_create_file("radeon_mst_info", 0444, root, rdev,
 			    &radeon_debugfs_mst_info_fops);

diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
index 73e3117420bf..11f30349de46 100644
--- a/drivers/gpu/drm/radeon/radeon_fence.c
+++ b/drivers/gpu/drm/radeon/radeon_fence.c
@@ -1006,6 +1006,9 @@ void radeon_debugfs_fence_init(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	debugfs_create_file("radeon_gpu_reset", 0444, root, rdev,
 			    &radeon_debugfs_gpu_reset_fops);
 	debugfs_create_file("radeon_fence_info", 0444, root, rdev,
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
index 458f92a70887..e6df1451af37 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -890,6 +890,9 @@ void radeon_gem_debugfs_init(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	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 62b116727b4f..28316eb4fd49 100644
--- a/drivers/gpu/drm/radeon/radeon_ib.c
+++ b/drivers/gpu/drm/radeon/radeon_ib.c
@@ -311,6 +311,9 @@ static void radeon_debugfs_sa_init(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	debugfs_create_file("radeon_sa_info", 0444, root, rdev,
 			    &radeon_debugfs_sa_info_fops);
 #endif
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index c67b6ddb29a4..c09e574d04f0 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -1958,6 +1958,9 @@ static void radeon_debugfs_pm_init(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	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..31a5b1ebf7c9 100644
--- a/drivers/gpu/drm/radeon/radeon_ring.c
+++ b/drivers/gpu/drm/radeon/radeon_ring.c
@@ -550,6 +550,9 @@ static void radeon_debugfs_ring_init(struct radeon_device *rdev, struct radeon_r
 	const char *ring_name = radeon_debugfs_ring_idx_to_name(ring->idx);
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	if (ring_name)
 		debugfs_create_file(ring_name, 0444, root, ring,
 				    &radeon_debugfs_ring_info_fops);
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 11b21d605584..2e18ec93768d 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -942,6 +942,9 @@ static void radeon_ttm_debugfs_init(struct radeon_device *rdev)
 	struct drm_minor *minor = rdev->ddev->primary;
 	struct dentry *root = minor->debugfs_root;

+	if (!root)
+		return;
+
 	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..b41a903a29c3 100644
--- a/drivers/gpu/drm/radeon/rs400.c
+++ b/drivers/gpu/drm/radeon/rs400.c
@@ -380,6 +380,9 @@ 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;

+	if (!root)
+		return;
+
 	debugfs_create_file("rs400_gart_info", 0444, root, rdev,
 			    &rs400_debugfs_gart_info_fops);
 #endif
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
index 63fb06e8e2d7..f39b6ab554f2 100644
--- a/drivers/gpu/drm/radeon/rv515.c
+++ b/drivers/gpu/drm/radeon/rv515.c
@@ -257,6 +257,9 @@ void rv515_debugfs(struct radeon_device *rdev)
 #if defined(CONFIG_DEBUG_FS)
 	struct dentry *root = rdev->ddev->primary->debugfs_root;

+	if (!root)
+		return;
+
 	debugfs_create_file("rv515_pipes_info", 0444, root, rdev,
 			    &rv515_debugfs_pipes_info_fops);
 	debugfs_create_file("rv515_ga_info", 0444, root, rdev,
--
2.32.0


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

* [PATCH 4/5] drm/armada: check dri/crtc root before debugfs init
  2021-10-08  9:17 ` [Intel-gfx] " Nirmoy Das
@ 2021-10-08  9:17   ` Nirmoy Das
  -1 siblings, 0 replies; 37+ messages in thread
From: Nirmoy Das @ 2021-10-08  9:17 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, Nirmoy Das, Russell King, David Airlie, Daniel Vetter

Return early if dri minor root dentry is NULL.

CC: Russell King <linux@armlinux.org.uk>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
---
 drivers/gpu/drm/armada/armada_debugfs.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/armada/armada_debugfs.c b/drivers/gpu/drm/armada/armada_debugfs.c
index 29f4b52e3c8d..b40003fe4a89 100644
--- a/drivers/gpu/drm/armada/armada_debugfs.c
+++ b/drivers/gpu/drm/armada/armada_debugfs.c
@@ -93,6 +93,9 @@ static const struct file_operations armada_debugfs_crtc_reg_fops = {

 void armada_drm_crtc_debugfs_init(struct armada_crtc *dcrtc)
 {
+	if (!dcrtc->crtc.debugfs_entry)
+		return;
+
 	debugfs_create_file("armada-regs", 0600, dcrtc->crtc.debugfs_entry,
 			    dcrtc, &armada_debugfs_crtc_reg_fops);
 }
@@ -104,6 +107,9 @@ static struct drm_info_list armada_debugfs_list[] = {

 int armada_drm_debugfs_init(struct drm_minor *minor)
 {
+	if (!minor->debugfs_root)
+		return;
+
 	drm_debugfs_create_files(armada_debugfs_list, ARMADA_DEBUGFS_ENTRIES,
 				 minor->debugfs_root, minor);

--
2.32.0


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

* [Intel-gfx] [PATCH 4/5] drm/armada: check dri/crtc root before debugfs init
@ 2021-10-08  9:17   ` Nirmoy Das
  0 siblings, 0 replies; 37+ messages in thread
From: Nirmoy Das @ 2021-10-08  9:17 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, Nirmoy Das, Russell King, David Airlie, Daniel Vetter

Return early if dri minor root dentry is NULL.

CC: Russell King <linux@armlinux.org.uk>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
---
 drivers/gpu/drm/armada/armada_debugfs.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/armada/armada_debugfs.c b/drivers/gpu/drm/armada/armada_debugfs.c
index 29f4b52e3c8d..b40003fe4a89 100644
--- a/drivers/gpu/drm/armada/armada_debugfs.c
+++ b/drivers/gpu/drm/armada/armada_debugfs.c
@@ -93,6 +93,9 @@ static const struct file_operations armada_debugfs_crtc_reg_fops = {

 void armada_drm_crtc_debugfs_init(struct armada_crtc *dcrtc)
 {
+	if (!dcrtc->crtc.debugfs_entry)
+		return;
+
 	debugfs_create_file("armada-regs", 0600, dcrtc->crtc.debugfs_entry,
 			    dcrtc, &armada_debugfs_crtc_reg_fops);
 }
@@ -104,6 +107,9 @@ static struct drm_info_list armada_debugfs_list[] = {

 int armada_drm_debugfs_init(struct drm_minor *minor)
 {
+	if (!minor->debugfs_root)
+		return;
+
 	drm_debugfs_create_files(armada_debugfs_list, ARMADA_DEBUGFS_ENTRIES,
 				 minor->debugfs_root, minor);

--
2.32.0


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

* [PATCH 5/5] drm/tegra: check root dentry before debugfs init
  2021-10-08  9:17 ` [Intel-gfx] " Nirmoy Das
@ 2021-10-08  9:17   ` Nirmoy Das
  -1 siblings, 0 replies; 37+ messages in thread
From: Nirmoy Das @ 2021-10-08  9:17 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, Nirmoy Das, Thierry Reding, David Airlie,
	Daniel Vetter, Jonathan Hunter

Return early if crtc or connector's debugfs root dentries are NULL.

CC: Thierry Reding <thierry.reding@gmail.com>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>
CC: Jonathan Hunter <jonathanh@nvidia.com>

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
---
 drivers/gpu/drm/tegra/dc.c   | 5 +++++
 drivers/gpu/drm/tegra/dsi.c  | 4 ++++
 drivers/gpu/drm/tegra/hdmi.c | 5 +++++
 drivers/gpu/drm/tegra/sor.c  | 4 ++++
 4 files changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 16c7aabb94d3..87eeda68d231 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -1623,6 +1623,11 @@ static int tegra_dc_late_register(struct drm_crtc *crtc)
 	struct dentry *root;
 	struct tegra_dc *dc = to_tegra_dc(crtc);

+	if (!crtc->debugfs_entry) {
+		dc->debugfs_files = NULL;
+		return 0;
+	}
+
 #ifdef CONFIG_DEBUG_FS
 	root = crtc->debugfs_entry;
 #else
diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c
index f46d377f0c30..f0263165e261 100644
--- a/drivers/gpu/drm/tegra/dsi.c
+++ b/drivers/gpu/drm/tegra/dsi.c
@@ -236,6 +236,10 @@ static int tegra_dsi_late_register(struct drm_connector *connector)
 	struct dentry *root = connector->debugfs_entry;
 	struct tegra_dsi *dsi = to_dsi(output);

+	if (!root) {
+		dsi->debugfs_files = NULL;
+		return 0;
+	}
 	dsi->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files),
 				     GFP_KERNEL);
 	if (!dsi->debugfs_files)
diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
index e5d2a4026028..400319db0afc 100644
--- a/drivers/gpu/drm/tegra/hdmi.c
+++ b/drivers/gpu/drm/tegra/hdmi.c
@@ -1065,6 +1065,11 @@ static int tegra_hdmi_late_register(struct drm_connector *connector)
 	struct dentry *root = connector->debugfs_entry;
 	struct tegra_hdmi *hdmi = to_hdmi(output);

+	if (!root) {
+		hdmi->debugfs_files = NULL;
+		return 0;
+	}
+
 	hdmi->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files),
 				      GFP_KERNEL);
 	if (!hdmi->debugfs_files)
diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index 0ea320c1092b..a8a3b0a587d9 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -1687,6 +1687,10 @@ static int tegra_sor_late_register(struct drm_connector *connector)
 	struct dentry *root = connector->debugfs_entry;
 	struct tegra_sor *sor = to_sor(output);

+	if (!root) {
+		sor->debugfs_files = NULL;
+		return 0;
+	}
 	sor->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files),
 				     GFP_KERNEL);
 	if (!sor->debugfs_files)
--
2.32.0


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

* [Intel-gfx] [PATCH 5/5] drm/tegra: check root dentry before debugfs init
@ 2021-10-08  9:17   ` Nirmoy Das
  0 siblings, 0 replies; 37+ messages in thread
From: Nirmoy Das @ 2021-10-08  9:17 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, Nirmoy Das, Thierry Reding, David Airlie,
	Daniel Vetter, Jonathan Hunter

Return early if crtc or connector's debugfs root dentries are NULL.

CC: Thierry Reding <thierry.reding@gmail.com>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>
CC: Jonathan Hunter <jonathanh@nvidia.com>

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
---
 drivers/gpu/drm/tegra/dc.c   | 5 +++++
 drivers/gpu/drm/tegra/dsi.c  | 4 ++++
 drivers/gpu/drm/tegra/hdmi.c | 5 +++++
 drivers/gpu/drm/tegra/sor.c  | 4 ++++
 4 files changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 16c7aabb94d3..87eeda68d231 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -1623,6 +1623,11 @@ static int tegra_dc_late_register(struct drm_crtc *crtc)
 	struct dentry *root;
 	struct tegra_dc *dc = to_tegra_dc(crtc);

+	if (!crtc->debugfs_entry) {
+		dc->debugfs_files = NULL;
+		return 0;
+	}
+
 #ifdef CONFIG_DEBUG_FS
 	root = crtc->debugfs_entry;
 #else
diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c
index f46d377f0c30..f0263165e261 100644
--- a/drivers/gpu/drm/tegra/dsi.c
+++ b/drivers/gpu/drm/tegra/dsi.c
@@ -236,6 +236,10 @@ static int tegra_dsi_late_register(struct drm_connector *connector)
 	struct dentry *root = connector->debugfs_entry;
 	struct tegra_dsi *dsi = to_dsi(output);

+	if (!root) {
+		dsi->debugfs_files = NULL;
+		return 0;
+	}
 	dsi->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files),
 				     GFP_KERNEL);
 	if (!dsi->debugfs_files)
diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
index e5d2a4026028..400319db0afc 100644
--- a/drivers/gpu/drm/tegra/hdmi.c
+++ b/drivers/gpu/drm/tegra/hdmi.c
@@ -1065,6 +1065,11 @@ static int tegra_hdmi_late_register(struct drm_connector *connector)
 	struct dentry *root = connector->debugfs_entry;
 	struct tegra_hdmi *hdmi = to_hdmi(output);

+	if (!root) {
+		hdmi->debugfs_files = NULL;
+		return 0;
+	}
+
 	hdmi->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files),
 				      GFP_KERNEL);
 	if (!hdmi->debugfs_files)
diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index 0ea320c1092b..a8a3b0a587d9 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -1687,6 +1687,10 @@ static int tegra_sor_late_register(struct drm_connector *connector)
 	struct dentry *root = connector->debugfs_entry;
 	struct tegra_sor *sor = to_sor(output);

+	if (!root) {
+		sor->debugfs_files = NULL;
+		return 0;
+	}
 	sor->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files),
 				     GFP_KERNEL);
 	if (!sor->debugfs_files)
--
2.32.0


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

* Re: [PATCH 1/5] dri: cleanup debugfs error handling
  2021-10-08  9:17 ` [Intel-gfx] " Nirmoy Das
@ 2021-10-08  9:35   ` Thomas Zimmermann
  -1 siblings, 0 replies; 37+ messages in thread
From: Thomas Zimmermann @ 2021-10-08  9:35 UTC (permalink / raw)
  To: Nirmoy Das, dri-devel
  Cc: intel-gfx, Maarten Lankhorst, Maxime Ripard, David Airlie, Daniel Vetter


[-- Attachment #1.1: Type: text/plain, Size: 6145 bytes --]

Hi

Am 08.10.21 um 11:17 schrieb Nirmoy Das:
> Debugfs API returns encoded error instead of NULL.
> This patch cleanups drm debugfs error handling to
> properly set dri and its minor's root dentry to NULL.
> 
> Also do not error out if dri/minor debugfs directory
> creation fails as a debugfs error is not a fatal error.
> 
> CC: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> CC: Maxime Ripard <mripard@kernel.org>
> CC: Thomas Zimmermann <tzimmermann@suse.de>
> CC: David Airlie <airlied@linux.ie>
> CC: Daniel Vetter <daniel@ffwll.ch>
> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
> ---
>   drivers/gpu/drm/drm_debugfs.c  | 25 +++++++++++++++++++++++--
>   drivers/gpu/drm/drm_drv.c      | 16 ++++++++++------
>   drivers/gpu/drm/drm_internal.h |  7 +++----
>   3 files changed, 36 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
> index b0a826489488..af275a0c09b4 100644
> --- a/drivers/gpu/drm/drm_debugfs.c
> +++ b/drivers/gpu/drm/drm_debugfs.c
> @@ -180,6 +180,9 @@ void drm_debugfs_create_files(const struct drm_info_list *files, int count,
>   	struct drm_info_node *tmp;
>   	int i;
> 
> +	if (!minor->debugfs_root)
> +		return;
> +
>   	for (i = 0; i < count; i++) {
>   		u32 features = files[i].driver_features;
> 
> @@ -203,7 +206,7 @@ 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,
> +void drm_debugfs_init(struct drm_minor *minor, int minor_id,
>   		     struct dentry *root)
>   {
>   	struct drm_device *dev = minor->dev;
> @@ -212,8 +215,16 @@ 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);
> +
> +	if (!root)
> +		goto error;
> +
>   	minor->debugfs_root = debugfs_create_dir(name, root);
> 
> +	if (IS_ERR(minor->debugfs_root))
> +		goto error;
> +
> +
>   	drm_debugfs_create_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES,
>   				 minor->debugfs_root, minor);
> 
> @@ -230,7 +241,11 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
>   	if (dev->driver->debugfs_init)
>   		dev->driver->debugfs_init(minor);
> 
> -	return 0;
> +	return;
> +
> +error:
> +	minor->debugfs_root = NULL;
> +	return;
>   }
> 
> 
> @@ -241,6 +256,9 @@ int drm_debugfs_remove_files(const struct drm_info_list *files, int count,
>   	struct drm_info_node *tmp;
>   	int i;
> 
> +	if (!minor->debugfs_root)
> +		return 0;
> +
>   	mutex_lock(&minor->debugfs_lock);
>   	for (i = 0; i < count; i++) {
>   		list_for_each_safe(pos, q, &minor->debugfs_list) {
> @@ -261,6 +279,9 @@ static void drm_debugfs_remove_all_files(struct drm_minor *minor)
>   {
>   	struct drm_info_node *node, *tmp;
> 
> +	if (!minor->debugfs_root)
> +		return;
> +
>   	mutex_lock(&minor->debugfs_lock);
>   	list_for_each_entry_safe(node, tmp, &minor->debugfs_list, list) {
>   		debugfs_remove(node->dent);
> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> index 7a5097467ba5..fa57ec2d49bf 100644
> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c
> @@ -160,11 +160,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type)
>   	if (!minor)
>   		return 0;
> 
> -	ret = drm_debugfs_init(minor, minor->index, drm_debugfs_root);
> -	if (ret) {
> -		DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n");

Rather than deleting the error message, return an error code from 
drm_debugfs_init() and print it here. I'd change DRM_ERROR() to 
drm_dbg_core(NULL, ...).


> -		goto err_debugfs;
> -	}
> +	drm_debugfs_init(minor, minor->index, drm_debugfs_root);
> 
>   	ret = device_add(minor->kdev);
>   	if (ret)
> @@ -1050,7 +1046,15 @@ static int __init drm_core_init(void)
>   		goto error;
>   	}
> 
> -	drm_debugfs_root = debugfs_create_dir("dri", NULL);
> +	if (!debugfs_initialized()) {
> +		drm_debugfs_root = NULL;
> +	} else {
> +		drm_debugfs_root = debugfs_create_dir("dri", NULL);
> +		if (IS_ERR(drm_debugfs_root)) {
> +			DRM_WARN("DRM: Failed to initialize /sys/kernel/debug/dri.\n");

This should also print the error code. I'd also change the call to 
drm_dbg_core(). The message should say 'failed to create', so it's 
differnt from the other one.

Best regards
Thomas

> +			drm_debugfs_root = NULL;
> +		}
> +	}
> 
>   	ret = register_chrdev(DRM_MAJOR, "drm", &drm_stub_fops);
>   	if (ret < 0)
> diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
> index 17f3548c8ed2..e27a40166178 100644
> --- a/drivers/gpu/drm/drm_internal.h
> +++ b/drivers/gpu/drm/drm_internal.h
> @@ -182,8 +182,8 @@ int drm_gem_dumb_destroy(struct drm_file *file, struct drm_device *dev,
> 
>   /* 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_init(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);
> @@ -191,10 +191,9 @@ 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,
> +static inline void drm_debugfs_init(struct drm_minor *minor, int minor_id,
>   				   struct dentry *root)
>   {
> -	return 0;
>   }
> 
>   static inline void drm_debugfs_cleanup(struct drm_minor *minor)
> --
> 2.32.0
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

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

* Re: [Intel-gfx] [PATCH 1/5] dri: cleanup debugfs error handling
@ 2021-10-08  9:35   ` Thomas Zimmermann
  0 siblings, 0 replies; 37+ messages in thread
From: Thomas Zimmermann @ 2021-10-08  9:35 UTC (permalink / raw)
  To: Nirmoy Das, dri-devel
  Cc: intel-gfx, Maarten Lankhorst, Maxime Ripard, David Airlie, Daniel Vetter


[-- Attachment #1.1: Type: text/plain, Size: 6145 bytes --]

Hi

Am 08.10.21 um 11:17 schrieb Nirmoy Das:
> Debugfs API returns encoded error instead of NULL.
> This patch cleanups drm debugfs error handling to
> properly set dri and its minor's root dentry to NULL.
> 
> Also do not error out if dri/minor debugfs directory
> creation fails as a debugfs error is not a fatal error.
> 
> CC: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> CC: Maxime Ripard <mripard@kernel.org>
> CC: Thomas Zimmermann <tzimmermann@suse.de>
> CC: David Airlie <airlied@linux.ie>
> CC: Daniel Vetter <daniel@ffwll.ch>
> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
> ---
>   drivers/gpu/drm/drm_debugfs.c  | 25 +++++++++++++++++++++++--
>   drivers/gpu/drm/drm_drv.c      | 16 ++++++++++------
>   drivers/gpu/drm/drm_internal.h |  7 +++----
>   3 files changed, 36 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
> index b0a826489488..af275a0c09b4 100644
> --- a/drivers/gpu/drm/drm_debugfs.c
> +++ b/drivers/gpu/drm/drm_debugfs.c
> @@ -180,6 +180,9 @@ void drm_debugfs_create_files(const struct drm_info_list *files, int count,
>   	struct drm_info_node *tmp;
>   	int i;
> 
> +	if (!minor->debugfs_root)
> +		return;
> +
>   	for (i = 0; i < count; i++) {
>   		u32 features = files[i].driver_features;
> 
> @@ -203,7 +206,7 @@ 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,
> +void drm_debugfs_init(struct drm_minor *minor, int minor_id,
>   		     struct dentry *root)
>   {
>   	struct drm_device *dev = minor->dev;
> @@ -212,8 +215,16 @@ 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);
> +
> +	if (!root)
> +		goto error;
> +
>   	minor->debugfs_root = debugfs_create_dir(name, root);
> 
> +	if (IS_ERR(minor->debugfs_root))
> +		goto error;
> +
> +
>   	drm_debugfs_create_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES,
>   				 minor->debugfs_root, minor);
> 
> @@ -230,7 +241,11 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
>   	if (dev->driver->debugfs_init)
>   		dev->driver->debugfs_init(minor);
> 
> -	return 0;
> +	return;
> +
> +error:
> +	minor->debugfs_root = NULL;
> +	return;
>   }
> 
> 
> @@ -241,6 +256,9 @@ int drm_debugfs_remove_files(const struct drm_info_list *files, int count,
>   	struct drm_info_node *tmp;
>   	int i;
> 
> +	if (!minor->debugfs_root)
> +		return 0;
> +
>   	mutex_lock(&minor->debugfs_lock);
>   	for (i = 0; i < count; i++) {
>   		list_for_each_safe(pos, q, &minor->debugfs_list) {
> @@ -261,6 +279,9 @@ static void drm_debugfs_remove_all_files(struct drm_minor *minor)
>   {
>   	struct drm_info_node *node, *tmp;
> 
> +	if (!minor->debugfs_root)
> +		return;
> +
>   	mutex_lock(&minor->debugfs_lock);
>   	list_for_each_entry_safe(node, tmp, &minor->debugfs_list, list) {
>   		debugfs_remove(node->dent);
> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> index 7a5097467ba5..fa57ec2d49bf 100644
> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c
> @@ -160,11 +160,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type)
>   	if (!minor)
>   		return 0;
> 
> -	ret = drm_debugfs_init(minor, minor->index, drm_debugfs_root);
> -	if (ret) {
> -		DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n");

Rather than deleting the error message, return an error code from 
drm_debugfs_init() and print it here. I'd change DRM_ERROR() to 
drm_dbg_core(NULL, ...).


> -		goto err_debugfs;
> -	}
> +	drm_debugfs_init(minor, minor->index, drm_debugfs_root);
> 
>   	ret = device_add(minor->kdev);
>   	if (ret)
> @@ -1050,7 +1046,15 @@ static int __init drm_core_init(void)
>   		goto error;
>   	}
> 
> -	drm_debugfs_root = debugfs_create_dir("dri", NULL);
> +	if (!debugfs_initialized()) {
> +		drm_debugfs_root = NULL;
> +	} else {
> +		drm_debugfs_root = debugfs_create_dir("dri", NULL);
> +		if (IS_ERR(drm_debugfs_root)) {
> +			DRM_WARN("DRM: Failed to initialize /sys/kernel/debug/dri.\n");

This should also print the error code. I'd also change the call to 
drm_dbg_core(). The message should say 'failed to create', so it's 
differnt from the other one.

Best regards
Thomas

> +			drm_debugfs_root = NULL;
> +		}
> +	}
> 
>   	ret = register_chrdev(DRM_MAJOR, "drm", &drm_stub_fops);
>   	if (ret < 0)
> diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
> index 17f3548c8ed2..e27a40166178 100644
> --- a/drivers/gpu/drm/drm_internal.h
> +++ b/drivers/gpu/drm/drm_internal.h
> @@ -182,8 +182,8 @@ int drm_gem_dumb_destroy(struct drm_file *file, struct drm_device *dev,
> 
>   /* 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_init(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);
> @@ -191,10 +191,9 @@ 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,
> +static inline void drm_debugfs_init(struct drm_minor *minor, int minor_id,
>   				   struct dentry *root)
>   {
> -	return 0;
>   }
> 
>   static inline void drm_debugfs_cleanup(struct drm_minor *minor)
> --
> 2.32.0
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

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

* Re: [Intel-gfx] [PATCH 1/5] dri: cleanup debugfs error handling
  2021-10-08  9:17 ` [Intel-gfx] " Nirmoy Das
                   ` (5 preceding siblings ...)
  (?)
@ 2021-10-08  9:40 ` Jani Nikula
  2021-10-08 11:07   ` Greg KH
  -1 siblings, 1 reply; 37+ messages in thread
From: Jani Nikula @ 2021-10-08  9:40 UTC (permalink / raw)
  To: Nirmoy Das, dri-devel
  Cc: intel-gfx, Nirmoy Das, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter, Greg KH

On Fri, 08 Oct 2021, Nirmoy Das <nirmoy.das@amd.com> wrote:
> Debugfs API returns encoded error instead of NULL.
> This patch cleanups drm debugfs error handling to
> properly set dri and its minor's root dentry to NULL.
>
> Also do not error out if dri/minor debugfs directory
> creation fails as a debugfs error is not a fatal error.

Cc: Greg

I thought this is the opposite of what Greg's been telling everyone to
do with debugfs.

BR,
Jani.

>
> CC: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> CC: Maxime Ripard <mripard@kernel.org>
> CC: Thomas Zimmermann <tzimmermann@suse.de>
> CC: David Airlie <airlied@linux.ie>
> CC: Daniel Vetter <daniel@ffwll.ch>
> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
> ---
>  drivers/gpu/drm/drm_debugfs.c  | 25 +++++++++++++++++++++++--
>  drivers/gpu/drm/drm_drv.c      | 16 ++++++++++------
>  drivers/gpu/drm/drm_internal.h |  7 +++----
>  3 files changed, 36 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
> index b0a826489488..af275a0c09b4 100644
> --- a/drivers/gpu/drm/drm_debugfs.c
> +++ b/drivers/gpu/drm/drm_debugfs.c
> @@ -180,6 +180,9 @@ void drm_debugfs_create_files(const struct drm_info_list *files, int count,
>  	struct drm_info_node *tmp;
>  	int i;
>
> +	if (!minor->debugfs_root)
> +		return;
> +
>  	for (i = 0; i < count; i++) {
>  		u32 features = files[i].driver_features;
>
> @@ -203,7 +206,7 @@ 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,
> +void drm_debugfs_init(struct drm_minor *minor, int minor_id,
>  		     struct dentry *root)
>  {
>  	struct drm_device *dev = minor->dev;
> @@ -212,8 +215,16 @@ 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);
> +
> +	if (!root)
> +		goto error;
> +
>  	minor->debugfs_root = debugfs_create_dir(name, root);
>
> +	if (IS_ERR(minor->debugfs_root))
> +		goto error;
> +
> +
>  	drm_debugfs_create_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES,
>  				 minor->debugfs_root, minor);
>
> @@ -230,7 +241,11 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
>  	if (dev->driver->debugfs_init)
>  		dev->driver->debugfs_init(minor);
>
> -	return 0;
> +	return;
> +
> +error:
> +	minor->debugfs_root = NULL;
> +	return;
>  }
>
>
> @@ -241,6 +256,9 @@ int drm_debugfs_remove_files(const struct drm_info_list *files, int count,
>  	struct drm_info_node *tmp;
>  	int i;
>
> +	if (!minor->debugfs_root)
> +		return 0;
> +
>  	mutex_lock(&minor->debugfs_lock);
>  	for (i = 0; i < count; i++) {
>  		list_for_each_safe(pos, q, &minor->debugfs_list) {
> @@ -261,6 +279,9 @@ static void drm_debugfs_remove_all_files(struct drm_minor *minor)
>  {
>  	struct drm_info_node *node, *tmp;
>
> +	if (!minor->debugfs_root)
> +		return;
> +
>  	mutex_lock(&minor->debugfs_lock);
>  	list_for_each_entry_safe(node, tmp, &minor->debugfs_list, list) {
>  		debugfs_remove(node->dent);
> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> index 7a5097467ba5..fa57ec2d49bf 100644
> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c
> @@ -160,11 +160,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type)
>  	if (!minor)
>  		return 0;
>
> -	ret = drm_debugfs_init(minor, minor->index, drm_debugfs_root);
> -	if (ret) {
> -		DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n");
> -		goto err_debugfs;
> -	}
> +	drm_debugfs_init(minor, minor->index, drm_debugfs_root);
>
>  	ret = device_add(minor->kdev);
>  	if (ret)
> @@ -1050,7 +1046,15 @@ static int __init drm_core_init(void)
>  		goto error;
>  	}
>
> -	drm_debugfs_root = debugfs_create_dir("dri", NULL);
> +	if (!debugfs_initialized()) {
> +		drm_debugfs_root = NULL;
> +	} else {
> +		drm_debugfs_root = debugfs_create_dir("dri", NULL);
> +		if (IS_ERR(drm_debugfs_root)) {
> +			DRM_WARN("DRM: Failed to initialize /sys/kernel/debug/dri.\n");
> +			drm_debugfs_root = NULL;
> +		}
> +	}
>
>  	ret = register_chrdev(DRM_MAJOR, "drm", &drm_stub_fops);
>  	if (ret < 0)
> diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
> index 17f3548c8ed2..e27a40166178 100644
> --- a/drivers/gpu/drm/drm_internal.h
> +++ b/drivers/gpu/drm/drm_internal.h
> @@ -182,8 +182,8 @@ int drm_gem_dumb_destroy(struct drm_file *file, struct drm_device *dev,
>
>  /* 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_init(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);
> @@ -191,10 +191,9 @@ 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,
> +static inline void drm_debugfs_init(struct drm_minor *minor, int minor_id,
>  				   struct dentry *root)
>  {
> -	return 0;
>  }
>
>  static inline void drm_debugfs_cleanup(struct drm_minor *minor)
> --
> 2.32.0
>

-- 
Jani Nikula, Intel Open Source Graphics Center

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

* Re: [PATCH 3/5] drm/radeon: check dri root before debugfs init
  2021-10-08  9:17   ` [Intel-gfx] " Nirmoy Das
@ 2021-10-08 10:23     ` Christian König
  -1 siblings, 0 replies; 37+ messages in thread
From: Christian König @ 2021-10-08 10:23 UTC (permalink / raw)
  To: Nirmoy Das, dri-devel; +Cc: intel-gfx, Alex Deucher, Pan, Xinhui

Am 08.10.21 um 11:17 schrieb Nirmoy Das:
> Return early if dri minor root dentry is NULL.
>
> CC: Alex Deucher <alexander.deucher@amd.com>
> CC: "Christian König" <christian.koenig@amd.com>
> CC: "Pan, Xinhui" <Xinhui.Pan@amd.com>
>
> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>

Acked-by: Christian König <christian.koenig@amd.com>

Where are the other patches from the series?

Thanks,
Christian.

> ---
>   drivers/gpu/drm/radeon/r100.c          | 9 +++++++++
>   drivers/gpu/drm/radeon/r300.c          | 3 +++
>   drivers/gpu/drm/radeon/r420.c          | 3 +++
>   drivers/gpu/drm/radeon/r600.c          | 3 +++
>   drivers/gpu/drm/radeon/radeon_dp_mst.c | 3 +++
>   drivers/gpu/drm/radeon/radeon_fence.c  | 3 +++
>   drivers/gpu/drm/radeon/radeon_gem.c    | 3 +++
>   drivers/gpu/drm/radeon/radeon_ib.c     | 3 +++
>   drivers/gpu/drm/radeon/radeon_pm.c     | 5 ++++-
>   drivers/gpu/drm/radeon/radeon_ring.c   | 3 +++
>   drivers/gpu/drm/radeon/radeon_ttm.c    | 3 +++
>   drivers/gpu/drm/radeon/rs400.c         | 3 +++
>   drivers/gpu/drm/radeon/rv515.c         | 3 +++
>   13 files changed, 46 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
> index 2dd85ba1faa2..ae6c95b34013 100644
> --- a/drivers/gpu/drm/radeon/r100.c
> +++ b/drivers/gpu/drm/radeon/r100.c
> @@ -3059,6 +3059,9 @@ void  r100_debugfs_rbbm_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("r100_rbbm_info", 0444, root, rdev,
>   			    &r100_debugfs_rbbm_info_fops);
>   #endif
> @@ -3069,6 +3072,9 @@ void r100_debugfs_cp_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("r100_cp_ring_info", 0444, root, rdev,
>   			    &r100_debugfs_cp_ring_info_fops);
>   	debugfs_create_file("r100_cp_csq_fifo", 0444, root, rdev,
> @@ -3081,6 +3087,9 @@ void  r100_debugfs_mc_info_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("r100_mc_info", 0444, root, rdev,
>   			    &r100_debugfs_mc_info_fops);
>   #endif
> diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
> index 621ff174dff3..b22969e2394f 100644
> --- a/drivers/gpu/drm/radeon/r300.c
> +++ b/drivers/gpu/drm/radeon/r300.c
> @@ -618,6 +618,9 @@ 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;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("rv370_pcie_gart_info", 0444, root, rdev,
>   			    &rv370_debugfs_pcie_gart_info_fops);
>   #endif
> diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c
> index 7e6320e8c6a0..cdb4ac3e346b 100644
> --- a/drivers/gpu/drm/radeon/r420.c
> +++ b/drivers/gpu/drm/radeon/r420.c
> @@ -494,6 +494,9 @@ void r420_debugfs_pipes_info_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("r420_pipes_info", 0444, root, rdev,
>   			    &r420_debugfs_pipes_info_fops);
>   #endif
> diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
> index ca3fcae2adb5..d8f525cf0c3b 100644
> --- a/drivers/gpu/drm/radeon/r600.c
> +++ b/drivers/gpu/drm/radeon/r600.c
> @@ -4360,6 +4360,9 @@ static void r600_debugfs_mc_info_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("r600_mc_info", 0444, root, rdev,
>   			    &r600_debugfs_mc_info_fops);
>
> diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c b/drivers/gpu/drm/radeon/radeon_dp_mst.c
> index ec867fa880a4..cf06da89bb7c 100644
> --- a/drivers/gpu/drm/radeon/radeon_dp_mst.c
> +++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c
> @@ -771,6 +771,9 @@ void radeon_mst_debugfs_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("radeon_mst_info", 0444, root, rdev,
>   			    &radeon_debugfs_mst_info_fops);
>
> diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
> index 73e3117420bf..11f30349de46 100644
> --- a/drivers/gpu/drm/radeon/radeon_fence.c
> +++ b/drivers/gpu/drm/radeon/radeon_fence.c
> @@ -1006,6 +1006,9 @@ void radeon_debugfs_fence_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("radeon_gpu_reset", 0444, root, rdev,
>   			    &radeon_debugfs_gpu_reset_fops);
>   	debugfs_create_file("radeon_fence_info", 0444, root, rdev,
> diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
> index 458f92a70887..e6df1451af37 100644
> --- a/drivers/gpu/drm/radeon/radeon_gem.c
> +++ b/drivers/gpu/drm/radeon/radeon_gem.c
> @@ -890,6 +890,9 @@ void radeon_gem_debugfs_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	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 62b116727b4f..28316eb4fd49 100644
> --- a/drivers/gpu/drm/radeon/radeon_ib.c
> +++ b/drivers/gpu/drm/radeon/radeon_ib.c
> @@ -311,6 +311,9 @@ static void radeon_debugfs_sa_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("radeon_sa_info", 0444, root, rdev,
>   			    &radeon_debugfs_sa_info_fops);
>   #endif
> diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
> index c67b6ddb29a4..c09e574d04f0 100644
> --- a/drivers/gpu/drm/radeon/radeon_pm.c
> +++ b/drivers/gpu/drm/radeon/radeon_pm.c
> @@ -1958,6 +1958,9 @@ static void radeon_debugfs_pm_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	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..31a5b1ebf7c9 100644
> --- a/drivers/gpu/drm/radeon/radeon_ring.c
> +++ b/drivers/gpu/drm/radeon/radeon_ring.c
> @@ -550,6 +550,9 @@ static void radeon_debugfs_ring_init(struct radeon_device *rdev, struct radeon_r
>   	const char *ring_name = radeon_debugfs_ring_idx_to_name(ring->idx);
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	if (ring_name)
>   		debugfs_create_file(ring_name, 0444, root, ring,
>   				    &radeon_debugfs_ring_info_fops);
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> index 11b21d605584..2e18ec93768d 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -942,6 +942,9 @@ static void radeon_ttm_debugfs_init(struct radeon_device *rdev)
>   	struct drm_minor *minor = rdev->ddev->primary;
>   	struct dentry *root = minor->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	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..b41a903a29c3 100644
> --- a/drivers/gpu/drm/radeon/rs400.c
> +++ b/drivers/gpu/drm/radeon/rs400.c
> @@ -380,6 +380,9 @@ 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;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("rs400_gart_info", 0444, root, rdev,
>   			    &rs400_debugfs_gart_info_fops);
>   #endif
> diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
> index 63fb06e8e2d7..f39b6ab554f2 100644
> --- a/drivers/gpu/drm/radeon/rv515.c
> +++ b/drivers/gpu/drm/radeon/rv515.c
> @@ -257,6 +257,9 @@ void rv515_debugfs(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("rv515_pipes_info", 0444, root, rdev,
>   			    &rv515_debugfs_pipes_info_fops);
>   	debugfs_create_file("rv515_ga_info", 0444, root, rdev,
> --
> 2.32.0
>


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

* Re: [Intel-gfx] [PATCH 3/5] drm/radeon: check dri root before debugfs init
@ 2021-10-08 10:23     ` Christian König
  0 siblings, 0 replies; 37+ messages in thread
From: Christian König @ 2021-10-08 10:23 UTC (permalink / raw)
  To: Nirmoy Das, dri-devel; +Cc: intel-gfx, Alex Deucher, Pan, Xinhui

Am 08.10.21 um 11:17 schrieb Nirmoy Das:
> Return early if dri minor root dentry is NULL.
>
> CC: Alex Deucher <alexander.deucher@amd.com>
> CC: "Christian König" <christian.koenig@amd.com>
> CC: "Pan, Xinhui" <Xinhui.Pan@amd.com>
>
> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>

Acked-by: Christian König <christian.koenig@amd.com>

Where are the other patches from the series?

Thanks,
Christian.

> ---
>   drivers/gpu/drm/radeon/r100.c          | 9 +++++++++
>   drivers/gpu/drm/radeon/r300.c          | 3 +++
>   drivers/gpu/drm/radeon/r420.c          | 3 +++
>   drivers/gpu/drm/radeon/r600.c          | 3 +++
>   drivers/gpu/drm/radeon/radeon_dp_mst.c | 3 +++
>   drivers/gpu/drm/radeon/radeon_fence.c  | 3 +++
>   drivers/gpu/drm/radeon/radeon_gem.c    | 3 +++
>   drivers/gpu/drm/radeon/radeon_ib.c     | 3 +++
>   drivers/gpu/drm/radeon/radeon_pm.c     | 5 ++++-
>   drivers/gpu/drm/radeon/radeon_ring.c   | 3 +++
>   drivers/gpu/drm/radeon/radeon_ttm.c    | 3 +++
>   drivers/gpu/drm/radeon/rs400.c         | 3 +++
>   drivers/gpu/drm/radeon/rv515.c         | 3 +++
>   13 files changed, 46 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
> index 2dd85ba1faa2..ae6c95b34013 100644
> --- a/drivers/gpu/drm/radeon/r100.c
> +++ b/drivers/gpu/drm/radeon/r100.c
> @@ -3059,6 +3059,9 @@ void  r100_debugfs_rbbm_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("r100_rbbm_info", 0444, root, rdev,
>   			    &r100_debugfs_rbbm_info_fops);
>   #endif
> @@ -3069,6 +3072,9 @@ void r100_debugfs_cp_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("r100_cp_ring_info", 0444, root, rdev,
>   			    &r100_debugfs_cp_ring_info_fops);
>   	debugfs_create_file("r100_cp_csq_fifo", 0444, root, rdev,
> @@ -3081,6 +3087,9 @@ void  r100_debugfs_mc_info_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("r100_mc_info", 0444, root, rdev,
>   			    &r100_debugfs_mc_info_fops);
>   #endif
> diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
> index 621ff174dff3..b22969e2394f 100644
> --- a/drivers/gpu/drm/radeon/r300.c
> +++ b/drivers/gpu/drm/radeon/r300.c
> @@ -618,6 +618,9 @@ 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;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("rv370_pcie_gart_info", 0444, root, rdev,
>   			    &rv370_debugfs_pcie_gart_info_fops);
>   #endif
> diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c
> index 7e6320e8c6a0..cdb4ac3e346b 100644
> --- a/drivers/gpu/drm/radeon/r420.c
> +++ b/drivers/gpu/drm/radeon/r420.c
> @@ -494,6 +494,9 @@ void r420_debugfs_pipes_info_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("r420_pipes_info", 0444, root, rdev,
>   			    &r420_debugfs_pipes_info_fops);
>   #endif
> diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
> index ca3fcae2adb5..d8f525cf0c3b 100644
> --- a/drivers/gpu/drm/radeon/r600.c
> +++ b/drivers/gpu/drm/radeon/r600.c
> @@ -4360,6 +4360,9 @@ static void r600_debugfs_mc_info_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("r600_mc_info", 0444, root, rdev,
>   			    &r600_debugfs_mc_info_fops);
>
> diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c b/drivers/gpu/drm/radeon/radeon_dp_mst.c
> index ec867fa880a4..cf06da89bb7c 100644
> --- a/drivers/gpu/drm/radeon/radeon_dp_mst.c
> +++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c
> @@ -771,6 +771,9 @@ void radeon_mst_debugfs_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("radeon_mst_info", 0444, root, rdev,
>   			    &radeon_debugfs_mst_info_fops);
>
> diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
> index 73e3117420bf..11f30349de46 100644
> --- a/drivers/gpu/drm/radeon/radeon_fence.c
> +++ b/drivers/gpu/drm/radeon/radeon_fence.c
> @@ -1006,6 +1006,9 @@ void radeon_debugfs_fence_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("radeon_gpu_reset", 0444, root, rdev,
>   			    &radeon_debugfs_gpu_reset_fops);
>   	debugfs_create_file("radeon_fence_info", 0444, root, rdev,
> diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
> index 458f92a70887..e6df1451af37 100644
> --- a/drivers/gpu/drm/radeon/radeon_gem.c
> +++ b/drivers/gpu/drm/radeon/radeon_gem.c
> @@ -890,6 +890,9 @@ void radeon_gem_debugfs_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	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 62b116727b4f..28316eb4fd49 100644
> --- a/drivers/gpu/drm/radeon/radeon_ib.c
> +++ b/drivers/gpu/drm/radeon/radeon_ib.c
> @@ -311,6 +311,9 @@ static void radeon_debugfs_sa_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("radeon_sa_info", 0444, root, rdev,
>   			    &radeon_debugfs_sa_info_fops);
>   #endif
> diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
> index c67b6ddb29a4..c09e574d04f0 100644
> --- a/drivers/gpu/drm/radeon/radeon_pm.c
> +++ b/drivers/gpu/drm/radeon/radeon_pm.c
> @@ -1958,6 +1958,9 @@ static void radeon_debugfs_pm_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	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..31a5b1ebf7c9 100644
> --- a/drivers/gpu/drm/radeon/radeon_ring.c
> +++ b/drivers/gpu/drm/radeon/radeon_ring.c
> @@ -550,6 +550,9 @@ static void radeon_debugfs_ring_init(struct radeon_device *rdev, struct radeon_r
>   	const char *ring_name = radeon_debugfs_ring_idx_to_name(ring->idx);
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	if (ring_name)
>   		debugfs_create_file(ring_name, 0444, root, ring,
>   				    &radeon_debugfs_ring_info_fops);
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> index 11b21d605584..2e18ec93768d 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -942,6 +942,9 @@ static void radeon_ttm_debugfs_init(struct radeon_device *rdev)
>   	struct drm_minor *minor = rdev->ddev->primary;
>   	struct dentry *root = minor->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	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..b41a903a29c3 100644
> --- a/drivers/gpu/drm/radeon/rs400.c
> +++ b/drivers/gpu/drm/radeon/rs400.c
> @@ -380,6 +380,9 @@ 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;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("rs400_gart_info", 0444, root, rdev,
>   			    &rs400_debugfs_gart_info_fops);
>   #endif
> diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
> index 63fb06e8e2d7..f39b6ab554f2 100644
> --- a/drivers/gpu/drm/radeon/rv515.c
> +++ b/drivers/gpu/drm/radeon/rv515.c
> @@ -257,6 +257,9 @@ void rv515_debugfs(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>   	struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +	if (!root)
> +		return;
> +
>   	debugfs_create_file("rv515_pipes_info", 0444, root, rdev,
>   			    &rv515_debugfs_pipes_info_fops);
>   	debugfs_create_file("rv515_ga_info", 0444, root, rdev,
> --
> 2.32.0
>


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

* Re: [PATCH 3/5] drm/radeon: check dri root before debugfs init
  2021-10-08 10:23     ` [Intel-gfx] " Christian König
@ 2021-10-08 10:34       ` Das, Nirmoy
  -1 siblings, 0 replies; 37+ messages in thread
From: Das, Nirmoy @ 2021-10-08 10:34 UTC (permalink / raw)
  To: Koenig, Christian, dri-devel; +Cc: intel-gfx, Deucher, Alexander, Pan, Xinhui

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

[AMD Official Use Only]

I sent all the patches to dr-devel. I think there is an issue with our email server. Thunderbird is asking for a password every few minutes.

https://patchwork.freedesktop.org/series/95603/

Nirmoy
[sending this from my browser]
________________________________
From: Koenig, Christian <Christian.Koenig@amd.com>
Sent: Friday, October 8, 2021 12:23 PM
To: Das, Nirmoy <Nirmoy.Das@amd.com>; dri-devel@lists.freedesktop.org <dri-devel@lists.freedesktop.org>
Cc: intel-gfx@lists.freedesktop.org <intel-gfx@lists.freedesktop.org>; Deucher, Alexander <Alexander.Deucher@amd.com>; Pan, Xinhui <Xinhui.Pan@amd.com>
Subject: Re: [PATCH 3/5] drm/radeon: check dri root before debugfs init

Am 08.10.21 um 11:17 schrieb Nirmoy Das:
> Return early if dri minor root dentry is NULL.
>
> CC: Alex Deucher <alexander.deucher@amd.com>
> CC: "Christian König" <christian.koenig@amd.com>
> CC: "Pan, Xinhui" <Xinhui.Pan@amd.com>
>
> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>

Acked-by: Christian König <christian.koenig@amd.com>

Where are the other patches from the series?

Thanks,
Christian.

> ---
>   drivers/gpu/drm/radeon/r100.c          | 9 +++++++++
>   drivers/gpu/drm/radeon/r300.c          | 3 +++
>   drivers/gpu/drm/radeon/r420.c          | 3 +++
>   drivers/gpu/drm/radeon/r600.c          | 3 +++
>   drivers/gpu/drm/radeon/radeon_dp_mst.c | 3 +++
>   drivers/gpu/drm/radeon/radeon_fence.c  | 3 +++
>   drivers/gpu/drm/radeon/radeon_gem.c    | 3 +++
>   drivers/gpu/drm/radeon/radeon_ib.c     | 3 +++
>   drivers/gpu/drm/radeon/radeon_pm.c     | 5 ++++-
>   drivers/gpu/drm/radeon/radeon_ring.c   | 3 +++
>   drivers/gpu/drm/radeon/radeon_ttm.c    | 3 +++
>   drivers/gpu/drm/radeon/rs400.c         | 3 +++
>   drivers/gpu/drm/radeon/rv515.c         | 3 +++
>   13 files changed, 46 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
> index 2dd85ba1faa2..ae6c95b34013 100644
> --- a/drivers/gpu/drm/radeon/r100.c
> +++ b/drivers/gpu/drm/radeon/r100.c
> @@ -3059,6 +3059,9 @@ void  r100_debugfs_rbbm_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("r100_rbbm_info", 0444, root, rdev,
>                            &r100_debugfs_rbbm_info_fops);
>   #endif
> @@ -3069,6 +3072,9 @@ void r100_debugfs_cp_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("r100_cp_ring_info", 0444, root, rdev,
>                            &r100_debugfs_cp_ring_info_fops);
>        debugfs_create_file("r100_cp_csq_fifo", 0444, root, rdev,
> @@ -3081,6 +3087,9 @@ void  r100_debugfs_mc_info_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("r100_mc_info", 0444, root, rdev,
>                            &r100_debugfs_mc_info_fops);
>   #endif
> diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
> index 621ff174dff3..b22969e2394f 100644
> --- a/drivers/gpu/drm/radeon/r300.c
> +++ b/drivers/gpu/drm/radeon/r300.c
> @@ -618,6 +618,9 @@ 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;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("rv370_pcie_gart_info", 0444, root, rdev,
>                            &rv370_debugfs_pcie_gart_info_fops);
>   #endif
> diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c
> index 7e6320e8c6a0..cdb4ac3e346b 100644
> --- a/drivers/gpu/drm/radeon/r420.c
> +++ b/drivers/gpu/drm/radeon/r420.c
> @@ -494,6 +494,9 @@ void r420_debugfs_pipes_info_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("r420_pipes_info", 0444, root, rdev,
>                            &r420_debugfs_pipes_info_fops);
>   #endif
> diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
> index ca3fcae2adb5..d8f525cf0c3b 100644
> --- a/drivers/gpu/drm/radeon/r600.c
> +++ b/drivers/gpu/drm/radeon/r600.c
> @@ -4360,6 +4360,9 @@ static void r600_debugfs_mc_info_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("r600_mc_info", 0444, root, rdev,
>                            &r600_debugfs_mc_info_fops);
>
> diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c b/drivers/gpu/drm/radeon/radeon_dp_mst.c
> index ec867fa880a4..cf06da89bb7c 100644
> --- a/drivers/gpu/drm/radeon/radeon_dp_mst.c
> +++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c
> @@ -771,6 +771,9 @@ void radeon_mst_debugfs_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("radeon_mst_info", 0444, root, rdev,
>                            &radeon_debugfs_mst_info_fops);
>
> diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
> index 73e3117420bf..11f30349de46 100644
> --- a/drivers/gpu/drm/radeon/radeon_fence.c
> +++ b/drivers/gpu/drm/radeon/radeon_fence.c
> @@ -1006,6 +1006,9 @@ void radeon_debugfs_fence_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("radeon_gpu_reset", 0444, root, rdev,
>                            &radeon_debugfs_gpu_reset_fops);
>        debugfs_create_file("radeon_fence_info", 0444, root, rdev,
> diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
> index 458f92a70887..e6df1451af37 100644
> --- a/drivers/gpu/drm/radeon/radeon_gem.c
> +++ b/drivers/gpu/drm/radeon/radeon_gem.c
> @@ -890,6 +890,9 @@ void radeon_gem_debugfs_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        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 62b116727b4f..28316eb4fd49 100644
> --- a/drivers/gpu/drm/radeon/radeon_ib.c
> +++ b/drivers/gpu/drm/radeon/radeon_ib.c
> @@ -311,6 +311,9 @@ static void radeon_debugfs_sa_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("radeon_sa_info", 0444, root, rdev,
>                            &radeon_debugfs_sa_info_fops);
>   #endif
> diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
> index c67b6ddb29a4..c09e574d04f0 100644
> --- a/drivers/gpu/drm/radeon/radeon_pm.c
> +++ b/drivers/gpu/drm/radeon/radeon_pm.c
> @@ -1958,6 +1958,9 @@ static void radeon_debugfs_pm_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        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..31a5b1ebf7c9 100644
> --- a/drivers/gpu/drm/radeon/radeon_ring.c
> +++ b/drivers/gpu/drm/radeon/radeon_ring.c
> @@ -550,6 +550,9 @@ static void radeon_debugfs_ring_init(struct radeon_device *rdev, struct radeon_r
>        const char *ring_name = radeon_debugfs_ring_idx_to_name(ring->idx);
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        if (ring_name)
>                debugfs_create_file(ring_name, 0444, root, ring,
>                                    &radeon_debugfs_ring_info_fops);
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> index 11b21d605584..2e18ec93768d 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -942,6 +942,9 @@ static void radeon_ttm_debugfs_init(struct radeon_device *rdev)
>        struct drm_minor *minor = rdev->ddev->primary;
>        struct dentry *root = minor->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        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..b41a903a29c3 100644
> --- a/drivers/gpu/drm/radeon/rs400.c
> +++ b/drivers/gpu/drm/radeon/rs400.c
> @@ -380,6 +380,9 @@ 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;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("rs400_gart_info", 0444, root, rdev,
>                            &rs400_debugfs_gart_info_fops);
>   #endif
> diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
> index 63fb06e8e2d7..f39b6ab554f2 100644
> --- a/drivers/gpu/drm/radeon/rv515.c
> +++ b/drivers/gpu/drm/radeon/rv515.c
> @@ -257,6 +257,9 @@ void rv515_debugfs(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("rv515_pipes_info", 0444, root, rdev,
>                            &rv515_debugfs_pipes_info_fops);
>        debugfs_create_file("rv515_ga_info", 0444, root, rdev,
> --
> 2.32.0
>


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

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

* Re: [Intel-gfx] [PATCH 3/5] drm/radeon: check dri root before debugfs init
@ 2021-10-08 10:34       ` Das, Nirmoy
  0 siblings, 0 replies; 37+ messages in thread
From: Das, Nirmoy @ 2021-10-08 10:34 UTC (permalink / raw)
  To: Koenig, Christian, dri-devel; +Cc: intel-gfx, Deucher, Alexander, Pan, Xinhui

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

[AMD Official Use Only]

I sent all the patches to dr-devel. I think there is an issue with our email server. Thunderbird is asking for a password every few minutes.

https://patchwork.freedesktop.org/series/95603/

Nirmoy
[sending this from my browser]
________________________________
From: Koenig, Christian <Christian.Koenig@amd.com>
Sent: Friday, October 8, 2021 12:23 PM
To: Das, Nirmoy <Nirmoy.Das@amd.com>; dri-devel@lists.freedesktop.org <dri-devel@lists.freedesktop.org>
Cc: intel-gfx@lists.freedesktop.org <intel-gfx@lists.freedesktop.org>; Deucher, Alexander <Alexander.Deucher@amd.com>; Pan, Xinhui <Xinhui.Pan@amd.com>
Subject: Re: [PATCH 3/5] drm/radeon: check dri root before debugfs init

Am 08.10.21 um 11:17 schrieb Nirmoy Das:
> Return early if dri minor root dentry is NULL.
>
> CC: Alex Deucher <alexander.deucher@amd.com>
> CC: "Christian König" <christian.koenig@amd.com>
> CC: "Pan, Xinhui" <Xinhui.Pan@amd.com>
>
> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>

Acked-by: Christian König <christian.koenig@amd.com>

Where are the other patches from the series?

Thanks,
Christian.

> ---
>   drivers/gpu/drm/radeon/r100.c          | 9 +++++++++
>   drivers/gpu/drm/radeon/r300.c          | 3 +++
>   drivers/gpu/drm/radeon/r420.c          | 3 +++
>   drivers/gpu/drm/radeon/r600.c          | 3 +++
>   drivers/gpu/drm/radeon/radeon_dp_mst.c | 3 +++
>   drivers/gpu/drm/radeon/radeon_fence.c  | 3 +++
>   drivers/gpu/drm/radeon/radeon_gem.c    | 3 +++
>   drivers/gpu/drm/radeon/radeon_ib.c     | 3 +++
>   drivers/gpu/drm/radeon/radeon_pm.c     | 5 ++++-
>   drivers/gpu/drm/radeon/radeon_ring.c   | 3 +++
>   drivers/gpu/drm/radeon/radeon_ttm.c    | 3 +++
>   drivers/gpu/drm/radeon/rs400.c         | 3 +++
>   drivers/gpu/drm/radeon/rv515.c         | 3 +++
>   13 files changed, 46 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
> index 2dd85ba1faa2..ae6c95b34013 100644
> --- a/drivers/gpu/drm/radeon/r100.c
> +++ b/drivers/gpu/drm/radeon/r100.c
> @@ -3059,6 +3059,9 @@ void  r100_debugfs_rbbm_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("r100_rbbm_info", 0444, root, rdev,
>                            &r100_debugfs_rbbm_info_fops);
>   #endif
> @@ -3069,6 +3072,9 @@ void r100_debugfs_cp_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("r100_cp_ring_info", 0444, root, rdev,
>                            &r100_debugfs_cp_ring_info_fops);
>        debugfs_create_file("r100_cp_csq_fifo", 0444, root, rdev,
> @@ -3081,6 +3087,9 @@ void  r100_debugfs_mc_info_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("r100_mc_info", 0444, root, rdev,
>                            &r100_debugfs_mc_info_fops);
>   #endif
> diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
> index 621ff174dff3..b22969e2394f 100644
> --- a/drivers/gpu/drm/radeon/r300.c
> +++ b/drivers/gpu/drm/radeon/r300.c
> @@ -618,6 +618,9 @@ 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;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("rv370_pcie_gart_info", 0444, root, rdev,
>                            &rv370_debugfs_pcie_gart_info_fops);
>   #endif
> diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c
> index 7e6320e8c6a0..cdb4ac3e346b 100644
> --- a/drivers/gpu/drm/radeon/r420.c
> +++ b/drivers/gpu/drm/radeon/r420.c
> @@ -494,6 +494,9 @@ void r420_debugfs_pipes_info_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("r420_pipes_info", 0444, root, rdev,
>                            &r420_debugfs_pipes_info_fops);
>   #endif
> diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
> index ca3fcae2adb5..d8f525cf0c3b 100644
> --- a/drivers/gpu/drm/radeon/r600.c
> +++ b/drivers/gpu/drm/radeon/r600.c
> @@ -4360,6 +4360,9 @@ static void r600_debugfs_mc_info_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("r600_mc_info", 0444, root, rdev,
>                            &r600_debugfs_mc_info_fops);
>
> diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c b/drivers/gpu/drm/radeon/radeon_dp_mst.c
> index ec867fa880a4..cf06da89bb7c 100644
> --- a/drivers/gpu/drm/radeon/radeon_dp_mst.c
> +++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c
> @@ -771,6 +771,9 @@ void radeon_mst_debugfs_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("radeon_mst_info", 0444, root, rdev,
>                            &radeon_debugfs_mst_info_fops);
>
> diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
> index 73e3117420bf..11f30349de46 100644
> --- a/drivers/gpu/drm/radeon/radeon_fence.c
> +++ b/drivers/gpu/drm/radeon/radeon_fence.c
> @@ -1006,6 +1006,9 @@ void radeon_debugfs_fence_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("radeon_gpu_reset", 0444, root, rdev,
>                            &radeon_debugfs_gpu_reset_fops);
>        debugfs_create_file("radeon_fence_info", 0444, root, rdev,
> diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
> index 458f92a70887..e6df1451af37 100644
> --- a/drivers/gpu/drm/radeon/radeon_gem.c
> +++ b/drivers/gpu/drm/radeon/radeon_gem.c
> @@ -890,6 +890,9 @@ void radeon_gem_debugfs_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        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 62b116727b4f..28316eb4fd49 100644
> --- a/drivers/gpu/drm/radeon/radeon_ib.c
> +++ b/drivers/gpu/drm/radeon/radeon_ib.c
> @@ -311,6 +311,9 @@ static void radeon_debugfs_sa_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("radeon_sa_info", 0444, root, rdev,
>                            &radeon_debugfs_sa_info_fops);
>   #endif
> diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
> index c67b6ddb29a4..c09e574d04f0 100644
> --- a/drivers/gpu/drm/radeon/radeon_pm.c
> +++ b/drivers/gpu/drm/radeon/radeon_pm.c
> @@ -1958,6 +1958,9 @@ static void radeon_debugfs_pm_init(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        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..31a5b1ebf7c9 100644
> --- a/drivers/gpu/drm/radeon/radeon_ring.c
> +++ b/drivers/gpu/drm/radeon/radeon_ring.c
> @@ -550,6 +550,9 @@ static void radeon_debugfs_ring_init(struct radeon_device *rdev, struct radeon_r
>        const char *ring_name = radeon_debugfs_ring_idx_to_name(ring->idx);
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        if (ring_name)
>                debugfs_create_file(ring_name, 0444, root, ring,
>                                    &radeon_debugfs_ring_info_fops);
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> index 11b21d605584..2e18ec93768d 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -942,6 +942,9 @@ static void radeon_ttm_debugfs_init(struct radeon_device *rdev)
>        struct drm_minor *minor = rdev->ddev->primary;
>        struct dentry *root = minor->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        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..b41a903a29c3 100644
> --- a/drivers/gpu/drm/radeon/rs400.c
> +++ b/drivers/gpu/drm/radeon/rs400.c
> @@ -380,6 +380,9 @@ 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;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("rs400_gart_info", 0444, root, rdev,
>                            &rs400_debugfs_gart_info_fops);
>   #endif
> diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
> index 63fb06e8e2d7..f39b6ab554f2 100644
> --- a/drivers/gpu/drm/radeon/rv515.c
> +++ b/drivers/gpu/drm/radeon/rv515.c
> @@ -257,6 +257,9 @@ void rv515_debugfs(struct radeon_device *rdev)
>   #if defined(CONFIG_DEBUG_FS)
>        struct dentry *root = rdev->ddev->primary->debugfs_root;
>
> +     if (!root)
> +             return;
> +
>        debugfs_create_file("rv515_pipes_info", 0444, root, rdev,
>                            &rv515_debugfs_pipes_info_fops);
>        debugfs_create_file("rv515_ga_info", 0444, root, rdev,
> --
> 2.32.0
>


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

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

* Re: [Intel-gfx] [PATCH 1/5] dri: cleanup debugfs error handling
  2021-10-08  9:40 ` Jani Nikula
@ 2021-10-08 11:07   ` Greg KH
  2021-10-08 12:08     ` Das, Nirmoy
       [not found]     ` <02fc9da3-ebac-2df1-3a54-d764b273f91b@amd.com>
  0 siblings, 2 replies; 37+ messages in thread
From: Greg KH @ 2021-10-08 11:07 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Nirmoy Das, dri-devel, intel-gfx, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter

On Fri, Oct 08, 2021 at 12:40:47PM +0300, Jani Nikula wrote:
> On Fri, 08 Oct 2021, Nirmoy Das <nirmoy.das@amd.com> wrote:
> > Debugfs API returns encoded error instead of NULL.
> > This patch cleanups drm debugfs error handling to
> > properly set dri and its minor's root dentry to NULL.
> >
> > Also do not error out if dri/minor debugfs directory
> > creation fails as a debugfs error is not a fatal error.
> 
> Cc: Greg
> 
> I thought this is the opposite of what Greg's been telling everyone to
> do with debugfs.

Yes, that is not good.

You should never care about the result of a debugfs_create* call.  Just
take the result, and if it is a directory, save it off to use it for
creating a file, no need to check anything.

And then throw it away, later, when you want to remove the directory,
look it up with a call to debugfs_lookup() and pass that to
debugfs_remove() (which does so recursively).

There should never be a need to save, or check, the result of any
debugfs call.  If so, odds are it is being used incorrectly.

thanks,

greg k-h

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

* Re: [Intel-gfx] [PATCH 1/5] dri: cleanup debugfs error handling
  2021-10-08 11:07   ` Greg KH
@ 2021-10-08 12:08     ` Das, Nirmoy
       [not found]     ` <02fc9da3-ebac-2df1-3a54-d764b273f91b@amd.com>
  1 sibling, 0 replies; 37+ messages in thread
From: Das, Nirmoy @ 2021-10-08 12:08 UTC (permalink / raw)
  To: Greg KH, Jani Nikula
  Cc: dri-devel, intel-gfx, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter

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

[AMD Official Use Only]

Thanks, Greg and Jani. So I have to do the exact opposite.

We do have some NULL dentry check in the drm code. I will remove those instead.

Regards,
Nirmoy
________________________________
From: Greg KH <gregkh@linuxfoundation.org>
Sent: Friday, October 8, 2021 1:07 PM
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Das, Nirmoy <Nirmoy.Das@amd.com>; dri-devel@lists.freedesktop.org <dri-devel@lists.freedesktop.org>; intel-gfx@lists.freedesktop.org <intel-gfx@lists.freedesktop.org>; Maarten Lankhorst <maarten.lankhorst@linux.intel.com>; Maxime Ripard <mripard@kernel.org>; Thomas Zimmermann <tzimmermann@suse.de>; David Airlie <airlied@linux.ie>; Daniel Vetter <daniel@ffwll.ch>
Subject: Re: [Intel-gfx] [PATCH 1/5] dri: cleanup debugfs error handling

On Fri, Oct 08, 2021 at 12:40:47PM +0300, Jani Nikula wrote:
> On Fri, 08 Oct 2021, Nirmoy Das <nirmoy.das@amd.com> wrote:
> > Debugfs API returns encoded error instead of NULL.
> > This patch cleanups drm debugfs error handling to
> > properly set dri and its minor's root dentry to NULL.
> >
> > Also do not error out if dri/minor debugfs directory
> > creation fails as a debugfs error is not a fatal error.
>
> Cc: Greg
>
> I thought this is the opposite of what Greg's been telling everyone to
> do with debugfs.

Yes, that is not good.

You should never care about the result of a debugfs_create* call.  Just
take the result, and if it is a directory, save it off to use it for
creating a file, no need to check anything.

And then throw it away, later, when you want to remove the directory,
look it up with a call to debugfs_lookup() and pass that to
debugfs_remove() (which does so recursively).

There should never be a need to save, or check, the result of any
debugfs call.  If so, odds are it is being used incorrectly.

thanks,

greg k-h

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

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

* Fw: [Intel-gfx] [PATCH 1/5] dri: cleanup debugfs error handling
       [not found]     ` <02fc9da3-ebac-2df1-3a54-d764b273f91b@amd.com>
@ 2021-10-08 12:56       ` Das, Nirmoy
       [not found]         ` <c4f1464d-19b6-04a3-e2d8-a153bfbb050a@amd.com>
  0 siblings, 1 reply; 37+ messages in thread
From: Das, Nirmoy @ 2021-10-08 12:56 UTC (permalink / raw)
  To: Christian König; +Cc: dri-devel, Koenig, Christian, Greg KH, Jani Nikula

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

[AMD Official Use Only]

Trying with Christian's Gmail, as he still didn't receive previous emails.

________________________________
From: Das, Nirmoy <nirmoy.das@amd.com>
Sent: Friday, October 8, 2021 2:17 PM
To: Koenig, Christian <Christian.Koenig@amd.com>
Cc: dri-devel@lists.freedesktop.org <dri-devel@lists.freedesktop.org>; intel-gfx@lists.freedesktop.org <intel-gfx@lists.freedesktop.org>; Maarten Lankhorst <maarten.lankhorst@linux.intel.com>; Maxime Ripard <mripard@kernel.org>; Thomas Zimmermann <tzimmermann@suse.de>; David Airlie <airlied@linux.ie>; Daniel Vetter <daniel@ffwll.ch>; Greg KH <gregkh@linuxfoundation.org>; Jani Nikula <jani.nikula@linux.intel.com>
Subject: Re: [Intel-gfx] [PATCH 1/5] dri: cleanup debugfs error handling

Adding Christian as he didn't receive the full thread yet.


On 10/8/2021 1:07 PM, Greg KH wrote:
> On Fri, Oct 08, 2021 at 12:40:47PM +0300, Jani Nikula wrote:
>> On Fri, 08 Oct 2021, Nirmoy Das <nirmoy.das@amd.com> wrote:
>>> Debugfs API returns encoded error instead of NULL.
>>> This patch cleanups drm debugfs error handling to
>>> properly set dri and its minor's root dentry to NULL.
>>>
>>> Also do not error out if dri/minor debugfs directory
>>> creation fails as a debugfs error is not a fatal error.
>> Cc: Greg
>>
>> I thought this is the opposite of what Greg's been telling everyone to
>> do with debugfs.
> Yes, that is not good.
>
> You should never care about the result of a debugfs_create* call.  Just
> take the result, and if it is a directory, save it off to use it for
> creating a file, no need to check anything.
>
> And then throw it away, later, when you want to remove the directory,
> look it up with a call to debugfs_lookup() and pass that to
> debugfs_remove() (which does so recursively).
>
> There should never be a need to save, or check, the result of any
> debugfs call.  If so, odds are it is being used incorrectly.
>
> thanks,
>
> greg k-h

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

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

* [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/5] dri: cleanup debugfs error handling
  2021-10-08  9:17 ` [Intel-gfx] " Nirmoy Das
                   ` (6 preceding siblings ...)
  (?)
@ 2021-10-08 14:09 ` Patchwork
  -1 siblings, 0 replies; 37+ messages in thread
From: Patchwork @ 2021-10-08 14:09 UTC (permalink / raw)
  To: Das, Nirmoy; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/5] dri: cleanup debugfs error handling
URL   : https://patchwork.freedesktop.org/series/95602/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
59b65376d0a0 dri: cleanup debugfs error handling
-:40: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#40: FILE: drivers/gpu/drm/drm_debugfs.c:210:
+void drm_debugfs_init(struct drm_minor *minor, int minor_id,
 		     struct dentry *root)

-:56: CHECK:LINE_SPACING: Please don't use multiple blank lines
#56: FILE: drivers/gpu/drm/drm_debugfs.c:227:
+
+

-:148: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#148: FILE: drivers/gpu/drm/drm_internal.h:195:
+static inline void drm_debugfs_init(struct drm_minor *minor, int minor_id,
 				   struct dentry *root)

total: 0 errors, 0 warnings, 3 checks, 112 lines checked
0ba632f15232 drm/i915: check dri root before debugfs init
348cf9dba853 drm/radeon: check dri root before debugfs init
55b24b7a29aa drm/armada: check dri/crtc root before debugfs init
6f112fc8a5fd drm/tegra: check root dentry before debugfs init



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

* [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/5] dri: cleanup debugfs error handling
  2021-10-08  9:17 ` [Intel-gfx] " Nirmoy Das
                   ` (7 preceding siblings ...)
  (?)
@ 2021-10-08 14:10 ` Patchwork
  -1 siblings, 0 replies; 37+ messages in thread
From: Patchwork @ 2021-10-08 14:10 UTC (permalink / raw)
  To: Das, Nirmoy; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/5] dri: cleanup debugfs error handling
URL   : https://patchwork.freedesktop.org/series/95602/
State : warning

== Summary ==

$ dim sparse --fast origin/drm-tip
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
-
+drivers/gpu/drm/drm_drv.c:421:6: warning: context imbalance in 'drm_dev_enter' - different lock contexts for basic block
+./include/linux/seqlock.h:840:24: warning: trying to copy expression type 31
+./include/linux/seqlock.h:840:24: warning: trying to copy expression type 31
+./include/linux/seqlock.h:866:16: warning: trying to copy expression type 31
+./include/linux/srcu.h:188:9: warning: context imbalance in 'drm_dev_exit' - unexpected unlock



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

* [Intel-gfx] ✗ Fi.CI.IGT: failure for series starting with [1/5] dri: cleanup debugfs error handling
  2021-10-08  9:17 ` [Intel-gfx] " Nirmoy Das
                   ` (8 preceding siblings ...)
  (?)
@ 2021-10-08 19:18 ` Patchwork
  -1 siblings, 0 replies; 37+ messages in thread
From: Patchwork @ 2021-10-08 19:18 UTC (permalink / raw)
  To: Das, Nirmoy; +Cc: intel-gfx

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

== Series Details ==

Series: series starting with [1/5] dri: cleanup debugfs error handling
URL   : https://patchwork.freedesktop.org/series/95602/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_10699_full -> Patchwork_21290_full
====================================================

Summary
-------

  **FAILURE**

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

  

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@i915_pm_dc@dc9-dpms:
    - shard-tglb:         NOTRUN -> [SKIP][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-tglb2/igt@i915_pm_dc@dc9-dpms.html

  * igt@i915_suspend@debugfs-reader:
    - shard-kbl:          [PASS][2] -> [INCOMPLETE][3]
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-kbl2/igt@i915_suspend@debugfs-reader.html
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl3/igt@i915_suspend@debugfs-reader.html

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_create@create-massive:
    - shard-apl:          NOTRUN -> [DMESG-WARN][4] ([i915#3002])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl1/igt@gem_create@create-massive.html

  * igt@gem_ctx_persistence@legacy-engines-mixed-process:
    - shard-snb:          NOTRUN -> [SKIP][5] ([fdo#109271] / [i915#1099]) +5 similar issues
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-snb5/igt@gem_ctx_persistence@legacy-engines-mixed-process.html

  * igt@gem_eio@unwedge-stress:
    - shard-snb:          NOTRUN -> [FAIL][6] ([i915#3354])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-snb5/igt@gem_eio@unwedge-stress.html

  * igt@gem_exec_fair@basic-none@rcs0:
    - shard-glk:          [PASS][7] -> [FAIL][8] ([i915#2842])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-glk5/igt@gem_exec_fair@basic-none@rcs0.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-glk8/igt@gem_exec_fair@basic-none@rcs0.html

  * igt@gem_exec_fair@basic-none@vcs0:
    - shard-kbl:          [PASS][9] -> [FAIL][10] ([i915#2842]) +1 similar issue
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-kbl4/igt@gem_exec_fair@basic-none@vcs0.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl7/igt@gem_exec_fair@basic-none@vcs0.html
    - shard-apl:          NOTRUN -> [FAIL][11] ([i915#2842])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl1/igt@gem_exec_fair@basic-none@vcs0.html

  * igt@gem_exec_fair@basic-pace@bcs0:
    - shard-tglb:         [PASS][12] -> [FAIL][13] ([i915#2842]) +1 similar issue
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-tglb3/igt@gem_exec_fair@basic-pace@bcs0.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-tglb1/igt@gem_exec_fair@basic-pace@bcs0.html

  * igt@gem_exec_fair@basic-throttle@rcs0:
    - shard-iclb:         [PASS][14] -> [FAIL][15] ([i915#2849])
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-iclb7/igt@gem_exec_fair@basic-throttle@rcs0.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-iclb1/igt@gem_exec_fair@basic-throttle@rcs0.html

  * igt@gem_exec_whisper@basic-queues-priority:
    - shard-glk:          [PASS][16] -> [DMESG-WARN][17] ([i915#118])
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-glk6/igt@gem_exec_whisper@basic-queues-priority.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-glk9/igt@gem_exec_whisper@basic-queues-priority.html

  * igt@gem_huc_copy@huc-copy:
    - shard-apl:          NOTRUN -> [SKIP][18] ([fdo#109271] / [i915#2190])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl7/igt@gem_huc_copy@huc-copy.html

  * igt@gem_pread@exhaustion:
    - shard-apl:          NOTRUN -> [WARN][19] ([i915#2658])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl2/igt@gem_pread@exhaustion.html

  * igt@gem_pwrite@basic-exhaustion:
    - shard-kbl:          NOTRUN -> [WARN][20] ([i915#2658])
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl4/igt@gem_pwrite@basic-exhaustion.html

  * igt@gem_userptr_blits@dmabuf-sync:
    - shard-apl:          NOTRUN -> [SKIP][21] ([fdo#109271] / [i915#3323])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl2/igt@gem_userptr_blits@dmabuf-sync.html

  * igt@gem_userptr_blits@vma-merge:
    - shard-apl:          NOTRUN -> [FAIL][22] ([i915#3318])
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl1/igt@gem_userptr_blits@vma-merge.html

  * igt@i915_selftest@live@hangcheck:
    - shard-snb:          [PASS][23] -> [INCOMPLETE][24] ([i915#3921])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-snb5/igt@i915_selftest@live@hangcheck.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-snb7/igt@i915_selftest@live@hangcheck.html

  * igt@i915_suspend@fence-restore-tiled2untiled:
    - shard-skl:          [PASS][25] -> [INCOMPLETE][26] ([i915#198])
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-skl3/igt@i915_suspend@fence-restore-tiled2untiled.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-skl5/igt@i915_suspend@fence-restore-tiled2untiled.html

  * igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-180-hflip:
    - shard-apl:          NOTRUN -> [SKIP][27] ([fdo#109271] / [i915#3777]) +2 similar issues
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl7/igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-180-hflip.html

  * igt@kms_big_fb@yf-tiled-max-hw-stride-32bpp-rotate-180-hflip:
    - shard-kbl:          NOTRUN -> [SKIP][28] ([fdo#109271] / [i915#3777])
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl2/igt@kms_big_fb@yf-tiled-max-hw-stride-32bpp-rotate-180-hflip.html

  * igt@kms_ccs@pipe-a-missing-ccs-buffer-y_tiled_gen12_rc_ccs_cc:
    - shard-apl:          NOTRUN -> [SKIP][29] ([fdo#109271] / [i915#3886]) +18 similar issues
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl8/igt@kms_ccs@pipe-a-missing-ccs-buffer-y_tiled_gen12_rc_ccs_cc.html

  * igt@kms_ccs@pipe-b-missing-ccs-buffer-y_tiled_gen12_rc_ccs_cc:
    - shard-kbl:          NOTRUN -> [SKIP][30] ([fdo#109271] / [i915#3886]) +4 similar issues
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl4/igt@kms_ccs@pipe-b-missing-ccs-buffer-y_tiled_gen12_rc_ccs_cc.html

  * igt@kms_ccs@pipe-c-missing-ccs-buffer-y_tiled_gen12_mc_ccs:
    - shard-skl:          NOTRUN -> [SKIP][31] ([fdo#109271] / [i915#3886])
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-skl6/igt@kms_ccs@pipe-c-missing-ccs-buffer-y_tiled_gen12_mc_ccs.html

  * igt@kms_chamelium@hdmi-hpd-with-enabled-mode:
    - shard-snb:          NOTRUN -> [SKIP][32] ([fdo#109271] / [fdo#111827]) +13 similar issues
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-snb2/igt@kms_chamelium@hdmi-hpd-with-enabled-mode.html

  * igt@kms_chamelium@vga-hpd:
    - shard-apl:          NOTRUN -> [SKIP][33] ([fdo#109271] / [fdo#111827]) +22 similar issues
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl8/igt@kms_chamelium@vga-hpd.html

  * igt@kms_color@pipe-b-ctm-0-75:
    - shard-skl:          [PASS][34] -> [DMESG-WARN][35] ([i915#1982])
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-skl7/igt@kms_color@pipe-b-ctm-0-75.html
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-skl4/igt@kms_color@pipe-b-ctm-0-75.html

  * igt@kms_color_chamelium@pipe-b-ctm-0-5:
    - shard-kbl:          NOTRUN -> [SKIP][36] ([fdo#109271] / [fdo#111827]) +4 similar issues
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl4/igt@kms_color_chamelium@pipe-b-ctm-0-5.html

  * igt@kms_color_chamelium@pipe-b-ctm-0-75:
    - shard-skl:          NOTRUN -> [SKIP][37] ([fdo#109271] / [fdo#111827])
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-skl6/igt@kms_color_chamelium@pipe-b-ctm-0-75.html

  * igt@kms_content_protection@srm:
    - shard-apl:          NOTRUN -> [TIMEOUT][38] ([i915#1319])
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl8/igt@kms_content_protection@srm.html

  * igt@kms_cursor_crc@pipe-c-cursor-suspend:
    - shard-kbl:          [PASS][39] -> [DMESG-WARN][40] ([i915#180]) +1 similar issue
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-kbl1/igt@kms_cursor_crc@pipe-c-cursor-suspend.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl6/igt@kms_cursor_crc@pipe-c-cursor-suspend.html

  * igt@kms_cursor_crc@pipe-d-cursor-512x170-rapid-movement:
    - shard-tglb:         NOTRUN -> [SKIP][41] ([i915#3359])
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-tglb2/igt@kms_cursor_crc@pipe-d-cursor-512x170-rapid-movement.html

  * igt@kms_cursor_legacy@flip-vs-cursor-legacy:
    - shard-skl:          [PASS][42] -> [FAIL][43] ([i915#2346]) +1 similar issue
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-skl10/igt@kms_cursor_legacy@flip-vs-cursor-legacy.html
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-skl3/igt@kms_cursor_legacy@flip-vs-cursor-legacy.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible@c-hdmi-a1:
    - shard-glk:          [PASS][44] -> [FAIL][45] ([i915#2122])
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-glk4/igt@kms_flip@flip-vs-expired-vblank-interruptible@c-hdmi-a1.html
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-glk9/igt@kms_flip@flip-vs-expired-vblank-interruptible@c-hdmi-a1.html

  * igt@kms_flip@flip-vs-suspend-interruptible@c-dp1:
    - shard-kbl:          NOTRUN -> [DMESG-WARN][46] ([i915#180]) +2 similar issues
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl4/igt@kms_flip@flip-vs-suspend-interruptible@c-dp1.html

  * igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-32bpp-ytile:
    - shard-iclb:         [PASS][47] -> [SKIP][48] ([i915#3701]) +1 similar issue
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-iclb3/igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-32bpp-ytile.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-iclb2/igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-32bpp-ytile.html

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-pri-indfb-draw-pwrite:
    - shard-snb:          NOTRUN -> [SKIP][49] ([fdo#109271]) +273 similar issues
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-snb5/igt@kms_frontbuffer_tracking@fbc-2p-primscrn-pri-indfb-draw-pwrite.html

  * igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-indfb-plflip-blt:
    - shard-skl:          NOTRUN -> [SKIP][50] ([fdo#109271]) +4 similar issues
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-skl6/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-indfb-plflip-blt.html

  * igt@kms_frontbuffer_tracking@fbc-suspend:
    - shard-apl:          NOTRUN -> [DMESG-WARN][51] ([i915#180])
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl2/igt@kms_frontbuffer_tracking@fbc-suspend.html

  * igt@kms_frontbuffer_tracking@psr-rgb101010-draw-mmap-wc:
    - shard-kbl:          NOTRUN -> [SKIP][52] ([fdo#109271]) +82 similar issues
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl4/igt@kms_frontbuffer_tracking@psr-rgb101010-draw-mmap-wc.html

  * igt@kms_pipe_crc_basic@disable-crc-after-crtc-pipe-d:
    - shard-kbl:          NOTRUN -> [SKIP][53] ([fdo#109271] / [i915#533])
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl4/igt@kms_pipe_crc_basic@disable-crc-after-crtc-pipe-d.html

  * igt@kms_plane_alpha_blend@pipe-a-alpha-transparent-fb:
    - shard-apl:          NOTRUN -> [FAIL][54] ([i915#265])
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl1/igt@kms_plane_alpha_blend@pipe-a-alpha-transparent-fb.html

  * igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
    - shard-skl:          [PASS][55] -> [FAIL][56] ([fdo#108145] / [i915#265])
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-skl7/igt@kms_plane_alpha_blend@pipe-a-coverage-7efc.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-skl9/igt@kms_plane_alpha_blend@pipe-a-coverage-7efc.html

  * igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max:
    - shard-apl:          NOTRUN -> [FAIL][57] ([fdo#108145] / [i915#265]) +1 similar issue
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl2/igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max.html

  * igt@kms_plane_alpha_blend@pipe-c-alpha-basic:
    - shard-kbl:          NOTRUN -> [FAIL][58] ([fdo#108145] / [i915#265])
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl4/igt@kms_plane_alpha_blend@pipe-c-alpha-basic.html

  * igt@kms_plane_alpha_blend@pipe-c-alpha-transparent-fb:
    - shard-kbl:          NOTRUN -> [FAIL][59] ([i915#265])
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl4/igt@kms_plane_alpha_blend@pipe-c-alpha-transparent-fb.html

  * igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-4:
    - shard-apl:          NOTRUN -> [SKIP][60] ([fdo#109271] / [i915#658]) +5 similar issues
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl7/igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-4.html

  * igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-1:
    - shard-kbl:          NOTRUN -> [SKIP][61] ([fdo#109271] / [i915#658]) +1 similar issue
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl4/igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-1.html

  * igt@kms_psr@psr2_cursor_plane_move:
    - shard-iclb:         [PASS][62] -> [SKIP][63] ([fdo#109441]) +1 similar issue
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-iclb2/igt@kms_psr@psr2_cursor_plane_move.html
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-iclb5/igt@kms_psr@psr2_cursor_plane_move.html

  * igt@kms_setmode@basic:
    - shard-snb:          NOTRUN -> [FAIL][64] ([i915#31])
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-snb2/igt@kms_setmode@basic.html

  * igt@kms_sysfs_edid_timing:
    - shard-apl:          NOTRUN -> [FAIL][65] ([IGT#2])
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl8/igt@kms_sysfs_edid_timing.html

  * igt@kms_vblank@pipe-d-ts-continuation-idle:
    - shard-apl:          NOTRUN -> [SKIP][66] ([fdo#109271]) +299 similar issues
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl7/igt@kms_vblank@pipe-d-ts-continuation-idle.html

  * igt@kms_vblank@pipe-d-wait-idle:
    - shard-apl:          NOTRUN -> [SKIP][67] ([fdo#109271] / [i915#533]) +1 similar issue
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl7/igt@kms_vblank@pipe-d-wait-idle.html

  * igt@perf@blocking:
    - shard-skl:          [PASS][68] -> [FAIL][69] ([i915#1542])
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-skl6/igt@perf@blocking.html
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-skl7/igt@perf@blocking.html

  * igt@perf@polling-small-buf:
    - shard-skl:          [PASS][70] -> [FAIL][71] ([i915#1722])
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-skl1/igt@perf@polling-small-buf.html
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-skl7/igt@perf@polling-small-buf.html

  * igt@sysfs_clients@fair-0:
    - shard-apl:          NOTRUN -> [SKIP][72] ([fdo#109271] / [i915#2994]) +4 similar issues
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl1/igt@sysfs_clients@fair-0.html

  * igt@sysfs_clients@recycle-many:
    - shard-kbl:          NOTRUN -> [SKIP][73] ([fdo#109271] / [i915#2994])
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl4/igt@sysfs_clients@recycle-many.html

  
#### Possible fixes ####

  * igt@gem_exec_fair@basic-none@vecs0:
    - shard-kbl:          [FAIL][74] ([i915#2842]) -> [PASS][75] +1 similar issue
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-kbl4/igt@gem_exec_fair@basic-none@vecs0.html
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl7/igt@gem_exec_fair@basic-none@vecs0.html

  * igt@gem_exec_fair@basic-pace-share@rcs0:
    - shard-tglb:         [FAIL][76] ([i915#2842]) -> [PASS][77] +1 similar issue
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-tglb6/igt@gem_exec_fair@basic-pace-share@rcs0.html
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-tglb8/igt@gem_exec_fair@basic-pace-share@rcs0.html

  * igt@gem_exec_fair@basic-throttle@rcs0:
    - shard-glk:          [FAIL][78] ([i915#2842]) -> [PASS][79] +1 similar issue
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-glk3/igt@gem_exec_fair@basic-throttle@rcs0.html
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-glk5/igt@gem_exec_fair@basic-throttle@rcs0.html

  * igt@gem_sync@basic-many-each:
    - shard-kbl:          [INCOMPLETE][80] ([i915#4274]) -> [PASS][81]
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-kbl7/igt@gem_sync@basic-many-each.html
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl6/igt@gem_sync@basic-many-each.html

  * igt@i915_pm_dc@dc6-dpms:
    - shard-iclb:         [FAIL][82] ([i915#454]) -> [PASS][83]
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-iclb3/igt@i915_pm_dc@dc6-dpms.html
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-iclb2/igt@i915_pm_dc@dc6-dpms.html

  * igt@i915_pm_dc@dc9-dpms:
    - shard-iclb:         [SKIP][84] -> [PASS][85]
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-iclb3/igt@i915_pm_dc@dc9-dpms.html
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-iclb7/igt@i915_pm_dc@dc9-dpms.html

  * igt@i915_suspend@forcewake:
    - shard-kbl:          [DMESG-WARN][86] ([i915#180]) -> [PASS][87] +1 similar issue
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-kbl7/igt@i915_suspend@forcewake.html
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl4/igt@i915_suspend@forcewake.html

  * igt@kms_big_fb@x-tiled-32bpp-rotate-180:
    - shard-glk:          [DMESG-WARN][88] ([i915#118]) -> [PASS][89]
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-glk3/igt@kms_big_fb@x-tiled-32bpp-rotate-180.html
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-glk5/igt@kms_big_fb@x-tiled-32bpp-rotate-180.html

  * igt@kms_flip@flip-vs-suspend-interruptible@b-edp1:
    - shard-skl:          [INCOMPLETE][90] ([i915#146] / [i915#198]) -> [PASS][91]
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-skl3/igt@kms_flip@flip-vs-suspend-interruptible@b-edp1.html
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-skl6/igt@kms_flip@flip-vs-suspend-interruptible@b-edp1.html

  * igt@kms_flip@flip-vs-suspend-interruptible@c-dp1:
    - shard-apl:          [DMESG-WARN][92] ([i915#180]) -> [PASS][93] +2 similar issues
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-apl8/igt@kms_flip@flip-vs-suspend-interruptible@c-dp1.html
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl1/igt@kms_flip@flip-vs-suspend-interruptible@c-dp1.html

  * igt@kms_flip@plain-flip-fb-recreate-interruptible@c-edp1:
    - shard-skl:          [FAIL][94] ([i915#2122]) -> [PASS][95] +1 similar issue
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-skl2/igt@kms_flip@plain-flip-fb-recreate-interruptible@c-edp1.html
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-skl8/igt@kms_flip@plain-flip-fb-recreate-interruptible@c-edp1.html

  * igt@kms_hdr@bpc-switch-dpms:
    - shard-skl:          [FAIL][96] ([i915#1188]) -> [PASS][97]
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-skl3/igt@kms_hdr@bpc-switch-dpms.html
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-skl6/igt@kms_hdr@bpc-switch-dpms.html

  * igt@kms_plane_alpha_blend@pipe-b-coverage-7efc:
    - shard-skl:          [FAIL][98] ([fdo#108145] / [i915#265]) -> [PASS][99] +2 similar issues
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-skl7/igt@kms_plane_alpha_blend@pipe-b-coverage-7efc.html
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-skl9/igt@kms_plane_alpha_blend@pipe-b-coverage-7efc.html

  * igt@kms_psr@psr2_primary_page_flip:
    - shard-iclb:         [SKIP][100] ([fdo#109441]) -> [PASS][101] +1 similar issue
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-iclb1/igt@kms_psr@psr2_primary_page_flip.html
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-iclb2/igt@kms_psr@psr2_primary_page_flip.html

  * igt@kms_vblank@pipe-a-ts-continuation-suspend:
    - shard-kbl:          [DMESG-WARN][102] ([i915#180] / [i915#295]) -> [PASS][103]
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-kbl6/igt@kms_vblank@pipe-a-ts-continuation-suspend.html
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl4/igt@kms_vblank@pipe-a-ts-continuation-suspend.html

  
#### Warnings ####

  * igt@gem_exec_fair@basic-none-rrul@rcs0:
    - shard-iclb:         [FAIL][104] ([i915#2842]) -> [FAIL][105] ([i915#2852])
   [104]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-iclb8/igt@gem_exec_fair@basic-none-rrul@rcs0.html
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-iclb8/igt@gem_exec_fair@basic-none-rrul@rcs0.html

  * igt@i915_pm_rc6_residency@rc6-fence:
    - shard-iclb:         [WARN][106] ([i915#1804] / [i915#2684]) -> [WARN][107] ([i915#2684])
   [106]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-iclb7/igt@i915_pm_rc6_residency@rc6-fence.html
   [107]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-iclb1/igt@i915_pm_rc6_residency@rc6-fence.html

  * igt@i915_pm_rc6_residency@rc6-idle:
    - shard-iclb:         [WARN][108] ([i915#2684]) -> [WARN][109] ([i915#1804] / [i915#2684])
   [108]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-iclb1/igt@i915_pm_rc6_residency@rc6-idle.html
   [109]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-iclb7/igt@i915_pm_rc6_residency@rc6-idle.html

  * igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-1:
    - shard-iclb:         [SKIP][110] ([i915#2920]) -> [SKIP][111] ([i915#658]) +3 similar issues
   [110]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-iclb2/igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-1.html
   [111]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-iclb5/igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-1.html

  * igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-2:
    - shard-iclb:         [SKIP][112] ([i915#658]) -> [SKIP][113] ([i915#2920])
   [112]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-iclb1/igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-2.html
   [113]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-iclb2/igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area-2.html

  * igt@runner@aborted:
    - shard-kbl:          ([FAIL][114], [FAIL][115], [FAIL][116], [FAIL][117], [FAIL][118], [FAIL][119], [FAIL][120], [FAIL][121]) ([i915#180] / [i915#1814] / [i915#2426] / [i915#3002] / [i915#3363] / [i915#602]) -> ([FAIL][122], [FAIL][123], [FAIL][124], [FAIL][125], [FAIL][126], [FAIL][127], [FAIL][128]) ([i915#1436] / [i915#180] / [i915#1814] / [i915#3002] / [i915#3363] / [i915#602])
   [114]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-kbl6/igt@runner@aborted.html
   [115]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-kbl7/igt@runner@aborted.html
   [116]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-kbl7/igt@runner@aborted.html
   [117]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-kbl6/igt@runner@aborted.html
   [118]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-kbl6/igt@runner@aborted.html
   [119]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-kbl4/igt@runner@aborted.html
   [120]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-kbl6/igt@runner@aborted.html
   [121]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-kbl7/igt@runner@aborted.html
   [122]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl2/igt@runner@aborted.html
   [123]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl1/igt@runner@aborted.html
   [124]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl4/igt@runner@aborted.html
   [125]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl7/igt@runner@aborted.html
   [126]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl6/igt@runner@aborted.html
   [127]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl6/igt@runner@aborted.html
   [128]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-kbl7/igt@runner@aborted.html
    - shard-apl:          ([FAIL][129], [FAIL][130], [FAIL][131], [FAIL][132]) ([i915#1610] / [i915#180] / [i915#1814] / [i915#3002] / [i915#3363]) -> ([FAIL][133], [FAIL][134], [FAIL][135]) ([fdo#109271] / [i915#3002] / [i915#3363])
   [129]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-apl2/igt@runner@aborted.html
   [130]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-apl1/igt@runner@aborted.html
   [131]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-apl6/igt@runner@aborted.html
   [132]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-apl8/igt@runner@aborted.html
   [133]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl2/igt@runner@aborted.html
   [134]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl8/igt@runner@aborted.html
   [135]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-apl1/igt@runner@aborted.html
    - shard-skl:          ([FAIL][136], [FAIL][137], [FAIL][138]) ([i915#1436] / [i915#3002] / [i915#3363]) -> ([FAIL][139], [FAIL][140], [FAIL][141], [FAIL][142]) ([i915#1436] / [i915#2029] / [i915#3002] / [i915#3363])
   [136]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-skl7/igt@runner@aborted.html
   [137]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-skl2/igt@runner@aborted.html
   [138]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10699/shard-skl1/igt@runner@aborted.html
   [139]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-skl1/igt@runner@aborted.html
   [140]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-skl9/igt@runner@aborted.html
   [141]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-skl7/igt@runner@aborted.html
   [142]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21290/shard-skl3/igt@runner@aborted.html

  
  [IGT#2]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/2
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#1099]: https://gitlab.freedesktop.org/drm/intel/issues/1099
  [i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
  [i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
  [i915#1319]: https://gitlab.freedesktop.org/drm/intel/issues/1319
  [i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
  [i915#146]: https://gitlab.freedesktop.org/drm/intel/issues/146
  [i915#1542]: https://gitlab.freedesktop.org/drm/intel/issues/1542
  [i915#1610]: https://gitlab.freedesktop.org/drm/intel/issues/1610
  [i915#1722]: https://gitlab.freedesktop.org/drm/intel/issues/1722
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#1804]: https://gitlab.freedesktop.org/drm/intel/issues/1804
  [i915#1814]: https://gitlab.freedesktop.org/drm/intel/issues/1814
  [i915#198]: https://gitlab.freedesktop.org/drm/intel/issues/198
  [i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
  [i915#2029]: https://gitlab.freedesktop.org/drm/intel/issues/2029
  [i915#2122]: https://gitlab.freedesktop.org/drm/intel/issues/2122
  [i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
  [i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
  [i915#2426]: https://gitlab.freedesktop.org/drm/intel/issues/2426
  [i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
  [i915#2658]: https://gitlab.freedesktop.org/drm/intel/issues/2658
  [i915#2684]: https://gitlab.freedesktop.org/drm/intel/issues/2684
  [i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
  [i915#2849]: https://gitlab.freedesktop.org/drm/intel/issues/2849
  [i915#2852]: https://gitlab.freedesktop.org/drm/intel/issues/2852
  [i915#2920]: https://gitlab.freedesktop.org/drm/intel/issues/2920
  [i915#295]: https://gitlab.freedesktop.org/drm/intel/issues/295
  [i915#2994]: https://gitlab.freedesktop.org/drm/intel/issues/2994
  [i915#30

== Logs ==

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

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

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

* Re: Fw: [Intel-gfx] [PATCH 1/5] dri: cleanup debugfs error handling
       [not found]           ` <YWBfvILqkBQ8VSYc@kroah.com>
@ 2021-10-11 14:19             ` Christian König
  2021-10-11 14:53               ` Greg KH
  2021-10-11 15:13               ` Das, Nirmoy
  0 siblings, 2 replies; 37+ messages in thread
From: Christian König @ 2021-10-11 14:19 UTC (permalink / raw)
  To: Greg KH, Christian König; +Cc: Das, Nirmoy, dri-devel, Jani Nikula

Am 08.10.21 um 17:11 schrieb Greg KH:
> On Fri, Oct 08, 2021 at 04:22:06PM +0200, Christian König wrote:
>> Hi guys,
>>
>> thanks Nirmoy for forwarding this, there is seriously something wrong with
>> the AMD mail servers.
>>
>>> On 10/8/2021 1:07 PM, Greg KH wrote:
>>>> On Fri, Oct 08, 2021 at 12:40:47PM +0300, Jani Nikula wrote:
>>>>> On Fri, 08 Oct 2021, Nirmoy Das <nirmoy.das@amd.com> wrote:
>>>>>> Debugfs API returns encoded error instead of NULL.
>>>>>> This patch cleanups drm debugfs error handling to
>>>>>> properly set dri and its minor's root dentry to NULL.
>>>>>>
>>>>>> Also do not error out if dri/minor debugfs directory
>>>>>> creation fails as a debugfs error is not a fatal error.
>>>>> Cc: Greg
>>>>>
>>>>> I thought this is the opposite of what Greg's been telling everyone to
>>>>> do with debugfs.
>>>> Yes, that is not good.
>>>>
>>>> You should never care about the result of a debugfs_create* call.  Just
>>>> take the result, and if it is a directory, save it off to use it for
>>>> creating a file, no need to check anything.
>> While I totally agree to the intention behind that I'm pretty sure there are
>> some consequences which are a rather bad idea.
>>
>> First of all the debugfs functions return a normal struct dentry pointer and
>> keeping that around unchecked means that we now have pointers in structure
>> members which can suddenly be an ERR_PTR() without any documentation that
>> they are not real pointers.
>>
>> What we could do instead is something like returning a typedef or a
>> structure with the dentry pointer embedded and then document that those are
>> special, can be ERR_PTR() and should never be touched except for the debugfs
>> functions itself.
> I agree, and am slowly working toward that, but am not there yet.  If
> you look, I have removed the return values for almost all
> debugfs_create_* calls, only a few remain.
>
> For now, just treat it like a "void" pointer that you have no context
> for and all will be fine.

Ok in that case we should just document on the saved dentry that this 
pointer is not necessary valid.

Nirmoy, can you take care of that?

>> The other issue is that adding the same file twice is unfortunately a rather
>> common coding error which we don't catch or complain about any more if we
>> don't look at the return value at all.
> How can you add the same debugfs file twice?  You have different
> directories.

We had multiple occasions triggering that:

1. Code accidentally initializing a component twice.

Except for the debugfs entry and a bit memory leak we had no negative 
effect otherwise and wouldn't had detected that without the error 
message from debugfs.

2. Driver not cleaning up properly on hotplug. E.g. old subdirectory not 
properly removed and re-plug.

3. Driver trying to use the same debugfs file for different devices.

> And really, who cares, it's debugging code!  :)

Well especially cause 3 once took me a day to figure out that I'm 
looking at the wrong hardware state because the driver was handling two 
devices, but only one showed up under debugfs.

>>>> And then throw it away, later, when you want to remove the directory,
>>>> look it up with a call to debugfs_lookup() and pass that to
>>>> debugfs_remove() (which does so recursively).
>>>>
>>>> There should never be a need to save, or check, the result of any
>>>> debugfs call.  If so, odds are it is being used incorrectly.
>> Yeah, exactly that's the problem I see here.
>>
>> We save the return value because the DRM subsystem is creating a debugfs
>> directory for the drivers to use.
> That's fine for now, not a big deal.  And even if there is an error,
> again, you can always feed that error back into the debugfs subsystem on
> another call and it will handle it correctly.

Problem is it isn't, we have a crash because the member isn't a pointer 
but an ERR_PTR instead.

And adding IS_ERR checks all around is even worse than adding NULL checks.

Regards,
Christian.

>
> thanks,
>
> greg k-h


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

* Re: Fw: [Intel-gfx] [PATCH 1/5] dri: cleanup debugfs error handling
  2021-10-11 14:19             ` Christian König
@ 2021-10-11 14:53               ` Greg KH
  2021-10-11 16:38                 ` Jani Nikula
  2021-10-11 15:13               ` Das, Nirmoy
  1 sibling, 1 reply; 37+ messages in thread
From: Greg KH @ 2021-10-11 14:53 UTC (permalink / raw)
  To: Christian König
  Cc: Christian König, Das, Nirmoy, dri-devel, Jani Nikula

On Mon, Oct 11, 2021 at 04:19:58PM +0200, Christian König wrote:
> > > > > And then throw it away, later, when you want to remove the directory,
> > > > > look it up with a call to debugfs_lookup() and pass that to
> > > > > debugfs_remove() (which does so recursively).
> > > > > 
> > > > > There should never be a need to save, or check, the result of any
> > > > > debugfs call.  If so, odds are it is being used incorrectly.
> > > Yeah, exactly that's the problem I see here.
> > > 
> > > We save the return value because the DRM subsystem is creating a debugfs
> > > directory for the drivers to use.
> > That's fine for now, not a big deal.  And even if there is an error,
> > again, you can always feed that error back into the debugfs subsystem on
> > another call and it will handle it correctly.
> 
> Problem is it isn't, we have a crash because the member isn't a pointer but
> an ERR_PTR instead.

Again, that is fine, you can feed that into debugfs and it will "just
work".  Treat it as an opaque pointer, not a *dentry and you will be
fine.

thanks,

greg k-h

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

* Re: Fw: [Intel-gfx] [PATCH 1/5] dri: cleanup debugfs error handling
  2021-10-11 14:19             ` Christian König
  2021-10-11 14:53               ` Greg KH
@ 2021-10-11 15:13               ` Das, Nirmoy
  1 sibling, 0 replies; 37+ messages in thread
From: Das, Nirmoy @ 2021-10-11 15:13 UTC (permalink / raw)
  To: Christian König, Greg KH, Christian König
  Cc: dri-devel, Jani Nikula


On 10/11/2021 4:19 PM, Christian König wrote:
> Am 08.10.21 um 17:11 schrieb Greg KH:
>> On Fri, Oct 08, 2021 at 04:22:06PM +0200, Christian König wrote:
>>> Hi guys,
>>>
>>> thanks Nirmoy for forwarding this, there is seriously something 
>>> wrong with
>>> the AMD mail servers.
>>>
>>>> On 10/8/2021 1:07 PM, Greg KH wrote:
>>>>> On Fri, Oct 08, 2021 at 12:40:47PM +0300, Jani Nikula wrote:
>>>>>> On Fri, 08 Oct 2021, Nirmoy Das <nirmoy.das@amd.com> wrote:
>>>>>>> Debugfs API returns encoded error instead of NULL.
>>>>>>> This patch cleanups drm debugfs error handling to
>>>>>>> properly set dri and its minor's root dentry to NULL.
>>>>>>>
>>>>>>> Also do not error out if dri/minor debugfs directory
>>>>>>> creation fails as a debugfs error is not a fatal error.
>>>>>> Cc: Greg
>>>>>>
>>>>>> I thought this is the opposite of what Greg's been telling 
>>>>>> everyone to
>>>>>> do with debugfs.
>>>>> Yes, that is not good.
>>>>>
>>>>> You should never care about the result of a debugfs_create* call.  
>>>>> Just
>>>>> take the result, and if it is a directory, save it off to use it for
>>>>> creating a file, no need to check anything.
>>> While I totally agree to the intention behind that I'm pretty sure 
>>> there are
>>> some consequences which are a rather bad idea.
>>>
>>> First of all the debugfs functions return a normal struct dentry 
>>> pointer and
>>> keeping that around unchecked means that we now have pointers in 
>>> structure
>>> members which can suddenly be an ERR_PTR() without any documentation 
>>> that
>>> they are not real pointers.
>>>
>>> What we could do instead is something like returning a typedef or a
>>> structure with the dentry pointer embedded and then document that 
>>> those are
>>> special, can be ERR_PTR() and should never be touched except for the 
>>> debugfs
>>> functions itself.
>> I agree, and am slowly working toward that, but am not there yet.  If
>> you look, I have removed the return values for almost all
>> debugfs_create_* calls, only a few remain.
>>
>> For now, just treat it like a "void" pointer that you have no context
>> for and all will be fine.
>
> Ok in that case we should just document on the saved dentry that this 
> pointer is not necessary valid.
>
> Nirmoy, can you take care of that?


Sure, I will send patches to document and clean our drm core debugfs code.


Thanks,

Nirmoy


>
>>> The other issue is that adding the same file twice is unfortunately 
>>> a rather
>>> common coding error which we don't catch or complain about any more 
>>> if we
>>> don't look at the return value at all.
>> How can you add the same debugfs file twice?  You have different
>> directories.
>
> We had multiple occasions triggering that:
>
> 1. Code accidentally initializing a component twice.
>
> Except for the debugfs entry and a bit memory leak we had no negative 
> effect otherwise and wouldn't had detected that without the error 
> message from debugfs.
>
> 2. Driver not cleaning up properly on hotplug. E.g. old subdirectory 
> not properly removed and re-plug.
>
> 3. Driver trying to use the same debugfs file for different devices.
>
>> And really, who cares, it's debugging code!  :)
>
> Well especially cause 3 once took me a day to figure out that I'm 
> looking at the wrong hardware state because the driver was handling 
> two devices, but only one showed up under debugfs.
>
>>>>> And then throw it away, later, when you want to remove the directory,
>>>>> look it up with a call to debugfs_lookup() and pass that to
>>>>> debugfs_remove() (which does so recursively).
>>>>>
>>>>> There should never be a need to save, or check, the result of any
>>>>> debugfs call.  If so, odds are it is being used incorrectly.
>>> Yeah, exactly that's the problem I see here.
>>>
>>> We save the return value because the DRM subsystem is creating a 
>>> debugfs
>>> directory for the drivers to use.
>> That's fine for now, not a big deal.  And even if there is an error,
>> again, you can always feed that error back into the debugfs subsystem on
>> another call and it will handle it correctly.
>
> Problem is it isn't, we have a crash because the member isn't a 
> pointer but an ERR_PTR instead.
>
> And adding IS_ERR checks all around is even worse than adding NULL 
> checks.
>
> Regards,
> Christian.
>
>>
>> thanks,
>>
>> greg k-h
>

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

* Re: Fw: [Intel-gfx] [PATCH 1/5] dri: cleanup debugfs error handling
  2021-10-11 14:53               ` Greg KH
@ 2021-10-11 16:38                 ` Jani Nikula
  2021-10-11 17:07                   ` Greg KH
  0 siblings, 1 reply; 37+ messages in thread
From: Jani Nikula @ 2021-10-11 16:38 UTC (permalink / raw)
  To: Greg KH, Christian König
  Cc: Christian König, Das, Nirmoy, dri-devel

On Mon, 11 Oct 2021, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Mon, Oct 11, 2021 at 04:19:58PM +0200, Christian König wrote:
>> > > > > And then throw it away, later, when you want to remove the directory,
>> > > > > look it up with a call to debugfs_lookup() and pass that to
>> > > > > debugfs_remove() (which does so recursively).
>> > > > > 
>> > > > > There should never be a need to save, or check, the result of any
>> > > > > debugfs call.  If so, odds are it is being used incorrectly.
>> > > Yeah, exactly that's the problem I see here.
>> > > 
>> > > We save the return value because the DRM subsystem is creating a debugfs
>> > > directory for the drivers to use.
>> > That's fine for now, not a big deal.  And even if there is an error,
>> > again, you can always feed that error back into the debugfs subsystem on
>> > another call and it will handle it correctly.
>> 
>> Problem is it isn't, we have a crash because the member isn't a pointer but
>> an ERR_PTR instead.
>
> Again, that is fine, you can feed that into debugfs and it will "just
> work".  Treat it as an opaque pointer, not a *dentry and you will be
> fine.

Hmm, some of the patches add things like:

+
+	if (!root)
+		goto error;
+
	minor->debugfs_root = debugfs_create_dir(name, root);

Superficially this seems okay, as it looks like debugfs_create_dir()
doesn't actually cope with NULL values. However, since ->debugfs_root
comes from debugfs_create_dir() I presume it'll never be NULL on errors
anyway but rather an error pointer!

So I think we probably need to go through the drm subsystem and look for
existing similar patterns in fix them.

BR,
Jani.



>
> thanks,
>
> greg k-h

-- 
Jani Nikula, Intel Open Source Graphics Center

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

* Re: Fw: [Intel-gfx] [PATCH 1/5] dri: cleanup debugfs error handling
  2021-10-11 16:38                 ` Jani Nikula
@ 2021-10-11 17:07                   ` Greg KH
  2021-10-11 18:43                     ` Jani Nikula
  0 siblings, 1 reply; 37+ messages in thread
From: Greg KH @ 2021-10-11 17:07 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Christian König, Christian König, Das, Nirmoy, dri-devel

On Mon, Oct 11, 2021 at 07:38:22PM +0300, Jani Nikula wrote:
> On Mon, 11 Oct 2021, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Mon, Oct 11, 2021 at 04:19:58PM +0200, Christian König wrote:
> >> > > > > And then throw it away, later, when you want to remove the directory,
> >> > > > > look it up with a call to debugfs_lookup() and pass that to
> >> > > > > debugfs_remove() (which does so recursively).
> >> > > > > 
> >> > > > > There should never be a need to save, or check, the result of any
> >> > > > > debugfs call.  If so, odds are it is being used incorrectly.
> >> > > Yeah, exactly that's the problem I see here.
> >> > > 
> >> > > We save the return value because the DRM subsystem is creating a debugfs
> >> > > directory for the drivers to use.
> >> > That's fine for now, not a big deal.  And even if there is an error,
> >> > again, you can always feed that error back into the debugfs subsystem on
> >> > another call and it will handle it correctly.
> >> 
> >> Problem is it isn't, we have a crash because the member isn't a pointer but
> >> an ERR_PTR instead.
> >
> > Again, that is fine, you can feed that into debugfs and it will "just
> > work".  Treat it as an opaque pointer, not a *dentry and you will be
> > fine.
> 
> Hmm, some of the patches add things like:
> 
> +
> +	if (!root)
> +		goto error;
> +
> 	minor->debugfs_root = debugfs_create_dir(name, root);
> 
> Superficially this seems okay, as it looks like debugfs_create_dir()
> doesn't actually cope with NULL values.

Yes it does, it puts things at the root of debugfs.

But why are you checking for NULL here, as the return value of a debugfs
call can never be NULL?

> However, since ->debugfs_root
> comes from debugfs_create_dir() I presume it'll never be NULL on errors
> anyway but rather an error pointer!

That is correct.

> So I think we probably need to go through the drm subsystem and look for
> existing similar patterns in fix them.

Please do.  I know I made one pass at it a while ago but I think someone
else went through and cleaned them up again.

thanks,

greg k-h

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

* Re: Fw: [Intel-gfx] [PATCH 1/5] dri: cleanup debugfs error handling
  2021-10-11 17:07                   ` Greg KH
@ 2021-10-11 18:43                     ` Jani Nikula
  0 siblings, 0 replies; 37+ messages in thread
From: Jani Nikula @ 2021-10-11 18:43 UTC (permalink / raw)
  To: Greg KH
  Cc: Christian König, Christian König, Das, Nirmoy, dri-devel

On Mon, 11 Oct 2021, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Mon, Oct 11, 2021 at 07:38:22PM +0300, Jani Nikula wrote:
>> On Mon, 11 Oct 2021, Greg KH <gregkh@linuxfoundation.org> wrote:
>> > On Mon, Oct 11, 2021 at 04:19:58PM +0200, Christian König wrote:
>> >> > > > > And then throw it away, later, when you want to remove the directory,
>> >> > > > > look it up with a call to debugfs_lookup() and pass that to
>> >> > > > > debugfs_remove() (which does so recursively).
>> >> > > > > 
>> >> > > > > There should never be a need to save, or check, the result of any
>> >> > > > > debugfs call.  If so, odds are it is being used incorrectly.
>> >> > > Yeah, exactly that's the problem I see here.
>> >> > > 
>> >> > > We save the return value because the DRM subsystem is creating a debugfs
>> >> > > directory for the drivers to use.
>> >> > That's fine for now, not a big deal.  And even if there is an error,
>> >> > again, you can always feed that error back into the debugfs subsystem on
>> >> > another call and it will handle it correctly.
>> >> 
>> >> Problem is it isn't, we have a crash because the member isn't a pointer but
>> >> an ERR_PTR instead.
>> >
>> > Again, that is fine, you can feed that into debugfs and it will "just
>> > work".  Treat it as an opaque pointer, not a *dentry and you will be
>> > fine.
>> 
>> Hmm, some of the patches add things like:
>> 
>> +
>> +	if (!root)
>> +		goto error;
>> +
>> 	minor->debugfs_root = debugfs_create_dir(name, root);
>> 
>> Superficially this seems okay, as it looks like debugfs_create_dir()
>> doesn't actually cope with NULL values.
>
> Yes it does, it puts things at the root of debugfs.

Oh, thanks for the correction.

> But why are you checking for NULL here, as the return value of a debugfs
> call can never be NULL?

Just musing on what is going on in the patch, and why such changes
initially seem like good ideas and get through review.


Thanks,
Jani.


>
>> However, since ->debugfs_root
>> comes from debugfs_create_dir() I presume it'll never be NULL on errors
>> anyway but rather an error pointer!
>
> That is correct.
>
>> So I think we probably need to go through the drm subsystem and look for
>> existing similar patterns in fix them.
>
> Please do.  I know I made one pass at it a while ago but I think someone
> else went through and cleaned them up again.
>
> thanks,
>
> greg k-h

-- 
Jani Nikula, Intel Open Source Graphics Center

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

* Re: [PATCH 2/5] drm/i915: check dri root before debugfs init
  2021-10-08  9:17   ` [Intel-gfx] " Nirmoy Das
@ 2021-10-12  9:59     ` Wang, Zhi A
  -1 siblings, 0 replies; 37+ messages in thread
From: Wang, Zhi A @ 2021-10-12  9:59 UTC (permalink / raw)
  To: Nirmoy Das, dri-devel
  Cc: intel-gfx, Zhenyu Wang, Jani Nikula, Joonas Lahtinen, Vivi,
	Rodrigo, David Airlie, Daniel Vetter

On 10/8/21 9:17 AM, Nirmoy Das wrote:
> Return early if dri minor root dentry is NULL.
> 
> CC: Zhenyu Wang <zhenyuw@linux.intel.com>
> CC: Zhi Wang <zhi.a.wang@intel.com>
> CC: Jani Nikula <jani.nikula@linux.intel.com>
> CC: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> CC: Rodrigo Vivi <rodrigo.vivi@intel.com>
> CC: David Airlie <airlied@linux.ie>
> CC: Daniel Vetter <daniel@ffwll.ch>
> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
> ---
>   drivers/gpu/drm/i915/gvt/debugfs.c  | 3 +++
>   drivers/gpu/drm/i915/i915_debugfs.c | 3 +++
>   2 files changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/debugfs.c b/drivers/gpu/drm/i915/gvt/debugfs.c
> index 9f1c209d9251..2d47acaa03ee 100644
> --- a/drivers/gpu/drm/i915/gvt/debugfs.c
> +++ b/drivers/gpu/drm/i915/gvt/debugfs.c
> @@ -187,6 +187,9 @@ void intel_gvt_debugfs_init(struct intel_gvt *gvt)
>   {
>   	struct drm_minor *minor = gvt->gt->i915->drm.primary;
> 
> +	if (!minor->debugfs_root)
> +		return;
> +
>   	gvt->debugfs_root = debugfs_create_dir("gvt", minor->debugfs_root);
> 
>   	debugfs_create_ulong("num_tracked_mmio", 0444, gvt->debugfs_root,
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 44969f5dde50..d572b686edeb 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -1012,6 +1012,9 @@ void i915_debugfs_register(struct drm_i915_private *dev_priv)
>   	struct drm_minor *minor = dev_priv->drm.primary;
>   	int i;
> 
> +	if (!minor->debugfs_root)
> +		return;
> +
>   	i915_debugfs_params(dev_priv);
> 
>   	debugfs_create_file("i915_forcewake_user", S_IRUSR, minor->debugfs_root,
> --
> 2.32.0
> 
Thanks for the patch. queued.
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com>

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

* Re: [Intel-gfx] [PATCH 2/5] drm/i915: check dri root before debugfs init
@ 2021-10-12  9:59     ` Wang, Zhi A
  0 siblings, 0 replies; 37+ messages in thread
From: Wang, Zhi A @ 2021-10-12  9:59 UTC (permalink / raw)
  To: Nirmoy Das, dri-devel
  Cc: intel-gfx, Zhenyu Wang, Jani Nikula, Joonas Lahtinen, Vivi,
	Rodrigo, David Airlie, Daniel Vetter

On 10/8/21 9:17 AM, Nirmoy Das wrote:
> Return early if dri minor root dentry is NULL.
> 
> CC: Zhenyu Wang <zhenyuw@linux.intel.com>
> CC: Zhi Wang <zhi.a.wang@intel.com>
> CC: Jani Nikula <jani.nikula@linux.intel.com>
> CC: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> CC: Rodrigo Vivi <rodrigo.vivi@intel.com>
> CC: David Airlie <airlied@linux.ie>
> CC: Daniel Vetter <daniel@ffwll.ch>
> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
> ---
>   drivers/gpu/drm/i915/gvt/debugfs.c  | 3 +++
>   drivers/gpu/drm/i915/i915_debugfs.c | 3 +++
>   2 files changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/debugfs.c b/drivers/gpu/drm/i915/gvt/debugfs.c
> index 9f1c209d9251..2d47acaa03ee 100644
> --- a/drivers/gpu/drm/i915/gvt/debugfs.c
> +++ b/drivers/gpu/drm/i915/gvt/debugfs.c
> @@ -187,6 +187,9 @@ void intel_gvt_debugfs_init(struct intel_gvt *gvt)
>   {
>   	struct drm_minor *minor = gvt->gt->i915->drm.primary;
> 
> +	if (!minor->debugfs_root)
> +		return;
> +
>   	gvt->debugfs_root = debugfs_create_dir("gvt", minor->debugfs_root);
> 
>   	debugfs_create_ulong("num_tracked_mmio", 0444, gvt->debugfs_root,
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 44969f5dde50..d572b686edeb 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -1012,6 +1012,9 @@ void i915_debugfs_register(struct drm_i915_private *dev_priv)
>   	struct drm_minor *minor = dev_priv->drm.primary;
>   	int i;
> 
> +	if (!minor->debugfs_root)
> +		return;
> +
>   	i915_debugfs_params(dev_priv);
> 
>   	debugfs_create_file("i915_forcewake_user", S_IRUSR, minor->debugfs_root,
> --
> 2.32.0
> 
Thanks for the patch. queued.
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com>

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

* Re: [PATCH 2/5] drm/i915: check dri root before debugfs init
  2021-10-12  9:59     ` [Intel-gfx] " Wang, Zhi A
@ 2021-10-12 10:19       ` Das, Nirmoy
  -1 siblings, 0 replies; 37+ messages in thread
From: Das, Nirmoy @ 2021-10-12 10:19 UTC (permalink / raw)
  To: Wang, Zhi A, dri-devel
  Cc: intel-gfx, Zhenyu Wang, Jani Nikula, Joonas Lahtinen, Vivi,
	Rodrigo, David Airlie, Daniel Vetter

Hi Zhi,


Please discard this patch,  review 
https://patchwork.freedesktop.org/patch/458554/?series=95690&rev=1 instead.

minor->debugfs_root wont be NULl as we save debugfs_create_dir()'s return value in that.

Regards,
Nirmoy

On 10/12/2021 11:59 AM, Wang, Zhi A wrote:
> On 10/8/21 9:17 AM, Nirmoy Das wrote:
>> Return early if dri minor root dentry is NULL.
>>
>> CC: Zhenyu Wang <zhenyuw@linux.intel.com>
>> CC: Zhi Wang <zhi.a.wang@intel.com>
>> CC: Jani Nikula <jani.nikula@linux.intel.com>
>> CC: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> CC: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> CC: David Airlie <airlied@linux.ie>
>> CC: Daniel Vetter <daniel@ffwll.ch>
>> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
>> ---
>>    drivers/gpu/drm/i915/gvt/debugfs.c  | 3 +++
>>    drivers/gpu/drm/i915/i915_debugfs.c | 3 +++
>>    2 files changed, 6 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/gvt/debugfs.c b/drivers/gpu/drm/i915/gvt/debugfs.c
>> index 9f1c209d9251..2d47acaa03ee 100644
>> --- a/drivers/gpu/drm/i915/gvt/debugfs.c
>> +++ b/drivers/gpu/drm/i915/gvt/debugfs.c
>> @@ -187,6 +187,9 @@ void intel_gvt_debugfs_init(struct intel_gvt *gvt)
>>    {
>>    	struct drm_minor *minor = gvt->gt->i915->drm.primary;
>>
>> +	if (!minor->debugfs_root)
>> +		return;
>> +
>>    	gvt->debugfs_root = debugfs_create_dir("gvt", minor->debugfs_root);
>>
>>    	debugfs_create_ulong("num_tracked_mmio", 0444, gvt->debugfs_root,
>> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
>> index 44969f5dde50..d572b686edeb 100644
>> --- a/drivers/gpu/drm/i915/i915_debugfs.c
>> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
>> @@ -1012,6 +1012,9 @@ void i915_debugfs_register(struct drm_i915_private *dev_priv)
>>    	struct drm_minor *minor = dev_priv->drm.primary;
>>    	int i;
>>
>> +	if (!minor->debugfs_root)
>> +		return;
>> +
>>    	i915_debugfs_params(dev_priv);
>>
>>    	debugfs_create_file("i915_forcewake_user", S_IRUSR, minor->debugfs_root,
>> --
>> 2.32.0
>>
> Thanks for the patch. queued.
> Reviewed-by: Zhi Wang <zhi.a.wang@intel.com>

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

* Re: [Intel-gfx] [PATCH 2/5] drm/i915: check dri root before debugfs init
@ 2021-10-12 10:19       ` Das, Nirmoy
  0 siblings, 0 replies; 37+ messages in thread
From: Das, Nirmoy @ 2021-10-12 10:19 UTC (permalink / raw)
  To: Wang, Zhi A, dri-devel
  Cc: intel-gfx, Zhenyu Wang, Jani Nikula, Joonas Lahtinen, Vivi,
	Rodrigo, David Airlie, Daniel Vetter

Hi Zhi,


Please discard this patch,  review 
https://patchwork.freedesktop.org/patch/458554/?series=95690&rev=1 instead.

minor->debugfs_root wont be NULl as we save debugfs_create_dir()'s return value in that.

Regards,
Nirmoy

On 10/12/2021 11:59 AM, Wang, Zhi A wrote:
> On 10/8/21 9:17 AM, Nirmoy Das wrote:
>> Return early if dri minor root dentry is NULL.
>>
>> CC: Zhenyu Wang <zhenyuw@linux.intel.com>
>> CC: Zhi Wang <zhi.a.wang@intel.com>
>> CC: Jani Nikula <jani.nikula@linux.intel.com>
>> CC: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> CC: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> CC: David Airlie <airlied@linux.ie>
>> CC: Daniel Vetter <daniel@ffwll.ch>
>> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
>> ---
>>    drivers/gpu/drm/i915/gvt/debugfs.c  | 3 +++
>>    drivers/gpu/drm/i915/i915_debugfs.c | 3 +++
>>    2 files changed, 6 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/gvt/debugfs.c b/drivers/gpu/drm/i915/gvt/debugfs.c
>> index 9f1c209d9251..2d47acaa03ee 100644
>> --- a/drivers/gpu/drm/i915/gvt/debugfs.c
>> +++ b/drivers/gpu/drm/i915/gvt/debugfs.c
>> @@ -187,6 +187,9 @@ void intel_gvt_debugfs_init(struct intel_gvt *gvt)
>>    {
>>    	struct drm_minor *minor = gvt->gt->i915->drm.primary;
>>
>> +	if (!minor->debugfs_root)
>> +		return;
>> +
>>    	gvt->debugfs_root = debugfs_create_dir("gvt", minor->debugfs_root);
>>
>>    	debugfs_create_ulong("num_tracked_mmio", 0444, gvt->debugfs_root,
>> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
>> index 44969f5dde50..d572b686edeb 100644
>> --- a/drivers/gpu/drm/i915/i915_debugfs.c
>> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
>> @@ -1012,6 +1012,9 @@ void i915_debugfs_register(struct drm_i915_private *dev_priv)
>>    	struct drm_minor *minor = dev_priv->drm.primary;
>>    	int i;
>>
>> +	if (!minor->debugfs_root)
>> +		return;
>> +
>>    	i915_debugfs_params(dev_priv);
>>
>>    	debugfs_create_file("i915_forcewake_user", S_IRUSR, minor->debugfs_root,
>> --
>> 2.32.0
>>
> Thanks for the patch. queued.
> Reviewed-by: Zhi Wang <zhi.a.wang@intel.com>

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

* Re: [PATCH 4/5] drm/armada: check dri/crtc root before debugfs init
  2021-10-08  9:17   ` [Intel-gfx] " Nirmoy Das
@ 2021-10-12 19:40     ` kernel test robot
  -1 siblings, 0 replies; 37+ messages in thread
From: kernel test robot @ 2021-10-12 19:40 UTC (permalink / raw)
  To: Nirmoy Das, dri-devel
  Cc: llvm, kbuild-all, intel-gfx, Nirmoy Das, Russell King,
	David Airlie, Daniel Vetter

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

Hi Nirmoy,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on tegra/for-next drm-tip/drm-tip linus/master v5.15-rc5 next-20211012]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Nirmoy-Das/dri-cleanup-debugfs-error-handling/20211008-173312
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: arm-randconfig-r034-20211012 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c3dcf39554dbea780d6cb7e12239451ba47a2668)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://github.com/0day-ci/linux/commit/0c9a39f1265783134650d360585c60e0b1f64efe
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Nirmoy-Das/dri-cleanup-debugfs-error-handling/20211008-173312
        git checkout 0c9a39f1265783134650d360585c60e0b1f64efe
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/armada/armada_debugfs.c:111:3: error: non-void function 'armada_drm_debugfs_init' should return a value [-Wreturn-type]
                   return;
                   ^
   1 error generated.

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for QCOM_SCM
   Depends on (ARM || ARM64) && HAVE_ARM_SMCCC
   Selected by
   - ARM_QCOM_SPM_CPUIDLE && CPU_IDLE && (ARM || ARM64) && (ARCH_QCOM || COMPILE_TEST && !ARM64 && MMU


vim +/armada_drm_debugfs_init +111 drivers/gpu/drm/armada/armada_debugfs.c

   107	
   108	int armada_drm_debugfs_init(struct drm_minor *minor)
   109	{
   110		if (!minor->debugfs_root)
 > 111			return;

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 35834 bytes --]

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

* Re: [Intel-gfx] [PATCH 4/5] drm/armada: check dri/crtc root before debugfs init
@ 2021-10-12 19:40     ` kernel test robot
  0 siblings, 0 replies; 37+ messages in thread
From: kernel test robot @ 2021-10-12 19:40 UTC (permalink / raw)
  To: Nirmoy Das, dri-devel
  Cc: llvm, kbuild-all, intel-gfx, Nirmoy Das, Russell King,
	David Airlie, Daniel Vetter

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

Hi Nirmoy,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on tegra/for-next drm-tip/drm-tip linus/master v5.15-rc5 next-20211012]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Nirmoy-Das/dri-cleanup-debugfs-error-handling/20211008-173312
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: arm-randconfig-r034-20211012 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c3dcf39554dbea780d6cb7e12239451ba47a2668)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://github.com/0day-ci/linux/commit/0c9a39f1265783134650d360585c60e0b1f64efe
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Nirmoy-Das/dri-cleanup-debugfs-error-handling/20211008-173312
        git checkout 0c9a39f1265783134650d360585c60e0b1f64efe
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/armada/armada_debugfs.c:111:3: error: non-void function 'armada_drm_debugfs_init' should return a value [-Wreturn-type]
                   return;
                   ^
   1 error generated.

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for QCOM_SCM
   Depends on (ARM || ARM64) && HAVE_ARM_SMCCC
   Selected by
   - ARM_QCOM_SPM_CPUIDLE && CPU_IDLE && (ARM || ARM64) && (ARCH_QCOM || COMPILE_TEST && !ARM64 && MMU


vim +/armada_drm_debugfs_init +111 drivers/gpu/drm/armada/armada_debugfs.c

   107	
   108	int armada_drm_debugfs_init(struct drm_minor *minor)
   109	{
   110		if (!minor->debugfs_root)
 > 111			return;

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 35834 bytes --]

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

* Re: [PATCH 5/5] drm/tegra: check root dentry before debugfs init
  2021-10-08  9:17   ` [Intel-gfx] " Nirmoy Das
@ 2021-11-08  6:35     ` kernel test robot
  -1 siblings, 0 replies; 37+ messages in thread
From: kernel test robot @ 2021-11-08  6:35 UTC (permalink / raw)
  To: Nirmoy Das, dri-devel
  Cc: kbuild-all, David Airlie, intel-gfx, Nirmoy Das, Jonathan Hunter,
	Thierry Reding

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

Hi Nirmoy,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on tegra/for-next drm-tip/drm-tip linus/master v5.15 next-20211108]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Nirmoy-Das/dri-cleanup-debugfs-error-handling/20211008-173312
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: arm64-randconfig-r012-20211008 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/313e208057ad9c5d5de6c0fdb03fb575f71270e3
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Nirmoy-Das/dri-cleanup-debugfs-error-handling/20211008-173312
        git checkout 313e208057ad9c5d5de6c0fdb03fb575f71270e3
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/gpu/drm/tegra/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/gpu/drm/tegra/dc.c: In function 'tegra_dc_late_register':
>> drivers/gpu/drm/tegra/dc.c:1626:18: error: 'struct drm_crtc' has no member named 'debugfs_entry'
    1626 |         if (!crtc->debugfs_entry) {
         |                  ^~
   drivers/gpu/drm/tegra/dc.c: In function 'tegra_crtc_update_memory_bandwidth':
   drivers/gpu/drm/tegra/dc.c:1853:53: warning: variable 'new_dc_state' set but not used [-Wunused-but-set-variable]
    1853 |         const struct tegra_dc_state *old_dc_state, *new_dc_state;
         |                                                     ^~~~~~~~~~~~
   drivers/gpu/drm/tegra/dc.c:1853:38: warning: variable 'old_dc_state' set but not used [-Wunused-but-set-variable]
    1853 |         const struct tegra_dc_state *old_dc_state, *new_dc_state;
         |                                      ^~~~~~~~~~~~
   drivers/gpu/drm/tegra/dc.c: In function 'tegra_crtc_calculate_memory_bandwidth':
   drivers/gpu/drm/tegra/dc.c:2233:38: warning: variable 'old_state' set but not used [-Wunused-but-set-variable]
    2233 |         const struct drm_crtc_state *old_state;
         |                                      ^~~~~~~~~


vim +1626 drivers/gpu/drm/tegra/dc.c

  1618	
  1619	static int tegra_dc_late_register(struct drm_crtc *crtc)
  1620	{
  1621		unsigned int i, count = ARRAY_SIZE(debugfs_files);
  1622		struct drm_minor *minor = crtc->dev->primary;
  1623		struct dentry *root;
  1624		struct tegra_dc *dc = to_tegra_dc(crtc);
  1625	
> 1626		if (!crtc->debugfs_entry) {
  1627			dc->debugfs_files = NULL;
  1628			return 0;
  1629		}
  1630	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 43752 bytes --]

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

* Re: [Intel-gfx] [PATCH 5/5] drm/tegra: check root dentry before debugfs init
@ 2021-11-08  6:35     ` kernel test robot
  0 siblings, 0 replies; 37+ messages in thread
From: kernel test robot @ 2021-11-08  6:35 UTC (permalink / raw)
  To: Nirmoy Das, dri-devel
  Cc: kbuild-all, David Airlie, intel-gfx, Nirmoy Das, Jonathan Hunter

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

Hi Nirmoy,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on tegra/for-next drm-tip/drm-tip linus/master v5.15 next-20211108]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Nirmoy-Das/dri-cleanup-debugfs-error-handling/20211008-173312
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: arm64-randconfig-r012-20211008 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/313e208057ad9c5d5de6c0fdb03fb575f71270e3
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Nirmoy-Das/dri-cleanup-debugfs-error-handling/20211008-173312
        git checkout 313e208057ad9c5d5de6c0fdb03fb575f71270e3
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/gpu/drm/tegra/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/gpu/drm/tegra/dc.c: In function 'tegra_dc_late_register':
>> drivers/gpu/drm/tegra/dc.c:1626:18: error: 'struct drm_crtc' has no member named 'debugfs_entry'
    1626 |         if (!crtc->debugfs_entry) {
         |                  ^~
   drivers/gpu/drm/tegra/dc.c: In function 'tegra_crtc_update_memory_bandwidth':
   drivers/gpu/drm/tegra/dc.c:1853:53: warning: variable 'new_dc_state' set but not used [-Wunused-but-set-variable]
    1853 |         const struct tegra_dc_state *old_dc_state, *new_dc_state;
         |                                                     ^~~~~~~~~~~~
   drivers/gpu/drm/tegra/dc.c:1853:38: warning: variable 'old_dc_state' set but not used [-Wunused-but-set-variable]
    1853 |         const struct tegra_dc_state *old_dc_state, *new_dc_state;
         |                                      ^~~~~~~~~~~~
   drivers/gpu/drm/tegra/dc.c: In function 'tegra_crtc_calculate_memory_bandwidth':
   drivers/gpu/drm/tegra/dc.c:2233:38: warning: variable 'old_state' set but not used [-Wunused-but-set-variable]
    2233 |         const struct drm_crtc_state *old_state;
         |                                      ^~~~~~~~~


vim +1626 drivers/gpu/drm/tegra/dc.c

  1618	
  1619	static int tegra_dc_late_register(struct drm_crtc *crtc)
  1620	{
  1621		unsigned int i, count = ARRAY_SIZE(debugfs_files);
  1622		struct drm_minor *minor = crtc->dev->primary;
  1623		struct dentry *root;
  1624		struct tegra_dc *dc = to_tegra_dc(crtc);
  1625	
> 1626		if (!crtc->debugfs_entry) {
  1627			dc->debugfs_files = NULL;
  1628			return 0;
  1629		}
  1630	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 43752 bytes --]

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

end of thread, other threads:[~2021-11-08  6:36 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-08  9:17 [PATCH 1/5] dri: cleanup debugfs error handling Nirmoy Das
2021-10-08  9:17 ` [Intel-gfx] " Nirmoy Das
2021-10-08  9:17 ` [PATCH 2/5] drm/i915: check dri root before debugfs init Nirmoy Das
2021-10-08  9:17   ` [Intel-gfx] " Nirmoy Das
2021-10-12  9:59   ` Wang, Zhi A
2021-10-12  9:59     ` [Intel-gfx] " Wang, Zhi A
2021-10-12 10:19     ` Das, Nirmoy
2021-10-12 10:19       ` [Intel-gfx] " Das, Nirmoy
2021-10-08  9:17 ` [PATCH 3/5] drm/radeon: " Nirmoy Das
2021-10-08  9:17   ` [Intel-gfx] " Nirmoy Das
2021-10-08 10:23   ` Christian König
2021-10-08 10:23     ` [Intel-gfx] " Christian König
2021-10-08 10:34     ` Das, Nirmoy
2021-10-08 10:34       ` [Intel-gfx] " Das, Nirmoy
2021-10-08  9:17 ` [PATCH 4/5] drm/armada: check dri/crtc " Nirmoy Das
2021-10-08  9:17   ` [Intel-gfx] " Nirmoy Das
2021-10-12 19:40   ` kernel test robot
2021-10-12 19:40     ` [Intel-gfx] " kernel test robot
2021-10-08  9:17 ` [PATCH 5/5] drm/tegra: check root dentry " Nirmoy Das
2021-10-08  9:17   ` [Intel-gfx] " Nirmoy Das
2021-11-08  6:35   ` kernel test robot
2021-11-08  6:35     ` [Intel-gfx] " kernel test robot
2021-10-08  9:35 ` [PATCH 1/5] dri: cleanup debugfs error handling Thomas Zimmermann
2021-10-08  9:35   ` [Intel-gfx] " Thomas Zimmermann
2021-10-08  9:40 ` Jani Nikula
2021-10-08 11:07   ` Greg KH
2021-10-08 12:08     ` Das, Nirmoy
     [not found]     ` <02fc9da3-ebac-2df1-3a54-d764b273f91b@amd.com>
2021-10-08 12:56       ` Fw: " Das, Nirmoy
     [not found]         ` <c4f1464d-19b6-04a3-e2d8-a153bfbb050a@amd.com>
     [not found]           ` <YWBfvILqkBQ8VSYc@kroah.com>
2021-10-11 14:19             ` Christian König
2021-10-11 14:53               ` Greg KH
2021-10-11 16:38                 ` Jani Nikula
2021-10-11 17:07                   ` Greg KH
2021-10-11 18:43                     ` Jani Nikula
2021-10-11 15:13               ` Das, Nirmoy
2021-10-08 14:09 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/5] " Patchwork
2021-10-08 14:10 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-10-08 19:18 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.