drm/amdgpu: return early if debugfs is not initialized
authorNirmoy Das <nirmoy.das@amd.com>
Wed, 6 Oct 2021 09:06:33 +0000 (11:06 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 6 Oct 2021 19:53:14 +0000 (15:53 -0400)
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@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c

index 6611b3c..5497e2d 100644 (file)
@@ -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)) {