drm/amdgpu: add function to creat all ras debugfs node
Subsystems (2)
PATCH 1/2 drm/amdgpu: add function to creat all ras debugfs node
From: Tao Zhou <[email protected]>
centralize all debugfs creation in one place for ras
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 29 +++++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 2 ++ 2 files changed, 31 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +29 -0
@@ -1117,6 +1117,35 @@ void amdgpu_ras_debugfs_create(struct amdgpu_device *adev, &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,struct ras_common_if *head) {
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h +2 -0
@@ -592,6 +592,8 @@ int amdgpu_ras_sysfs_remove(struct amdgpu_device *adev,void amdgpu_ras_debugfs_create (struct amdgpu_device *adev,struct ras_fs_if *head); +void amdgpu_ras_debugfs_create_all (struct amdgpu_device *adev); +void amdgpu_ras_debugfs_remove (struct amdgpu_device *adev,struct ras_common_if *head);
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/2 drm/amdgpu: call ras_debugfs_create_all in debugfs_init
From: Tao Zhou <[email protected]>
and remove each ras IP's own debugfs creation
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 5 ----- drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 1 - 8 files changed, 3 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +3 -0
@@ -1315,6 +1315,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;
@@ -1387,6 +1388,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)); }
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0 -1
@@ -565,7 +565,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,
drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c +0 -1
@@ -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) {
drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c +0 -1
@@ -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) {
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0 -5
@@ -1178,7 +1178,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 ; }
@@ -1882,8 +1881,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;
@@ -1892,7 +1889,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:
@@ -1909,7 +1905,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 );
drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c +0 -1
@@ -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)
drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c +0 -1
@@ -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,
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +0 -1
@@ -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 ||
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 2/2] drm/amdgpu: call ras_debugfs_create_all in debugfs_init
[AMD Public Use]
Shall we need other codes to remove ras debugfs in debugfs_fini to avoid leak?
Regards,
Guchun
-----Original Message-----
From: Stanley.Yang <[email protected]>
Sent: Monday, March 9, 2020 5:12 PM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Chen, Guchun <[email protected]>; Li, Dennis <[email protected]>; Clements, John <[email protected]>; Zhou1, Tao <[email protected]>; Yang, Stanley <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu: call ras_debugfs_create_all in debugfs_init
From: Tao Zhou <[email protected]>
and remove each ras IP's own debugfs creation
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 5 ----- drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 1 - 8 files changed, 3 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +3 -0
@@ -1315,6 +1315,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;
@@ -1387,6 +1388,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)); }
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0 -1
@@ -565,7 +565,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, diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c
index 676c48c02d77..ead3dc572ec5 100644
drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c +0 -1
@@ -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) {
drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c +0 -1
@@ -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) {
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0 -5
@@ -1178,7 +1178,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 ; }
@@ -1882,8 +1881,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;
@@ -1892,7 +1889,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:
@@ -1909,7 +1905,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); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
index 7854c053e85d..250a309e4dee 100644
drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c +0 -1
@@ -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)
drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c +0 -1
@@ -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, diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
index a54ce398ed77..0837f872741b 100644
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +0 -1
@@ -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 ||
--
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Zhou1, Tao
Reviewed-by Alex DeucherRE: [PATCH 2/2] drm/amdgpu: call ras_debugfs_create_all in debugfs_init
[AMD Public Use]
We already have amdgpu_ras_debugfs_remove and amdgpu_ras_debugfs_remove_all.
In fact, amdgpu_debugfs_fini has been dropped in the patch below, and we are also planning to delete amdgpu_ras_debugfs_remove and amdgpu_ras_debugfs_remove_all.
drm/amdgpu: no need to clean debugfs at amdgpu
drm_minor_unregister will invoke drm_debugfs_cleanup to clean all the child node under primary minor node. We don't need to invoke amdgpu_debugfs_fini and amdgpu_debugfs_regs_cleanup to clean agian. Otherwise, it will raise the NULL pointer like below.
v2: remove all debugfs cleanup/fini code at amdgpu
Regards,
Tao
Quoted 193 lines
-----Original Message-----
From: Chen, Guchun <[email protected]>
Sent: 2020年3月9日 17:21
To: Yang, Stanley <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>; Li, Dennis <[email protected]>; Clements, John <[email protected]>; Zhou1, Tao <[email protected]>; Yang, Stanley <[email protected]>
Subject: RE: [PATCH 2/2] drm/amdgpu: callras_debugfs_create_allindebugfs_init[AMD Public Use]
Shall we need other codes to remove ras debugfs in
debugfs_finito avoid leak?Regards,
Guchun-----Original Message-----
From: Stanley.Yang <[email protected]>
Sent: Monday, March 9, 2020 5:12 PM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Chen, Guchun <[email protected]>; Li, Dennis <[email protected]>; Clements, John <[email protected]>; Zhou1, Tao <[email protected]>; Yang, Stanley <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu: callras_debugfs_create_allindebugfs_initFrom: Tao Zhou <[email protected]>
and remove each ras IP's own debugfs creation
Signed-off-by Tao Zhou <[email protected]>Signed-off-by Stanley.Yang <[email protected]>Change-Id If3d16862afa0d97abad183dd6e60478b34029e95--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 5 ----- drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 1 - 8 files changed, 3 insertions(+), 11 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +3
-0@@ -1315,6 +1315,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;@@ -1387,6 +1388,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));}
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0
-1@@ -565,7 +565,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, diff --gita/drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.cb/drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c
index676c48c02d77..ead3dc572ec5100644drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c +0
-1@@ -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" , };drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c +0
-0if (!adev->mmhub.ras_if) {drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c +0
-1@@ -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" , };drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c +0
-0if (!adev->nbio.ras_if) {drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0
-0@@ -1178,7 +1178,6 @@ static void
amdgpu_ras_debugfs_remove_all(struct amdgpu_device *adev)static intamdgpu_ras_fs_init(struct amdgpu_device *adev){drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0
-3amdgpu_ras_sysfs_create_feature_node (adev); -amdgpu_ras_debugfs_create_ctrl_node (adev);return 0 ; }@@ -1882,8 +1881,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)drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0
-1goto sysfs;@@ -1892,7 +1889,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:
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0
-1@@ -1909,7 +1905,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); diff --gita/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.cb/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
index7854c053e85d..250a309e4dee100644drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c +0
-1@@ -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" , };drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c +0
-0if (!ih_info)drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c +0
-1@@ -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, diff --gita/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.cb/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
indexa54ce398ed77..0837f872741b100644drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +0
-1@@ -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" , };
Quoted 3 lines
if (!adev->gmc.xgmi.supported ||
--
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 2/2] drm/amdgpu: call ras_debugfs_create_all in debugfs_init
[AMD Public Use]
That's fine. These two patches are:
Regards,
Guchun
-----Original Message-----
From: Zhou1, Tao <[email protected]>
Sent: Monday, March 9, 2020 6:15 PM
To: Chen, Guchun <[email protected]>; Yang, Stanley <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>; Li, Dennis <[email protected]>; Clements, John <[email protected]>; Yang, Stanley <[email protected]>
Subject: RE: [PATCH 2/2] drm/amdgpu: call ras_debugfs_create_all in debugfs_init
[AMD Public Use]
We already have amdgpu_ras_debugfs_remove and amdgpu_ras_debugfs_remove_all.
In fact, amdgpu_debugfs_fini has been dropped in the patch below, and we are also planning to delete amdgpu_ras_debugfs_remove and amdgpu_ras_debugfs_remove_all.
drm/amdgpu: no need to clean debugfs at amdgpu
drm_minor_unregister will invoke drm_debugfs_cleanup to clean all the child node under primary minor node. We don't need to invoke amdgpu_debugfs_fini and amdgpu_debugfs_regs_cleanup to clean agian. Otherwise, it will raise the NULL pointer like below.
v2: remove all debugfs cleanup/fini code at amdgpu
Regards,
Tao
Quoted 194 lines
-----Original Message-----
From: Chen, Guchun <[email protected]>
Sent: 2020年3月9日 17:21
To: Yang, Stanley <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>; Li, Dennis <[email protected]>; Clements, John <[email protected]>; Zhou1, Tao <[email protected]>; Yang, Stanley <[email protected]>
Subject: RE: [PATCH 2/2] drm/amdgpu: callras_debugfs_create_allindebugfs_init[AMD Public Use]
Shall we need other codes to remove ras debugfs in
debugfs_finito avoid leak?Regards,
Guchun-----Original Message-----
From: Stanley.Yang <[email protected]>
Sent: Monday, March 9, 2020 5:12 PM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Chen, Guchun <[email protected]>; Li, Dennis <[email protected]>; Clements, John <[email protected]>; Zhou1, Tao <[email protected]>; Yang, Stanley <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu: callras_debugfs_create_allindebugfs_initFrom: Tao Zhou <[email protected]>
and remove each ras IP's own debugfs creation
Signed-off-by Tao Zhou <[email protected]>Signed-off-by Stanley.Yang <[email protected]>Change-Id If3d16862afa0d97abad183dd6e60478b34029e95--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 5 ----- drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 1 - 8 files changed, 3 insertions(+), 11 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +4
-0@@ -1315,6 +1315,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;@@ -1387,6 +1388,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)); } diff --git
a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.cb/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index7403588684b3..d12bb4a35780100644drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0
-1@@ -565,7 +565,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, diff --gita/drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.cb/drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c
index676c48c02d77..ead3dc572ec5100644drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c +0
-1@@ -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" , };drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c +0
-0if (!adev->mmhub.ras_if) {drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c +0
-1@@ -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" , };drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c +0
-0if (!adev->nbio.ras_if) {drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0
-0@@ -1178,7 +1178,6 @@ static void
amdgpu_ras_debugfs_remove_all(struct amdgpu_device *adev)static intamdgpu_ras_fs_init(struct amdgpu_device *adev){drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0
-3amdgpu_ras_sysfs_create_feature_node (adev); -amdgpu_ras_debugfs_create_ctrl_node (adev);return 0 ; }@@ -1882,8 +1881,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)drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0
-1goto sysfs;@@ -1892,7 +1889,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:
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0
-1@@ -1909,7 +1905,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); diff --gita/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.cb/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
index7854c053e85d..250a309e4dee100644drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c +0
-1@@ -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" , };drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c +0
-0if (!ih_info)drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c +0
-1@@ -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, diff --gita/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.cb/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
indexa54ce398ed77..0837f872741b100644drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +0
-1@@ -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" , };
Quoted 3 lines
if (!adev->gmc.xgmi.supported ||
--
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 2/2] drm/amdgpu: call ras_debugfs_create_all in debugfs_init
In reply to Stanley.YangQuoted 24 lines · Stanley.Yang
From: Tao Zhou <[email protected]>
and remove each ras IP's own debugfs creation
Signed-off-by Tao Zhou <[email protected]>Signed-off-by Stanley.Yang <[email protected]>Change-Id If3d16862afa0d97abad183dd6e60478b34029e95--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 5 ----- drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 1 - 8 files changed, 3 insertions(+), 11 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c DEFINE_SIMPLE_ATTRIBUTE(fops_ib_preempt, NULL, · line 1318
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +1
-0@@ -1315,6 +1315,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);
Can we put this in amdgpu_ras.h and include that instead?
Quoted 124 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +2
-0int amdgpu_debugfs_init (struct amdgpu_device *adev) {int r, i;@@ -1387,6 +1388,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)); }drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0
-1@@ -565,7 +565,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,drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c +0
-1@@ -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) {drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c +0
-1@@ -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) {drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0
-5@@ -1178,7 +1178,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 ; }@@ -1882,8 +1881,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;@@ -1892,7 +1889,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:@@ -1909,7 +1905,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 );drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c +0
-1@@ -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)drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c +0
-1@@ -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,drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +0
-2@@ -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 || --2.17.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 2/2] drm/amdgpu: call ras_debugfs_create_all in debugfs_init
[AMD Official Use Only - Internal Distribution Only]
Hi Alex,
I will send another patch to make this change, because this patch is been pushed to branch.
Regards,
Stanley
-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Tuesday, March 10, 2020 9:23 PM
To: Yang, Stanley <[email protected]>
Cc: amd-gfx list <[email protected]>; Chen, Guchun <[email protected]>; Zhou1, Tao <[email protected]>; Clements, John <[email protected]>; Li, Dennis <[email protected]>; Zhang, Hawking <[email protected]>
Subject: Re: [PATCH 2/2] drm/amdgpu: call ras_debugfs_create_all in debugfs_init
Quoted 25 lines · Stanley.Yang
From: Tao Zhou <[email protected]>
and remove each ras IP's own debugfs creation
Signed-off-by Tao Zhou <[email protected]>Signed-off-by Stanley.Yang <[email protected]>Change-Id If3d16862afa0d97abad183dd6e60478b34029e95--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 5 ----- drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 1 - 8 files changed, 3 insertions(+), 11 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c DEFINE_SIMPLE_ATTRIBUTE(fops_ib_preempt, NULL, · line 1319
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +2
-0@@ -1315,6 +1315,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);
Can we put this in amdgpu_ras.h and include that instead?
Quoted 131 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +2
-0int amdgpu_debugfs_init (struct amdgpu_device *adev) {int r, i;@@ -1387,6 +1388,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)); } diff --gita/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.cb/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index7403588684b3..d12bb4a35780100644drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0
-1@@ -565,7 +565,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, diff --git
a/drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.cb/drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c
index676c48c02d77..ead3dc572ec5100644drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c +0
-1@@ -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) {drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c +0
-1@@ -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) {drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0
-0@@ -1178,7 +1178,6 @@ static void amdgpu_ras_debugfs_remove_all(struct
amdgpu_device*adev) static int amdgpu_ras_fs_init(structamdgpu_device *adev) { amdgpu_ras_sysfs_create_feature_node(adev);drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0
-4-amdgpu_ras_debugfs_create_ctrl_node (adev);return 0 ; }@@ -1882,8 +1881,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;@@ -1892,7 +1889,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:
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0
-1@@ -1909,7 +1905,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); diff --git
a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.cb/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
index7854c053e85d..250a309e4dee100644drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c +0
-1@@ -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)drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c +0
-1@@ -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, diff --git
a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.cb/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
indexa54ce398ed77..0837f872741b100644drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +0
-2@@ -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 || --2.17.1
Quoted 8 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7CSt anley.Yang%40amd.com%7C7bcd4010164046f818d408d7c4f63e27%7C3dd8961fe488 4e608e11a82d994e183d%7C0%7C0%7C637194434220278715&sdata=GSrYIyxHb6 qQtGi1E%2BSkgF6q8nyC6uSKgO%2BWE7cxGm8%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 4 lines · Stanley.Yang
From: Tao Zhou <[email protected]>
centralize all debugfs creation in one place for ras
Might want to note that 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. With that added:
Quoted 65 lines
Signed-off-by Tao Zhou <[email protected]>Signed-off-by Stanley.Yang <[email protected]>Change-Id I7489ccb41dcf7a11ecc45313ad42940474999d81--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 29 +++++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 2 ++ 2 files changed, 31 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +29
-0@@ -1117,6 +1117,35 @@ void amdgpu_ras_debugfs_create(struct amdgpu_device *adev, &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,struct ras_common_if *head) {drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h +2
-1@@ -592,6 +592,8 @@ int amdgpu_ras_sysfs_remove(struct amdgpu_device *adev,void amdgpu_ras_debugfs_create (struct amdgpu_device *adev,struct ras_fs_if *head); +void amdgpu_ras_debugfs_create_all (struct amdgpu_device *adev); +void amdgpu_ras_debugfs_remove (struct amdgpu_device *adev,struct ras_common_if *head); --2.17.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx