Skip to content

Commit f931701

Browse files
Tao Zhoualexdeucher
authored andcommitted
drm/amdgpu: add function to creat all ras debugfs node
centralize all debugfs creation in one place for ras this is required to fix ras when the driver does not use the drm load and unload callbacks due to ordering issues with the drm device node. Signed-off-by: Tao Zhou <[email protected]> Signed-off-by: Stanley.Yang <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 7bef6ea commit f931701

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,35 @@ void amdgpu_ras_debugfs_create(struct amdgpu_device *adev,
11131113
&amdgpu_ras_debugfs_ops);
11141114
}
11151115

1116+
void amdgpu_ras_debugfs_create_all(struct amdgpu_device *adev)
1117+
{
1118+
struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
1119+
struct ras_manager *obj, *tmp;
1120+
struct ras_fs_if fs_info;
1121+
1122+
/*
1123+
* it won't be called in resume path, no need to check
1124+
* suspend and gpu reset status
1125+
*/
1126+
if (!con)
1127+
return;
1128+
1129+
amdgpu_ras_debugfs_create_ctrl_node(adev);
1130+
1131+
list_for_each_entry_safe(obj, tmp, &con->head, node) {
1132+
if (!obj)
1133+
continue;
1134+
1135+
if (amdgpu_ras_is_supported(adev, obj->head.block) &&
1136+
(obj->attr_inuse == 1)) {
1137+
sprintf(fs_info.debugfs_name, "%s_err_inject",
1138+
ras_block_str(obj->head.block));
1139+
fs_info.head = obj->head;
1140+
amdgpu_ras_debugfs_create(adev, &fs_info);
1141+
}
1142+
}
1143+
}
1144+
11161145
void amdgpu_ras_debugfs_remove(struct amdgpu_device *adev,
11171146
struct ras_common_if *head)
11181147
{

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,8 @@ int amdgpu_ras_sysfs_remove(struct amdgpu_device *adev,
592592
void amdgpu_ras_debugfs_create(struct amdgpu_device *adev,
593593
struct ras_fs_if *head);
594594

595+
void amdgpu_ras_debugfs_create_all(struct amdgpu_device *adev);
596+
595597
void amdgpu_ras_debugfs_remove(struct amdgpu_device *adev,
596598
struct ras_common_if *head);
597599

0 commit comments

Comments
 (0)