drm/amdgpu: return early if debugfs is not initialized
Subsystems (2)
PATCH 1/1 drm/amdgpu: return early if debugfs is not initialized
Check first if debugfs is initialized before creating amdgpu debugfs files.
References: https://gitlab.freedesktop.org/drm/amd/-/issues/1686
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +3 -0
@@ -1617,6 +1617,9 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)struct dentry *ent;int r, i; +if (!debugfs_initialized ()) +return 0 ; + ent =debugfs_create_file ("amdgpu_preempt_ib" ,0600 , root, adev, &fops_ib_preempt);if (IS_ERR (ent)) {
Signature · 1 line
2.32.0
Quoted 9 lines · Nirmoy Das
Check first if debugfs is initialized before creating amdgpu debugfs files.
References: https://gitlab.freedesktop.org/drm/amd/-/issues/1686
Signed-off-by Nirmoy Das <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 3 +++ 1 file changed, 3 insertions(+)
Sorry about another miss. There is one other option added in the patch.
"
config DEBUG_FS_DISALLOW_MOUNT
bool "Do not register debugfs as filesystem"
help
The API is open but filesystem is not loaded. Clients can still do
their work and read with debug tools that do not need debugfs filesystem. "
This doesn't work under this mode. Guess, we are not worried about this.
Thanks,
Lijo
Quoted 15 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +3
-0@@ -1617,6 +1617,9 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)struct dentry *ent;int r, i; +if (!debugfs_initialized ()) +return 0 ; + ent =debugfs_create_file ("amdgpu_preempt_ib" ,0600 , root, adev, &fops_ib_preempt);if (IS_ERR (ent)) {
Christian König
maintainerAm 06.10.21 um 13:55 schrieb Lazar, Lijo:
Quoted 18 lines · Nirmoy Das
Quoted 9 lines
Check first if debugfs is initialized before creating amdgpu debugfs files.
References: https://gitlab.freedesktop.org/drm/amd/-/issues/1686
Signed-off-by Nirmoy Das <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c| 3 +++1 file changed, 3 insertions(+)Sorry about another miss. There is one other option added in the patch.
Quoted 6 lines
"
configDEBUG_FS_DISALLOW_MOUNT
bool "Do not register debugfs as filesystem"
help
The API is open but filesystem is not loaded. Clients can still do their work and read with debug tools that do not need debugfs filesystem. "
I'm really wondering why it's useful to have debugfs enabled, but not mounted.
Quoted 4 lines
This doesn't work under this mode. Guess, we are not worried about this.
Reviewed-by Lijo Lazar <[email protected]>
Anyway Reviewed-by: Christian König <[email protected]>
Quoted 19 lines
Thanks,
LijoQuoted 15 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +2
-0@@ -1617,6 +1617,9 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) struct dentry *ent; int r, i; + if (!debugfs_initialized()) + return 0; + ent = debugfs_create_file("amdgpu_preempt_ib", 0600, root, adev, &fops_ib_preempt);if (
IS_ERR(ent)) {
Quoted 18 lines · Lijo
Quoted 9 lines · Nirmoy Das
Check first if debugfs is initialized before creating amdgpu debugfs files.
References: https://gitlab.freedesktop.org/drm/amd/-/issues/1686
Signed-off-by Nirmoy Das <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c| 3 +++1 file changed, 3 insertions(+)Sorry about another miss. There is one other option added in the patch.
Quoted 8 lines
"
configDEBUG_FS_DISALLOW_MOUNT
bool "Do not register debugfs as filesystem"
help
The API is open but filesystem is not loaded. Clients can still do their work and read with debug tools that do not need debugfs filesystem. "This doesn't work under this mode. Guess, we are not worried about this.
It does work with DEBUG_FS_DISALLOW_MOUNT. I tested it with that option.
Quoted 2 lines
Reviewed-by Lijo Lazar <[email protected]>
Thanks,
Nimroy
Quoted 19 lines
Thanks,
LijoQuoted 15 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +2
-0@@ -1617,6 +1617,9 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) struct dentry *ent; int r, i; + if (!debugfs_initialized()) + return 0; + ent = debugfs_create_file("amdgpu_preempt_ib", 0600, root, adev, &fops_ib_preempt);if (
IS_ERR(ent)) {