]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdgpu: call ras_debugfs_create_all in debugfs_init
authorTao Zhou <tao.zhou1@amd.com>
Fri, 6 Mar 2020 04:24:06 +0000 (12:24 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 10 Mar 2020 19:55:11 +0000 (15:55 -0400)
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>
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c
drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c

index 831f70dc8b598272e98e9394de545736a1db4531..c573edf02afc655ae41708bac7750ee872eceba0 100644 (file)
@@ -1294,6 +1294,7 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_ib_preempt, NULL,
 DEFINE_SIMPLE_ATTRIBUTE(fops_sclk_set, NULL,
                        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 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,
                                        ARRAY_SIZE(amdgpu_debugfs_list));
 }
index 952725e7243c4b340fec2009911920f1a07a3574..6b9c9193cdfa72df9434fd16ccaf4367cfa56fb9 100644 (file)
@@ -573,7 +573,6 @@ int amdgpu_gfx_ras_late_init(struct amdgpu_device *adev)
        int r;
        struct ras_fs_if fs_info = {
                .sysfs_name = "gfx_err_count",
-               .debugfs_name = "gfx_err_inject",
        };
        struct ras_ih_if ih_info = {
                .cb = amdgpu_gfx_process_ras_data_cb,
index 676c48c02d771cddd0ff018d6381ee535c5006ce..ead3dc572ec54471a01cfebcf4c06e985d2a2609 100644 (file)
@@ -32,7 +32,6 @@ int amdgpu_mmhub_ras_late_init(struct amdgpu_device *adev)
        };
        struct ras_fs_if fs_info = {
                .sysfs_name = "mmhub_err_count",
-               .debugfs_name = "mmhub_err_inject",
        };
 
        if (!adev->mmhub.ras_if) {
index 7d5c3a9de9eaf627879fb4695c95b6d664aa9596..6201a5f4b4fa6e523459c0611af0304c1bdb96f3 100644 (file)
@@ -30,7 +30,6 @@ int amdgpu_nbio_ras_late_init(struct amdgpu_device *adev)
        };
        struct ras_fs_if fs_info = {
                .sysfs_name = "pcie_bif_err_count",
-               .debugfs_name = "pcie_bif_err_inject",
        };
 
        if (!adev->nbio.ras_if) {
index 7f29e704936ed6eee2ad283c6966418b59008312..ce8548d5fbf3a23d852f4691c20e8ee9208ebd66 100644 (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)
 {
        amdgpu_ras_sysfs_create_feature_node(adev);
-       amdgpu_ras_debugfs_create_ctrl_node(adev);
 
        return 0;
 }
@@ -1878,8 +1877,6 @@ int amdgpu_ras_late_init(struct amdgpu_device *adev,
                        goto interrupt;
        }
 
-       amdgpu_ras_debugfs_create(adev, fs_info);
-
        r = amdgpu_ras_sysfs_create(adev, fs_info);
        if (r)
                goto sysfs;
@@ -1888,7 +1885,6 @@ int amdgpu_ras_late_init(struct amdgpu_device *adev,
 cleanup:
        amdgpu_ras_sysfs_remove(adev, ras_block);
 sysfs:
-       amdgpu_ras_debugfs_remove(adev, ras_block);
        if (ih_info->cb)
                amdgpu_ras_interrupt_remove_handler(adev, ih_info);
 interrupt:
@@ -1905,7 +1901,6 @@ void amdgpu_ras_late_fini(struct amdgpu_device *adev,
                return;
 
        amdgpu_ras_sysfs_remove(adev, ras_block);
-       amdgpu_ras_debugfs_remove(adev, ras_block);
        if (ih_info->cb)
                 amdgpu_ras_interrupt_remove_handler(adev, ih_info);
        amdgpu_ras_feature_enable(adev, ras_block, 0);
index 7854c053e85dc36e81657381c5672f0b43af397d..250a309e4dee78904172fb7b422cad430f08c7e9 100644 (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_fs_if fs_info = {
                .sysfs_name = "sdma_err_count",
-               .debugfs_name = "sdma_err_inject",
        };
 
        if (!ih_info)
index f4d40855147b6e350198436be1ad1cce1892f503..9dd51f0d2c11be70b0c1b9cfd360fefde6a54300 100644 (file)
@@ -28,7 +28,6 @@ int amdgpu_umc_ras_late_init(struct amdgpu_device *adev)
        int r;
        struct ras_fs_if fs_info = {
                .sysfs_name = "umc_err_count",
-               .debugfs_name = "umc_err_inject",
        };
        struct ras_ih_if ih_info = {
                .cb = amdgpu_umc_process_ras_data_cb,
index 59d171510ddc363f412539b85053710674d1ca67..95b3327168acb0354b4e03c09cfa3be041fe2f8a 100644 (file)
@@ -598,7 +598,6 @@ int amdgpu_xgmi_ras_late_init(struct amdgpu_device *adev)
        };
        struct ras_fs_if fs_info = {
                .sysfs_name = "xgmi_wafl_err_count",
-               .debugfs_name = "xgmi_wafl_err_inject",
        };
 
        if (!adev->gmc.xgmi.supported ||