drm/amdgpu: define ras_reset_error_count function
Subsystems (3)
PATCH 1/6 drm/amdgpu: define ras_reset_error_count function
Make the code architecture more simple.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 ++------ drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 17 +++++++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 4 ++-- 4 files changed, 23 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -6
@@ -3594,9 +3594,7 @@ static void amdgpu_device_xgmi_reset_func(struct work_struct *__work)if (adev->asic_reset_res) goto fail; -if (adev->mmhub.ras && adev->mmhub.ras->ras_block.hw_ops && - adev->mmhub.ras->ras_block.hw_ops->reset_ras_error_count) - adev->mmhub.ras->ras_block.hw_ops->reset_ras_error_count (adev); +amdgpu_ras_reset_error_count (adev,AMDGPU_RAS_BLOCK__MMHUB ); }else {task_barrier_full (&hive->tb);
@@ -5242,9 +5240,7 @@ int amdgpu_do_asic_reset(struct list_head *device_list_handle,if (!r &&amdgpu_ras_intr_triggered ()) {list_for_each_entry (tmp_adev, device_list_handle, reset_list) { -if (tmp_adev->mmhub.ras && tmp_adev->mmhub.ras->ras_block.hw_ops && - tmp_adev->mmhub.ras->ras_block.hw_ops->reset_ras_error_count) - tmp_adev->mmhub.ras->ras_block.hw_ops->reset_ras_error_count (tmp_adev); +amdgpu_ras_reset_error_count (tmp_adev,AMDGPU_RAS_BLOCK__MMHUB ); }amdgpu_ras_intr_cleared ();
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +17 -0
@@ -1174,6 +1174,23 @@ int amdgpu_ras_query_error_status(struct amdgpu_device *adev,return ret; } +int amdgpu_ras_reset_error_count (struct amdgpu_device *adev, +enum amdgpu_ras_block block) +{ +struct amdgpu_ras_block_object *block_obj =amdgpu_ras_get_ras_block (adev, block,0 ); + +if (!block_obj || !block_obj->hw_ops) +return 0 ; + +if (!amdgpu_ras_is_supported (adev, block)) +return 0 ; + +if (block_obj->hw_ops->reset_ras_error_count) + block_obj->hw_ops->reset_ras_error_count (adev); + +return 0 ; +} +int amdgpu_ras_reset_error_status (struct amdgpu_device *adev,enum amdgpu_ras_block block) {
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h +2 -0
@@ -714,6 +714,8 @@ void amdgpu_ras_debugfs_create_all(struct amdgpu_device *adev);int amdgpu_ras_query_error_status (struct amdgpu_device *adev,struct ras_query_if *info); +int amdgpu_ras_reset_error_count (struct amdgpu_device *adev, +enum amdgpu_ras_block block);int amdgpu_ras_reset_error_status (struct amdgpu_device *adev,enum amdgpu_ras_block block);
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +2 -2
@@ -914,7 +914,7 @@ static int amdgpu_xgmi_ras_late_init(struct amdgpu_device *adev, struct ras_comm adev->gmc.xgmi.num_physical_nodes == 0)return 0 ; - adev->gmc.xgmi.ras->ras_block.hw_ops->reset_ras_error_count (adev); +amdgpu_ras_reset_error_count (adev,AMDGPU_RAS_BLOCK__XGMI_WAFL );return amdgpu_ras_block_late_init (adev, ras_block); }
@@ -1081,7 +1081,7 @@ static void amdgpu_xgmi_query_ras_error_count(struct amdgpu_device *adev,break ; } - adev->gmc.xgmi.ras->ras_block.hw_ops->reset_ras_error_count (adev); +amdgpu_ras_reset_error_count (adev,AMDGPU_RAS_BLOCK__XGMI_WAFL ); err_data->ue_count += ue_cnt; err_data->ce_count += ce_cnt;
Signature · 1 line
2.35.1
PATCH 2/6 drm/amdgpu: add set/get mca debug mode operations
Record the debug mode status in RAS.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 21 +++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 5 +++++ 2 files changed, 26 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +21 -0
@@ -3329,6 +3329,27 @@ int amdgpu_ras_reset_gpu(struct amdgpu_device *adev)return 0 ; } +void amdgpu_ras_set_mca_debug_mode (struct amdgpu_device *adev,bool enable) +{ +struct amdgpu_ras *con =amdgpu_ras_get_context (adev); + +if (con) + con->is_mca_debug_mode = enable; +} + +bool amdgpu_ras_get_mca_debug_mode (struct amdgpu_device *adev) +{ +struct amdgpu_ras *con =amdgpu_ras_get_context (adev); +const struct amdgpu_mca_smu_funcs *mca_funcs = adev->mca.mca_funcs; + +if (!con) +return false; + +if (mca_funcs && mca_funcs->mca_set_debug_mode) +return con->is_mca_debug_mode; +else +return true; +}/* Register each ip ras block into amdgpu ras */ int amdgpu_ras_register_ras_block(struct amdgpu_device *adev,
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h +5 -0
@@ -434,6 +434,8 @@ struct amdgpu_ras {/* Indicates smu whether need update bad channel info */ bool update_channel_flag; +/* Record status of smu mca debug mode */ +bool is_mca_debug_mode;/* Record special requirements of gpu reset caller */ uint32_t gpu_reset_flags;
@@ -768,6 +770,9 @@ struct amdgpu_ras* amdgpu_ras_get_context(struct amdgpu_device *adev);int amdgpu_ras_set_context (struct amdgpu_device *adev,struct amdgpu_ras *ras_con); +void amdgpu_ras_set_mca_debug_mode (struct amdgpu_device *adev,bool enable); +bool amdgpu_ras_get_mca_debug_mode (struct amdgpu_device *adev); +int amdgpu_ras_register_ras_block (struct amdgpu_device *adev,struct amdgpu_ras_block_object *ras_block_obj);void amdgpu_ras_interrupt_fatal_error_handler (struct amdgpu_device *adev);
Signature · 1 line
2.35.1
PATCH 3/6 drm/amd/pm: record mca debug mode in RAS
In reply to Tao ZhouCall amdgpu_ras_set_mca_debug_mode when we set mca debug mode in smu v13_0_6.
--- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +1 -0
@@ -1475,6 +1475,7 @@ static int smu_v13_0_6_mca_set_debug_mode(struct smu_context *smu, bool enable)if (smu->smc_fw_version <0x554800 )return 0 ; +amdgpu_ras_set_mca_debug_mode (smu->adev, enable);return smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_ClearMcaOnRead, enable ?0 : ClearMcaOnRead_UE_FLAG_MASK | ClearMcaOnRead_CE_POLL_MASK,NULL );
Signature · 1 line
2.35.1
PATCH 4/6 drm/amdgpu: bypass RAS error reset in some conditions
In reply to Tao ZhouPMFW is responsible for RAS error reset in some conditions, driver can skip the operation.
v2: add check for ras->in_recovery, it's set earlier than amdgpu_in_reset.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +18 -2
@@ -1178,11 +1178,19 @@ int amdgpu_ras_reset_error_count(struct amdgpu_device *adev, enum amdgpu_ras_block block) {struct amdgpu_ras_block_object *block_obj =amdgpu_ras_get_ras_block (adev, block,0 ); +struct amdgpu_ras *ras =amdgpu_ras_get_context (adev); +const struct amdgpu_mca_smu_funcs *mca_funcs = adev->mca.mca_funcs;if (!block_obj || !block_obj->hw_ops)return 0 ; -if (!amdgpu_ras_is_supported (adev, block)) +/* skip ras error reset in gpu reset */ +if (amdgpu_in_reset (adev) &&atomic_read (&ras->in_recovery) && + mca_funcs && mca_funcs->mca_set_debug_mode) +return 0 ; + +if (!amdgpu_ras_is_supported (adev, block) || + !amdgpu_ras_get_mca_debug_mode (adev))return 0 ;if (block_obj->hw_ops->reset_ras_error_count)
@@ -1195,6 +1203,8 @@ int amdgpu_ras_reset_error_status(struct amdgpu_device *adev, enum amdgpu_ras_block block) {struct amdgpu_ras_block_object *block_obj =amdgpu_ras_get_ras_block (adev, block,0 ); +struct amdgpu_ras *ras =amdgpu_ras_get_context (adev); +const struct amdgpu_mca_smu_funcs *mca_funcs = adev->mca.mca_funcs;if (!block_obj || !block_obj->hw_ops) { dev_dbg_once(adev->dev, "%s doesn't config RAS function\n",
@@ -1202,7 +1212,13 @@ int amdgpu_ras_reset_error_status(struct amdgpu_device *adev,return 0 ; } -if (!amdgpu_ras_is_supported (adev, block)) +/* skip ras error reset in gpu reset */ +if (amdgpu_in_reset (adev) &&atomic_read (&ras->in_recovery) && + mca_funcs && mca_funcs->mca_set_debug_mode) +return 0 ; + +if (!amdgpu_ras_is_supported (adev, block) || + !amdgpu_ras_get_mca_debug_mode (adev))return 0 ;if (block_obj->hw_ops->reset_ras_error_count)
Signature · 1 line
2.35.1
RE: [PATCH 4/6] drm/amdgpu: bypass RAS error reset in some conditions
[AMD Official Use Only - General]
Quoted 33 lines
-----Original Message-----
From: Zhou1, Tao <[email protected]>
Sent: Tuesday, October 17, 2023 8:46 PM
To: [email protected]; Zhang, Hawking <[email protected]>; Yang, Stanley <[email protected]>; Li, Candice <[email protected]>; Chai, Thomas <[email protected]>; Lazar, Lijo <[email protected]>; Wang, Yang(Kevin) <[email protected]>
Cc: Zhou1, Tao <[email protected]>
Subject: [PATCH 4/6] drm/amdgpu: bypass RAS error reset in some conditionsPMFW is responsible for RAS error reset in some conditions, driver can skip the operation.
v2: add check for
ras->in_recovery, it's set earlier thanamdgpu_in_reset.Signed-off-by Tao Zhou <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +1
-0@@ -1178,11 +1178,19 @@ int amdgpu_ras_reset_error_count(structamdgpu_device *adev, enum amdgpu_ras_block block) { struct amdgpu_ras_block_object *block_obj =amdgpu_ras_get_ras_block (adev, block,0 ); +struct amdgpu_ras *ras =amdgpu_ras_get_context (adev);
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c int amdgpu_ras_reset_error_count(struct · line 1192
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +4
-1+const struct amdgpu_mca_smu_funcs *mca_funcs = adev- >mca.mca_funcs;if (!block_obj || !block_obj->hw_ops)return 0 ; -if (!amdgpu_ras_is_supported (adev, block)) +/* skip ras error reset in gpu reset */ +if (amdgpu_in_reset (adev) &&atomic_read (&ras->in_recovery) && + mca_funcs && mca_funcs->mca_set_debug_mode)
[Stanley]: The check condition amdgpu_in_reset(adev) && atomic_read(&ras->in_recovery) should be modify to (amdgpu_in_reset(adev) || atomic_read(&ras->in_recovery)), Can we check ras->is_mca_debug_mode directly since patch#2 and patch#3 set it.
Regards,
Stanley
Quoted 24 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +4
-0+return 0 ; + +if (!amdgpu_ras_is_supported (adev, block) || + !amdgpu_ras_get_mca_debug_mode (adev))return 0; if (block_obj->hw_ops->reset_ras_error_count)drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +2
-0@@ -1195,6 +1203,8 @@ int amdgpu_ras_reset_error_status(structamdgpu_device *adev, enum amdgpu_ras_block block) { struct amdgpu_ras_block_object *block_obj =amdgpu_ras_get_ras_block (adev, block,0 ); +struct amdgpu_ras *ras =amdgpu_ras_get_context (adev); +const struct amdgpu_mca_smu_funcs *mca_funcs = adev- >mca.mca_funcs;if (!block_obj || !block_obj->hw_ops) { dev_dbg_once(adev->dev, "%s doesn't config RAS function\n", @@ -1202,7 +1212,13 @@ int amdgpu_ras_reset_error_status(struct amdgpu_device *adev, return 0; }
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c int amdgpu_ras_reset_error_count(struct amdgpu_device *adev, · line 1189
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +3
-1-if (!amdgpu_ras_is_supported (adev, block)) +/* skip ras error reset in gpu reset */ +if (amdgpu_in_reset (adev) &&atomic_read (&ras->in_recovery) && + mca_funcs && mca_funcs->mca_set_debug_mode)
[Stanley]: Same as above.
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +4
-1+return 0 ; + +if (!amdgpu_ras_is_supported (adev, block) || + !amdgpu_ras_get_mca_debug_mode (adev))return 0 ;if (block_obj->hw_ops->reset_ras_error_count) --2.35.1
PATCH 5/6 drm/amdgpu: reuse amdgpu_ras_reset_error_count code
In reply to Tao ZhouTo simplify the code of amdgpu_ras_reset_error_status without logical change.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 30 +++++++------------------ 1 file changed, 8 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +8 -22
@@ -1181,17 +1181,20 @@ int amdgpu_ras_reset_error_count(struct amdgpu_device *adev,struct amdgpu_ras *ras =amdgpu_ras_get_context (adev);const struct amdgpu_mca_smu_funcs *mca_funcs = adev->mca.mca_funcs; -if (!block_obj || !block_obj->hw_ops) -return 0 ; +if (!block_obj || !block_obj->hw_ops) { +dev_dbg_once (adev->dev,"%s doesn't config RAS function\n" , +ras_block_str (block)); +return -EOPNOTSUPP ; + }/* skip ras error reset in gpu reset */ if (amdgpu_in_reset (adev) &&atomic_read (&ras->in_recovery) && mca_funcs && mca_funcs->mca_set_debug_mode) -return 0 ; +return -EOPNOTSUPP ;if (!amdgpu_ras_is_supported (adev, block) || !amdgpu_ras_get_mca_debug_mode (adev)) -return 0 ; +return -EOPNOTSUPP ;if (block_obj->hw_ops->reset_ras_error_count) block_obj->hw_ops->reset_ras_error_count (adev);
@@ -1203,27 +1206,10 @@ int amdgpu_ras_reset_error_status(struct amdgpu_device *adev, enum amdgpu_ras_block block) {struct amdgpu_ras_block_object *block_obj =amdgpu_ras_get_ras_block (adev, block,0 ); -struct amdgpu_ras *ras =amdgpu_ras_get_context (adev); -const struct amdgpu_mca_smu_funcs *mca_funcs = adev->mca.mca_funcs; - -if (!block_obj || !block_obj->hw_ops) { -dev_dbg_once (adev->dev,"%s doesn't config RAS function\n" , -ras_block_str (block)); -return 0 ; - } -/* skip ras error reset in gpu reset */ -if (amdgpu_in_reset (adev) &&atomic_read (&ras->in_recovery) && - mca_funcs && mca_funcs->mca_set_debug_mode) +if (amdgpu_ras_reset_error_count (adev, block) == -EOPNOTSUPP )return 0 ; -if (!amdgpu_ras_is_supported (adev, block) || - !amdgpu_ras_get_mca_debug_mode (adev)) -return 0 ; - -if (block_obj->hw_ops->reset_ras_error_count) - block_obj->hw_ops->reset_ras_error_count (adev); -if ((block ==AMDGPU_RAS_BLOCK__GFX ) || (block ==AMDGPU_RAS_BLOCK__MMHUB )) {if (block_obj->hw_ops->reset_ras_error_status)
Signature · 1 line
2.35.1
PATCH 6/6 drm/amdgpu: drop status reset for GCEA 9.4.3 and MMEA 1.8
In reply to Tao ZhouPMFW will be responsible for it.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 22 ------- drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c | 86 ------------------------- 2 files changed, 108 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +0 -22
@@ -3996,27 +3996,6 @@ static void gfx_v9_4_3_inst_reset_utc_err_status(struct amdgpu_device *adev,WREG32_SOC15 (GC ,GET_INST (GC , xcc_id), regVML2_WALKER_MEM_ECC_STATUS,0x3 ); } -static void gfx_v9_4_3_inst_reset_ea_err_status (struct amdgpu_device *adev, -int xcc_id) -{ -uint32_t i, j; -uint32_t value; - -mutex_lock (&adev->grbm_idx_mutex); -for (i =0 ; i < gfx_v9_4_3_ea_err_status_regs.se_num; i++) { -for (j =0 ; j < gfx_v9_4_3_ea_err_status_regs.instance; j++) { -gfx_v9_4_3_xcc_select_se_sh (adev, i,0 , j, xcc_id); - value =RREG32_SOC15 (GC ,GET_INST (GC , xcc_id), regGCEA_ERR_STATUS); - value =REG_SET_FIELD (value,GCEA_ERR_STATUS , -CLEAR_ERROR_STATUS ,0x1 ); -WREG32_SOC15 (GC ,GET_INST (GC , xcc_id), regGCEA_ERR_STATUS, value); - } - } -gfx_v9_4_3_xcc_select_se_sh (adev,0xffffffff ,0xffffffff ,0xffffffff , - xcc_id); -mutex_unlock (&adev->grbm_idx_mutex); -} -static void gfx_v9_4_3_inst_reset_sq_timeout_status (struct amdgpu_device *adev,int xcc_id) {
@@ -4042,7 +4021,6 @@ static void gfx_v9_4_3_inst_reset_ras_err_status(struct amdgpu_device *adev, void *ras_error_status, int xcc_id) {gfx_v9_4_3_inst_reset_utc_err_status (adev ,xcc_id ); -gfx_v9_4_3_inst_reset_ea_err_status (adev, xcc_id);gfx_v9_4_3_inst_reset_sq_timeout_status (adev, xcc_id); }
drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c +0 -86
96 lines not on this page · raw message
Signature · 1 line
2.35.1
RE: [PATCH 6/6] drm/amdgpu: drop status reset for GCEA 9.4.3 and MMEA 1.8
[AMD Official Use Only - General]
PMfw doesn't reset any ce/ue status and count in debug mode, who takes responsible for it if in debug mode.
Regards,
Stanley
Quoted 185 lines
-----Original Message-----
From: Zhou1, Tao <[email protected]>
Sent: Tuesday, October 17, 2023 8:46 PM
To: [email protected]; Zhang, Hawking <[email protected]>; Yang, Stanley <[email protected]>; Li, Candice <[email protected]>; Chai, Thomas <[email protected]>; Lazar, Lijo <[email protected]>; Wang, Yang(Kevin) <[email protected]>
Cc: Zhou1, Tao <[email protected]>
Subject: [PATCH 6/6] drm/amdgpu: drop status reset for GCEA 9.4.3 and MMEA 1.8PMFW will be responsible for it.
Signed-off-by Tao Zhou <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 22 ------- drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c | 86 ------------------------- 2 files changed, 108 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +0
-14@@ -3996,27 +3996,6 @@ static void gfx_v9_4_3_inst_reset_utc_err_status(struct amdgpu_device *adev,WREG32_SOC15 (GC, GET_INST(GC ,xcc_id ), regVML2_WALKER_MEM_ECC_STATUS, 0x3); } -static void gfx_v9_4_3_inst_reset_ea_err_status (struct amdgpu_device *adev, -int xcc_id) -{ -uint32_t i, j; -uint32_t value; - -mutex_lock (&adev->grbm_idx_mutex); -for (i =0 ; i < gfx_v9_4_3_ea_err_status_regs.se_num; i++) { -for (j =0 ; j < gfx_v9_4_3_ea_err_status_regs.instance; j++) { -gfx_v9_4_3_xcc_select_se_sh (adev, i,0 , j, xcc_id); - value =RREG32_SOC15 (GC ,GET_INST (GC , xcc_id), regGCEA_ERR_STATUS); - value =REG_SET_FIELD (value,GCEA_ERR_STATUS , -CLEAR_ERROR_STATUS ,0x1 ); - WREG32_SOC15(GC, GET_INST(GC, xcc_id),
regGCEA_ERR_STATUS, value);drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +0
-7- } - } -gfx_v9_4_3_xcc_select_se_sh (adev,0xffffffff ,0xffffffff ,0xffffffff , - xcc_id); -mutex_unlock (&adev->grbm_idx_mutex); -} - static void gfx_v9_4_3_inst_reset_sq_timeout_status(struct amdgpu_device*adev,
intxcc_id)
{drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +0
-1@@ -4042,7 +4021,6 @@ static void gfx_v9_4_3_inst_reset_ras_err_status(struct amdgpu_device *adev, void *ras_error_status, int xcc_id) {gfx_v9_4_3_inst_reset_utc_err_status (adev, xcc_id); -gfx_v9_4_3_inst_reset_ea_err_status (adev, xcc_id);gfx_v9_4_3_inst_reset_sq_timeout_status (adev, xcc_id); }drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c +0
-40@@ -756,96 +756,10 @@ static voidmmhub_v1_8_query_ras_error_status(struct amdgpu_device *adev) mmhub_v1_8_inst_query_ras_err_status(adev, i); } -static void mmhub_v1_8_inst_reset_ras_err_status (struct amdgpu_device *adev, -uint32_t mmhub_inst) -{ -uint32_t mmea_cgtt_clk_cntl_addr_dist; -uint32_t mmea_err_status_addr_dist; -uint32_t reg_value; -uint32_t i; - -/* reset mmea ras err status */ - mmea_cgtt_clk_cntl_addr_dist = regMMEA1_CGTT_CLK_CTRL -regMMEA0_CGTT_CLK_CTRL; - mmea_err_status_addr_dist = regMMEA1_ERR_STATUS -regMMEA0_ERR_STATUS; -for (i =0 ; i <ARRAY_SIZE (mmhub_v1_8_mmea_err_status_reg); i++) { -/* force clk branch on for response path -* set MMEA0_CGTT_CLK_CTRL.SOFT_OVERRIDE_RETURN = 1 -*/ - reg_value =RREG32_SOC15_OFFSET (MMHUB , mmhub_inst, - regMMEA0_CGTT_CLK_CTRL, - i *mmea_cgtt_clk_cntl_addr_dist); - reg_value =REG_SET_FIELD (reg_value,MMEA0_CGTT_CLK_CTRL, -SOFT_OVERRIDE_RETURN ,1 ); -WREG32_SOC15_OFFSET (MMHUB , mmhub_inst, - regMMEA0_CGTT_CLK_CTRL, - i * mmea_cgtt_clk_cntl_addr_dist, - reg_value); - -/* set MMEA0_ERR_STATUS.CLEAR_ERROR_STATUS = 1 */ - reg_value =RREG32_SOC15_OFFSET (MMHUB , mmhub_inst, - regMMEA0_ERR_STATUS, - i *mmea_err_status_addr_dist); - reg_value =REG_SET_FIELD (reg_value,MMEA0_ERR_STATUS , -CLEAR_ERROR_STATUS ,1 ); -WREG32_SOC15_OFFSET (MMHUB , mmhub_inst, - regMMEA0_ERR_STATUS, - i * mmea_err_status_addr_dist, - reg_value); - -/* set MMEA0_CGTT_CLK_CTRL.SOFT_OVERRIDE_RETURN = 0 */ - reg_value = RREG32_SOC15_OFFSET(MMHUB, mmhub_inst, - regMMEA0_CGTT_CLK_CTRL, - i *
mmea_cgtt_clk_cntl_addr_dist);
-reg_value= REG_SET_FIELD(reg_value,MMEA0_CGTT_CLK_CTRL,drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c +0
-12- SOFT_OVERRIDE_RETURN, 0); -WREG32_SOC15_OFFSET (MMHUB , mmhub_inst, - regMMEA0_CGTT_CLK_CTRL, - i * mmea_cgtt_clk_cntl_addr_dist, - reg_value); - } - -/* reset mm_cane ras err status -* force clk branch on for response path -* set MM_CANE_ICG_CTRL.SOFT_OVERRIDE_ATRET = 1 -*/ - reg_value = RREG32_SOC15(MMHUB, mmhub_inst,
regMM_CANE_ICG_CTRL);drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c +0
-3- reg_value =REG_SET_FIELD (reg_value,MM_CANE_ICG_CTRL , -SOFT_OVERRIDE_ATRET ,1 ); - WREG32_SOC15(MMHUB, mmhub_inst, regMM_CANE_ICG_CTRL,
reg_value);drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c +0
-3- -/* set MM_CANE_ERR_STATUS.CLEAR_ERROR_STATUS = 1 */ - reg_value = RREG32_SOC15(MMHUB, mmhub_inst,
regMM_CANE_ERR_STATUS);drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c +0
-3- reg_value =REG_SET_FIELD (reg_value,MM_CANE_ERR_STATUS , -CLEAR_ERROR_STATUS ,1 ); - WREG32_SOC15(MMHUB, mmhub_inst, regMM_CANE_ERR_STATUS,
reg_value);drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c +0
-3- -/* set MM_CANE_ICG_CTRL.SOFT_OVERRIDE_ATRET = 0 */ - reg_value = RREG32_SOC15(MMHUB, mmhub_inst,
regMM_CANE_ICG_CTRL);drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c +0
-3- reg_value =REG_SET_FIELD (reg_value,MM_CANE_ICG_CTRL , -SOFT_OVERRIDE_ATRET ,0 ); - WREG32_SOC15(MMHUB, mmhub_inst, regMM_CANE_ICG_CTRL,
reg_value);drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c +0
-3-} - -static void mmhub_v1_8_reset_ras_error_status(struct amdgpu_device*adev) -{
drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c +0
-4-uint32_t inst_mask; -uint32_t i; - - if (!amdgpu_ras_is_supported(adev,
AMDGPU_RAS_BLOCK__MMHUB)) {drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c +0
-11-dev_warn (adev->dev,"MMHUB RAS is not supported\n" ); -return ; - } - - inst_mask = adev->aid_mask; -for_each_inst (i, inst_mask) -mmhub_v1_8_inst_reset_ras_err_status (adev, i); -} -static const struct amdgpu_ras_block_hw_ops mmhub_v1_8_ras_hw_ops = { .query_ras_error_count = mmhub_v1_8_query_ras_error_count, .reset_ras_error_count = mmhub_v1_8_reset_ras_error_count, .query_ras_error_status = mmhub_v1_8_query_ras_error_status, - .reset_ras_error_status = mmhub_v1_8_reset_ras_error_status, };struct amdgpu_mmhub_ras mmhub_v1_8_ras = { --2.35.1