Commit 204eaac6 authored by Tao Zhou's avatar Tao Zhou Committed by Alex Deucher

drm/amdgpu: call ras_debugfs_create_all in debugfs_init

and remove each ras IP's own debugfs creation

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 f9317014
...@@ -1294,6 +1294,7 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_ib_preempt, NULL, ...@@ -1294,6 +1294,7 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_ib_preempt, NULL,
DEFINE_SIMPLE_ATTRIBUTE(fops_sclk_set, NULL, DEFINE_SIMPLE_ATTRIBUTE(fops_sclk_set, NULL,
amdgpu_debugfs_sclk_set, "%llu\n"); amdgpu_debugfs_sclk_set, "%llu\n");
extern void amdgpu_ras_debugfs_create_all(struct amdgpu_device *adev);
int amdgpu_debugfs_init(struct amdgpu_device *adev) int amdgpu_debugfs_init(struct amdgpu_device *adev)
{ {
int r, i; int r, i;
...@@ -1366,6 +1367,8 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) ...@@ -1366,6 +1367,8 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)
} }
} }
amdgpu_ras_debugfs_create_all(adev);
return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list, return amdgpu_debugfs_add_files(adev, amdgpu_debugfs_list,
ARRAY_SIZE(amdgpu_debugfs_list)); ARRAY_SIZE(amdgpu_debugfs_list));
} }
......
...@@ -573,7 +573,6 @@ int amdgpu_gfx_ras_late_init(struct amdgpu_device *adev) ...@@ -573,7 +573,6 @@ int amdgpu_gfx_ras_late_init(struct amdgpu_device *adev)
int r; int r;
struct ras_fs_if fs_info = { struct ras_fs_if fs_info = {
.sysfs_name = "gfx_err_count", .sysfs_name = "gfx_err_count",
.debugfs_name = "gfx_err_inject",
}; };
struct ras_ih_if ih_info = { struct ras_ih_if ih_info = {
.cb = amdgpu_gfx_process_ras_data_cb, .cb = amdgpu_gfx_process_ras_data_cb,
......
...@@ -32,7 +32,6 @@ int amdgpu_mmhub_ras_late_init(struct amdgpu_device *adev) ...@@ -32,7 +32,6 @@ int amdgpu_mmhub_ras_late_init(struct amdgpu_device *adev)
}; };
struct ras_fs_if fs_info = { struct ras_fs_if fs_info = {
.sysfs_name = "mmhub_err_count", .sysfs_name = "mmhub_err_count",
.debugfs_name = "mmhub_err_inject",
}; };
if (!adev->mmhub.ras_if) { if (!adev->mmhub.ras_if) {
......
...@@ -30,7 +30,6 @@ int amdgpu_nbio_ras_late_init(struct amdgpu_device *adev) ...@@ -30,7 +30,6 @@ int amdgpu_nbio_ras_late_init(struct amdgpu_device *adev)
}; };
struct ras_fs_if fs_info = { struct ras_fs_if fs_info = {
.sysfs_name = "pcie_bif_err_count", .sysfs_name = "pcie_bif_err_count",
.debugfs_name = "pcie_bif_err_inject",
}; };
if (!adev->nbio.ras_if) { if (!adev->nbio.ras_if) {
......
...@@ -1174,7 +1174,6 @@ static void amdgpu_ras_debugfs_remove_all(struct amdgpu_device *adev) ...@@ -1174,7 +1174,6 @@ static void amdgpu_ras_debugfs_remove_all(struct amdgpu_device *adev)
static int amdgpu_ras_fs_init(struct amdgpu_device *adev) static int amdgpu_ras_fs_init(struct amdgpu_device *adev)
{ {
amdgpu_ras_sysfs_create_feature_node(adev); amdgpu_ras_sysfs_create_feature_node(adev);
amdgpu_ras_debugfs_create_ctrl_node(adev);
return 0; return 0;
} }
...@@ -1878,8 +1877,6 @@ int amdgpu_ras_late_init(struct amdgpu_device *adev, ...@@ -1878,8 +1877,6 @@ int amdgpu_ras_late_init(struct amdgpu_device *adev,
goto interrupt; goto interrupt;
} }
amdgpu_ras_debugfs_create(adev, fs_info);
r = amdgpu_ras_sysfs_create(adev, fs_info); r = amdgpu_ras_sysfs_create(adev, fs_info);
if (r) if (r)
goto sysfs; goto sysfs;
...@@ -1888,7 +1885,6 @@ int amdgpu_ras_late_init(struct amdgpu_device *adev, ...@@ -1888,7 +1885,6 @@ int amdgpu_ras_late_init(struct amdgpu_device *adev,
cleanup: cleanup:
amdgpu_ras_sysfs_remove(adev, ras_block); amdgpu_ras_sysfs_remove(adev, ras_block);
sysfs: sysfs:
amdgpu_ras_debugfs_remove(adev, ras_block);
if (ih_info->cb) if (ih_info->cb)
amdgpu_ras_interrupt_remove_handler(adev, ih_info); amdgpu_ras_interrupt_remove_handler(adev, ih_info);
interrupt: interrupt:
...@@ -1905,7 +1901,6 @@ void amdgpu_ras_late_fini(struct amdgpu_device *adev, ...@@ -1905,7 +1901,6 @@ void amdgpu_ras_late_fini(struct amdgpu_device *adev,
return; return;
amdgpu_ras_sysfs_remove(adev, ras_block); amdgpu_ras_sysfs_remove(adev, ras_block);
amdgpu_ras_debugfs_remove(adev, ras_block);
if (ih_info->cb) if (ih_info->cb)
amdgpu_ras_interrupt_remove_handler(adev, ih_info); amdgpu_ras_interrupt_remove_handler(adev, ih_info);
amdgpu_ras_feature_enable(adev, ras_block, 0); amdgpu_ras_feature_enable(adev, ras_block, 0);
......
...@@ -93,7 +93,6 @@ int amdgpu_sdma_ras_late_init(struct amdgpu_device *adev, ...@@ -93,7 +93,6 @@ int amdgpu_sdma_ras_late_init(struct amdgpu_device *adev,
struct ras_ih_if *ih_info = (struct ras_ih_if *)ras_ih_info; struct ras_ih_if *ih_info = (struct ras_ih_if *)ras_ih_info;
struct ras_fs_if fs_info = { struct ras_fs_if fs_info = {
.sysfs_name = "sdma_err_count", .sysfs_name = "sdma_err_count",
.debugfs_name = "sdma_err_inject",
}; };
if (!ih_info) if (!ih_info)
......
...@@ -28,7 +28,6 @@ int amdgpu_umc_ras_late_init(struct amdgpu_device *adev) ...@@ -28,7 +28,6 @@ int amdgpu_umc_ras_late_init(struct amdgpu_device *adev)
int r; int r;
struct ras_fs_if fs_info = { struct ras_fs_if fs_info = {
.sysfs_name = "umc_err_count", .sysfs_name = "umc_err_count",
.debugfs_name = "umc_err_inject",
}; };
struct ras_ih_if ih_info = { struct ras_ih_if ih_info = {
.cb = amdgpu_umc_process_ras_data_cb, .cb = amdgpu_umc_process_ras_data_cb,
......
...@@ -598,7 +598,6 @@ int amdgpu_xgmi_ras_late_init(struct amdgpu_device *adev) ...@@ -598,7 +598,6 @@ int amdgpu_xgmi_ras_late_init(struct amdgpu_device *adev)
}; };
struct ras_fs_if fs_info = { struct ras_fs_if fs_info = {
.sysfs_name = "xgmi_wafl_err_count", .sysfs_name = "xgmi_wafl_err_count",
.debugfs_name = "xgmi_wafl_err_inject",
}; };
if (!adev->gmc.xgmi.supported || if (!adev->gmc.xgmi.supported ||
......
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