drm/amdgpu: Fix lockdep warning more gracely
authorxinhui pan <xinhui.pan@amd.com>
Mon, 11 Mar 2019 11:34:23 +0000 (19:34 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 Mar 2019 20:36:52 +0000 (15:36 -0500)
lockdep need a static key.
Previously we set ignore bit to avoid the warning.
Now call sysfs_attr_init to initialize the static key.

Signed-off-by: xinhui pan <xinhui.pan@amd.com>
Reviewed-and-Tested-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

index 1acaa84..1f47974 100644 (file)
@@ -748,12 +748,10 @@ static int amdgpu_ras_sysfs_create_feature_node(struct amdgpu_device *adev)
                .attr = {
                        .name = "features",
                        .mode = S_IRUGO,
-#ifdef CONFIG_DEBUG_LOCK_ALLOC
-                       .ignore_lockdep = 1,
-#endif
                },
                        .show = amdgpu_ras_sysfs_features_read,
        };
+       sysfs_attr_init(attrs[0]);
 
        return sysfs_create_group(&adev->dev->kobj, &group);
 }
@@ -793,12 +791,10 @@ int amdgpu_ras_sysfs_create(struct amdgpu_device *adev,
                .attr = {
                        .name = obj->fs_data.sysfs_name,
                        .mode = S_IRUGO,
-#ifdef CONFIG_DEBUG_LOCK_ALLOC
-                       .ignore_lockdep = 1,
-#endif
                },
                        .show = amdgpu_ras_sysfs_read,
        };
+       sysfs_attr_init(&obj->sysfs_attr.attr);
 
        if (sysfs_add_file_to_group(&adev->dev->kobj,
                                &obj->sysfs_attr.attr,