Skip to contentSkip to conversation

drm/amdgpu: check for the existence of RAS dir before creating

PATCH In review Evan Quan 3 participants 3 messages Mar 10, 2020

Subsystems (2)
lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/1 drm/amdgpu: check for the existence of RAS dir before creating

To address the error message below:
debugfs: Directory 'ras' with parent '/' already present!

Change-Id I2539e89fdfe4e22055c3be5a48a8c0adad315f91
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +3 -1
index e1e8fd4b2b89..2195f6c63b50 100644
@@ -1075,7 +1075,9 @@ static void amdgpu_ras_debugfs_create_ctrl_node(struct amdgpu_device *adev)
 	struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
 	struct drm_minor *minor = adev->ddev->primary;
 
-	con->dir = debugfs_create_dir("ras", minor->debugfs_root);
+	con->dir = debugfs_lookup("ras", minor->debugfs_root);
+	if (!con->dir)
+		con->dir = debugfs_create_dir("ras", minor->debugfs_root);
 	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,
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw

[AMD Official Use Only - Internal Distribution Only]

The issue is fixed by:

centralize all debugfs creation in one place for ras

Change-Id I7489ccb41dcf7a11ecc45313ad42940474999d81

Hi Stanley:

Have you pushed the patch?

Regards,
Tao

Quoted 40 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Evan Quan
Sent: 2020年3月10日 13:26
To: [email protected]
Cc: Quan, Evan <[email protected]>; Zhang, Hawking <[email protected]>
Subject: [PATCH] drm/amdgpu: check for the existence of RAS dir before creating

To address the error message below:
debugfs: Directory 'ras' with parent '/' already present!

Change-Id I2539e89fdfe4e22055c3be5a48a8c0adad315f91
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +3 -1
index e1e8fd4b2b89..2195f6c63b50 100644
@@ -1075,7 +1075,9 @@ static void
 amdgpu_ras_debugfs_create_ctrl_node(struct amdgpu_device *adev)
 	struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
 	struct drm_minor *minor = adev->ddev->primary;
 
-	con->dir = debugfs_create_dir("ras", minor->debugfs_root);
+	con->dir = debugfs_lookup("ras", minor->debugfs_root);
+	if (!con->dir)
+		con->dir = debugfs_create_dir("ras", minor->debugfs_root);
 	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-

Quoted 1 line

dir,

--
2.25.1

Quoted 9 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.f
reedesktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=02%7C01%7Ctao.zhou1%40amd.com%7C9b53a604785f4aa69 01808d7c4b39d50%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C 637194148679373493&amp;sdata=j9L0ibbh%2Fl9btsZCwOQK0D86Nrp1xR%2 BTZWCixnSDY%2FY%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#2 lore raw

[AMD Official Use Only - Internal Distribution Only]

centralize all debugfs creation in one place for ras

Change-Id I7489ccb41dcf7a11ecc45313ad42940474999d81

Patches have been pushed to branch.

Regards,
Stanley

-----Original Message-----
From: Zhou1, Tao <[email protected]>
Sent: Tuesday, March 10, 2020 1:39 PM
To: Quan, Evan <[email protected]>; [email protected]; Yang, Stanley <[email protected]>
Cc: Quan, Evan <[email protected]>; Zhang, Hawking <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: check for the existence of RAS dir before creating

[AMD Official Use Only - Internal Distribution Only]

The issue is fixed by:

centralize all debugfs creation in one place for ras

Change-Id I7489ccb41dcf7a11ecc45313ad42940474999d81

Hi Stanley:

Have you pushed the patch?

Regards,
Tao

Quoted 40 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Evan Quan
Sent: 2020年3月10日 13:26
To: [email protected]
Cc: Quan, Evan <[email protected]>; Zhang, Hawking <[email protected]>
Subject: [PATCH] drm/amdgpu: check for the existence of RAS dir before creating

To address the error message below:
debugfs: Directory 'ras' with parent '/' already present!

Change-Id I2539e89fdfe4e22055c3be5a48a8c0adad315f91
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +3 -1
index e1e8fd4b2b89..2195f6c63b50 100644
@@ -1075,7 +1075,9 @@ static void
 amdgpu_ras_debugfs_create_ctrl_node(struct amdgpu_device *adev)
 	struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
 	struct drm_minor *minor = adev->ddev->primary;
 
-	con->dir = debugfs_create_dir("ras", minor->debugfs_root);
+	con->dir = debugfs_lookup("ras", minor->debugfs_root);
+	if (!con->dir)
+		con->dir = debugfs_create_dir("ras", minor->debugfs_root);
 	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-

Quoted 1 line

dir,

--
2.25.1

Quoted 10 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.f
reedesktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=02%7C01%7Ctao.zhou1%40amd.com%7C9b53a604785f4aa69 01808d7c4b39d50%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C 637194148679373493&amp;sdata=j9L0ibbh%2Fl9btsZCwOQK0D86Nrp1xR%2 BTZWCixnSDY%2FY%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx