Commit f9317014 authored by Tao Zhou's avatar Tao Zhou Committed by Alex Deucher

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: default avatarTao Zhou <tao.zhou1@amd.com>
Signed-off-by: default avatarStanley.Yang <Stanley.Yang@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 7bef6ea9
...@@ -1113,6 +1113,35 @@ void amdgpu_ras_debugfs_create(struct amdgpu_device *adev, ...@@ -1113,6 +1113,35 @@ void amdgpu_ras_debugfs_create(struct amdgpu_device *adev,
&amdgpu_ras_debugfs_ops); &amdgpu_ras_debugfs_ops);
} }
void amdgpu_ras_debugfs_create_all(struct amdgpu_device *adev)
{
struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
struct ras_manager *obj, *tmp;
struct ras_fs_if fs_info;
/*
* it won't be called in resume path, no need to check
* suspend and gpu reset status
*/
if (!con)
return;
amdgpu_ras_debugfs_create_ctrl_node(adev);
list_for_each_entry_safe(obj, tmp, &con->head, node) {
if (!obj)
continue;
if (amdgpu_ras_is_supported(adev, obj->head.block) &&
(obj->attr_inuse == 1)) {
sprintf(fs_info.debugfs_name, "%s_err_inject",
ras_block_str(obj->head.block));
fs_info.head = obj->head;
amdgpu_ras_debugfs_create(adev, &fs_info);
}
}
}
void amdgpu_ras_debugfs_remove(struct amdgpu_device *adev, void amdgpu_ras_debugfs_remove(struct amdgpu_device *adev,
struct ras_common_if *head) struct ras_common_if *head)
{ {
......
...@@ -592,6 +592,8 @@ int amdgpu_ras_sysfs_remove(struct amdgpu_device *adev, ...@@ -592,6 +592,8 @@ int amdgpu_ras_sysfs_remove(struct amdgpu_device *adev,
void amdgpu_ras_debugfs_create(struct amdgpu_device *adev, void amdgpu_ras_debugfs_create(struct amdgpu_device *adev,
struct ras_fs_if *head); struct ras_fs_if *head);
void amdgpu_ras_debugfs_create_all(struct amdgpu_device *adev);
void amdgpu_ras_debugfs_remove(struct amdgpu_device *adev, void amdgpu_ras_debugfs_remove(struct amdgpu_device *adev,
struct ras_common_if *head); struct ras_common_if *head);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment