drm/amdgpu: Decode deferred error type in gfx aca bank parser
Subsystems (2)
PATCH 1/1 drm/amdgpu: Decode deferred error type in gfx aca bank parser
In the case of injecting uncorrected error with background workload, the deferred error among uncorrected errors need to be specified by checking the deferred and poison bits of status register.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c | 3 +++ drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c +3 -0
@@ -541,6 +541,9 @@ static int __aca_get_error_data(struct amdgpu_device *adev, struct aca_handle *hif (ret)return ret; +if (type ==ACA_ERROR_TYPE_UE ) +aca_log_aca_error (handle,ACA_ERROR_TYPE_DEFERRED , err_data); +return aca_log_aca_error (handle, type, err_data); }
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +7 -4
@@ -876,7 +876,7 @@ static int gfx_v9_4_3_aca_bank_parser(struct aca_handle *handle, void *data) {struct aca_bank_info info; -u64 misc0; +u64 misc0, status;u32 instlo;int ret;
@@ -890,12 +890,15 @@ static int gfx_v9_4_3_aca_bank_parser(struct aca_handle *handle, info.die_id = instlo == mmSMNAID_XCD0_MCA_SMU ?0 :1 ; misc0 = bank->regs[ACA_REG_IDX_MISC0 ]; + status = bank->regs[ACA_REG_IDX_STATUS ];switch (type) {case ACA_SMU_TYPE_UE : - bank->aca_err_type =ACA_ERROR_TYPE_UE ; - ret =aca_error_cache_log_bank_error (handle, &info, -ACA_ERROR_TYPE_UE ,1ULL ); + bank->aca_err_type = (ACA_REG__STATUS__POISON (status) || +ACA_REG__STATUS__DEFERRED (status)) ? +ACA_ERROR_TYPE_DEFERRED : +ACA_ERROR_TYPE_UE ; + ret =aca_error_cache_log_bank_error (handle, &info, bank->aca_err_type,1ULL );break ;case ACA_SMU_TYPE_CE : bank->aca_err_type =ACA_BANK_ERR_CE_DE_DECODE (bank);
Signature · 1 line
2.34.1
[AMD Official Use Only - AMD Internal Distribution Only]
+ bank->aca_err_type = (ACA_REG__STATUS__POISON(status) ||
+ ACA_REG__STATUS__DEFERRED(status)) ?
+ ACA_ERROR_TYPE_DEFERRED :
+ ACA_ERROR_TYPE_UE;
Does it make more sense to create a macro similar to ACA_BANK_ERR_CE_DE_DECODE for above code segment?
Regards,
Hawking
-----Original Message-----
From: Liu, Xiang(Dean) <[email protected]>
Sent: Thursday, March 20, 2025 14:15
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Wang, Yang(Kevin) <[email protected]>; Zhou1, Tao <[email protected]>; Chai, Thomas <[email protected]>; Liu, Xiang(Dean) <[email protected]>
Subject: [PATCH] drm/amdgpu: Decode deferred error type in gfx aca bank parser
In the case of injecting uncorrected error with background workload, the deferred error among uncorrected errors need to be specified by checking the deferred and poison bits of status register.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c | 3 +++ drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c +3 -0
@@ -541,6 +541,9 @@ static int __aca_get_error_data(struct amdgpu_device *adev, struct aca_handle *hif (ret)return ret; +if (type ==ACA_ERROR_TYPE_UE ) +aca_log_aca_error (handle,ACA_ERROR_TYPE_DEFERRED , err_data); +return aca_log_aca_error (handle, type, err_data); }
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +8 -4
@@ -876,7 +876,7 @@ static int gfx_v9_4_3_aca_bank_parser(struct aca_handle *handle, void *data) {struct aca_bank_info info; -u64 misc0; +u64 misc0, status;u32 instlo;int ret;
@@ -890,12 +890,15 @@ static int gfx_v9_4_3_aca_bank_parser(struct aca_handle *handle, info.die_id = instlo == mmSMNAID_XCD0_MCA_SMU ?0 :1 ; misc0 = bank->regs[ACA_REG_IDX_MISC0 ]; + status = bank->regs[ACA_REG_IDX_STATUS ];switch (type) {case ACA_SMU_TYPE_UE : - bank->aca_err_type =ACA_ERROR_TYPE_UE ; - ret =aca_error_cache_log_bank_error (handle, &info, -ACA_ERROR_TYPE_UE ,1ULL ); + bank->aca_err_type = (ACA_REG__STATUS__POISON (status) || +ACA_REG__STATUS__DEFERRED (status)) ? +ACA_ERROR_TYPE_DEFERRED : +ACA_ERROR_TYPE_UE ; + ret =aca_error_cache_log_bank_error (handle, &info, +bank->aca_err_type,1ULL );break ;case ACA_SMU_TYPE_CE :
bank->aca_err_type = ACA_BANK_ERR_CE_DE_DECODE(bank);
--
2.34.1
[AMD Official Use Only - AMD Internal Distribution Only]
Thanks, will improve it.
Best Regards,
Dean
________________________________
From: Zhang, Hawking <[email protected]>
Sent: Thursday, March 20, 2025 2:22 PM
To: Liu, Xiang(Dean) <[email protected]>; [email protected] <[email protected]>
Cc: Wang, Yang(Kevin) <[email protected]>; Zhou1, Tao <[email protected]>; Chai, Thomas <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: Decode deferred error type in gfx aca bank parser
[AMD Official Use Only - AMD Internal Distribution Only]
+ bank->aca_err_type = (ACA_REG__STATUS__POISON(status) ||
+ ACA_REG__STATUS__DEFERRED(status)) ?
+ ACA_ERROR_TYPE_DEFERRED :
+ ACA_ERROR_TYPE_UE;
Does it make more sense to create a macro similar to ACA_BANK_ERR_CE_DE_DECODE for above code segment?
Regards,
Hawking
-----Original Message-----
From: Liu, Xiang(Dean) <[email protected]>
Sent: Thursday, March 20, 2025 14:15
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Wang, Yang(Kevin) <[email protected]>; Zhou1, Tao <[email protected]>; Chai, Thomas <[email protected]>; Liu, Xiang(Dean) <[email protected]>
Subject: [PATCH] drm/amdgpu: Decode deferred error type in gfx aca bank parser
In the case of injecting uncorrected error with background workload, the deferred error among uncorrected errors need to be specified by checking the deferred and poison bits of status register.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c | 3 +++ drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c +3 -0
@@ -541,6 +541,9 @@ static int __aca_get_error_data(struct amdgpu_device *adev, struct aca_handle *hif (ret)return ret; +if (type ==ACA_ERROR_TYPE_UE ) +aca_log_aca_error (handle,ACA_ERROR_TYPE_DEFERRED , err_data); +return aca_log_aca_error (handle, type, err_data); }
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +8 -4
@@ -876,7 +876,7 @@ static int gfx_v9_4_3_aca_bank_parser(struct aca_handle *handle, void *data) {struct aca_bank_info info; -u64 misc0; +u64 misc0, status;u32 instlo;int ret;
@@ -890,12 +890,15 @@ static int gfx_v9_4_3_aca_bank_parser(struct aca_handle *handle, info.die_id = instlo == mmSMNAID_XCD0_MCA_SMU ?0 :1 ; misc0 = bank->regs[ACA_REG_IDX_MISC0 ]; + status = bank->regs[ACA_REG_IDX_STATUS ];switch (type) {case ACA_SMU_TYPE_UE : - bank->aca_err_type =ACA_ERROR_TYPE_UE ; - ret =aca_error_cache_log_bank_error (handle, &info, -ACA_ERROR_TYPE_UE ,1ULL ); + bank->aca_err_type = (ACA_REG__STATUS__POISON (status) || +ACA_REG__STATUS__DEFERRED (status)) ? +ACA_ERROR_TYPE_DEFERRED : +ACA_ERROR_TYPE_UE ; + ret =aca_error_cache_log_bank_error (handle, &info, +bank->aca_err_type,1ULL );break ;case ACA_SMU_TYPE_CE :
bank->aca_err_type = ACA_BANK_ERR_CE_DE_DECODE(bank);
--
2.34.1
[AMD Official Use Only - AMD Internal Distribution Only]
+ if (type == ACA_ERROR_TYPE_UE)
+ aca_log_aca_error(handle, ACA_ERROR_TYPE_DEFERRED, err_data);
+
return aca_log_aca_error(handle, type, err_data); }
It seems that the above code is incorrect, which may lead to error statistics of different types of errors. In the aca parser interface, I think there is enough information to identify the types of errors and correctly count errors, Please double check it, thanks.
Best Regards,
Kevin
-----Original Message-----
From: Liu, Xiang(Dean) <[email protected]>
Sent: Thursday, March 20, 2025 14:15
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Wang, Yang(Kevin) <[email protected]>; Zhou1, Tao <[email protected]>; Chai, Thomas <[email protected]>; Liu, Xiang(Dean) <[email protected]>
Subject: [PATCH] drm/amdgpu: Decode deferred error type in gfx aca bank parser
In the case of injecting uncorrected error with background workload, the deferred error among uncorrected errors need to be specified by checking the deferred and poison bits of status register.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c | 3 +++ drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c +3 -0
@@ -541,6 +541,9 @@ static int __aca_get_error_data(struct amdgpu_device *adev, struct aca_handle *hif (ret)return ret; +if (type ==ACA_ERROR_TYPE_UE ) +aca_log_aca_error (handle,ACA_ERROR_TYPE_DEFERRED , err_data); +return aca_log_aca_error (handle, type, err_data); }
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +8 -4
@@ -876,7 +876,7 @@ static int gfx_v9_4_3_aca_bank_parser(struct aca_handle *handle, void *data) {struct aca_bank_info info; -u64 misc0; +u64 misc0, status;u32 instlo;int ret;
@@ -890,12 +890,15 @@ static int gfx_v9_4_3_aca_bank_parser(struct aca_handle *handle, info.die_id = instlo == mmSMNAID_XCD0_MCA_SMU ?0 :1 ; misc0 = bank->regs[ACA_REG_IDX_MISC0 ]; + status = bank->regs[ACA_REG_IDX_STATUS ];switch (type) {case ACA_SMU_TYPE_UE : - bank->aca_err_type =ACA_ERROR_TYPE_UE ; - ret =aca_error_cache_log_bank_error (handle, &info, -ACA_ERROR_TYPE_UE ,1ULL ); + bank->aca_err_type = (ACA_REG__STATUS__POISON (status) || +ACA_REG__STATUS__DEFERRED (status)) ? +ACA_ERROR_TYPE_DEFERRED : +ACA_ERROR_TYPE_UE ; + ret =aca_error_cache_log_bank_error (handle, &info, +bank->aca_err_type,1ULL );break ;case ACA_SMU_TYPE_CE :
bank->aca_err_type = ACA_BANK_ERR_CE_DE_DECODE(bank);
--
2.34.1
[AMD Official Use Only - AMD Internal Distribution Only]
Thanks, as the discuss offline, will improve it.
Best Regards,
Dean
________________________________
From: Wang, Yang(Kevin) <[email protected]>
Sent: Thursday, March 20, 2025 3:05 PM
To: Liu, Xiang(Dean) <[email protected]>; [email protected] <[email protected]>
Cc: Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; Chai, Thomas <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: Decode deferred error type in gfx aca bank parser
[AMD Official Use Only - AMD Internal Distribution Only]
+ if (type == ACA_ERROR_TYPE_UE)
+ aca_log_aca_error(handle, ACA_ERROR_TYPE_DEFERRED, err_data);
+
return aca_log_aca_error(handle, type, err_data); }
It seems that the above code is incorrect, which may lead to error statistics of different types of errors. In the aca parser interface, I think there is enough information to identify the types of errors and correctly count errors, Please double check it, thanks.
Best Regards,
Kevin
-----Original Message-----
From: Liu, Xiang(Dean) <[email protected]>
Sent: Thursday, March 20, 2025 14:15
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Wang, Yang(Kevin) <[email protected]>; Zhou1, Tao <[email protected]>; Chai, Thomas <[email protected]>; Liu, Xiang(Dean) <[email protected]>
Subject: [PATCH] drm/amdgpu: Decode deferred error type in gfx aca bank parser
In the case of injecting uncorrected error with background workload, the deferred error among uncorrected errors need to be specified by checking the deferred and poison bits of status register.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c | 3 +++ drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c +3 -0
@@ -541,6 +541,9 @@ static int __aca_get_error_data(struct amdgpu_device *adev, struct aca_handle *hif (ret)return ret; +if (type ==ACA_ERROR_TYPE_UE ) +aca_log_aca_error (handle,ACA_ERROR_TYPE_DEFERRED , err_data); +return aca_log_aca_error (handle, type, err_data); }
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +8 -4
@@ -876,7 +876,7 @@ static int gfx_v9_4_3_aca_bank_parser(struct aca_handle *handle, void *data) {struct aca_bank_info info; -u64 misc0; +u64 misc0, status;u32 instlo;int ret;
@@ -890,12 +890,15 @@ static int gfx_v9_4_3_aca_bank_parser(struct aca_handle *handle, info.die_id = instlo == mmSMNAID_XCD0_MCA_SMU ?0 :1 ; misc0 = bank->regs[ACA_REG_IDX_MISC0 ]; + status = bank->regs[ACA_REG_IDX_STATUS ];switch (type) {case ACA_SMU_TYPE_UE : - bank->aca_err_type =ACA_ERROR_TYPE_UE ; - ret =aca_error_cache_log_bank_error (handle, &info, -ACA_ERROR_TYPE_UE ,1ULL ); + bank->aca_err_type = (ACA_REG__STATUS__POISON (status) || +ACA_REG__STATUS__DEFERRED (status)) ? +ACA_ERROR_TYPE_DEFERRED : +ACA_ERROR_TYPE_UE ; + ret =aca_error_cache_log_bank_error (handle, &info, +bank->aca_err_type,1ULL );break ;case ACA_SMU_TYPE_CE :
bank->aca_err_type = ACA_BANK_ERR_CE_DE_DECODE(bank);
--
2.34.1