Re: [PATCH 1/1] drm/amdgpu: return early if debugfs is not initialized

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 06.10.21 um 13:55 schrieb Lazar, Lijo:


On 10/6/2021 3:21 PM, Nirmoy Das wrote:
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 <nirmoy.das@xxxxxxx>
---
  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.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a24c6f7bc923d5e2f3139855eb09b0d480d6b410

"
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.
"

I'm really wondering why it's useful to have debugfs enabled, but not mounted.


This doesn't work under this mode. Guess, we are not worried about this.

Reviewed-by: Lijo Lazar <lijo.lazar@xxxxxxx>

Anyway Reviewed-by: Christian König <christian.koenig@xxxxxxx>


Thanks,
Lijo

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index 6611b3c7c149..5497e2d31d1a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -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)) {





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux