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: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Tao Zhou 2020-03-06 12:24:06 +08:00 committed by Alex Deucher
parent f9317014ea
commit 204eaac625
8 changed files with 3 additions and 11 deletions

View File

@ -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)
} }
} }
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));
} }

View File

@ -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,

View File

@ -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) {

View File

@ -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) {

View File

@ -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,
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,
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,
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);

View File

@ -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)

View File

@ -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,

View File

@ -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 ||