aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux-5.4/linux-yocto-5.4.2/0132-drm-amdgpu-fix-ras-ctrl-debugfs-node-leak.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux-5.4/linux-yocto-5.4.2/0132-drm-amdgpu-fix-ras-ctrl-debugfs-node-leak.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux-5.4/linux-yocto-5.4.2/0132-drm-amdgpu-fix-ras-ctrl-debugfs-node-leak.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux-5.4/linux-yocto-5.4.2/0132-drm-amdgpu-fix-ras-ctrl-debugfs-node-leak.patch b/meta-amd-bsp/recipes-kernel/linux-5.4/linux-yocto-5.4.2/0132-drm-amdgpu-fix-ras-ctrl-debugfs-node-leak.patch
new file mode 100644
index 00000000..940a4f6a
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux-5.4/linux-yocto-5.4.2/0132-drm-amdgpu-fix-ras-ctrl-debugfs-node-leak.patch
@@ -0,0 +1,66 @@
+From 47a9eda8aff8000e5d077f42deb50ee5bbcf37f5 Mon Sep 17 00:00:00 2001
+From: Guchun Chen <guchun.chen@amd.com>
+Date: Mon, 16 Sep 2019 13:42:46 +0800
+Subject: [PATCH 0132/1453] drm/amdgpu: fix ras ctrl debugfs node leak
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Use debugfs_remove_recursive to remove the whole debugfs
+directory instead of removing the node one by one.
+
+Change-Id: I27e9edab20d568b16d0163f8c7c3d81fb6832acd
+Signed-off-by: Guchun Chen <guchun.chen@amd.com>
+Reviewed-by: Christian König <christian.koenig@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 12 +++++-------
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 2 --
+ 2 files changed, 5 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+index 1ef3aba75ce9..83378e5efd49 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+@@ -979,10 +979,10 @@ static void amdgpu_ras_debugfs_create_ctrl_node(struct amdgpu_device *adev)
+ struct drm_minor *minor = adev->ddev->primary;
+
+ con->dir = debugfs_create_dir("ras", minor->debugfs_root);
+- con->ent = debugfs_create_file("ras_ctrl", S_IWUGO | S_IRUGO, con->dir,
+- adev, &amdgpu_ras_debugfs_ctrl_ops);
+- con->ent = debugfs_create_file("ras_eeprom_reset", S_IWUGO | S_IRUGO, con->dir,
+- adev, &amdgpu_ras_debugfs_eeprom_ops);
++ debugfs_create_file("ras_ctrl", S_IWUGO | S_IRUGO, con->dir,
++ adev, &amdgpu_ras_debugfs_ctrl_ops);
++ debugfs_create_file("ras_eeprom_reset", S_IWUGO | S_IRUGO, con->dir,
++ adev, &amdgpu_ras_debugfs_eeprom_ops);
+ }
+
+ void amdgpu_ras_debugfs_create(struct amdgpu_device *adev,
+@@ -1027,10 +1027,8 @@ static void amdgpu_ras_debugfs_remove_all(struct amdgpu_device *adev)
+ amdgpu_ras_debugfs_remove(adev, &obj->head);
+ }
+
+- debugfs_remove(con->ent);
+- debugfs_remove(con->dir);
++ debugfs_remove_recursive(con->dir);
+ con->dir = NULL;
+- con->ent = NULL;
+ }
+ /* debugfs end */
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
+index dd5da3c6327e..ae386c466c0e 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
+@@ -317,8 +317,6 @@ struct amdgpu_ras {
+ struct list_head head;
+ /* debugfs */
+ struct dentry *dir;
+- /* debugfs ctrl */
+- struct dentry *ent;
+ /* sysfs */
+ struct device_attribute features_attr;
+ struct bin_attribute badpages_attr;
+--
+2.17.1
+