drm/amdgpu: refine aca error cache for sdma v4.4.2
authorYang Wang <kevinyang.wang@amd.com>
Thu, 22 Feb 2024 02:11:31 +0000 (10:11 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 20 Mar 2024 17:38:15 +0000 (13:38 -0400)
refine aca error cache for sdma v4.4.2

Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c

index 9aa5c19..02fc11b 100644 (file)
@@ -2193,27 +2193,29 @@ static int sdma_v4_4_2_aca_bank_generate_report(struct aca_handle *handle,
                                                struct aca_bank *bank, enum aca_smu_type type,
                                                struct aca_bank_report *report, void *data)
 {
+       struct aca_bank_info info;
        u64 misc0;
        int ret;
 
-       ret = aca_bank_info_decode(bank, &report->info);
+       ret = aca_bank_info_decode(bank, &info);
        if (ret)
                return ret;
 
        misc0 = bank->regs[ACA_REG_IDX_MISC0];
-
        switch (type) {
        case ACA_SMU_TYPE_UE:
-               report->count[ACA_ERROR_TYPE_UE] = 1ULL;
+               ret = aca_error_cache_log_bank_error(handle, &info, ACA_ERROR_TYPE_UE,
+                                                    1ULL);
                break;
        case ACA_SMU_TYPE_CE:
-               report->count[ACA_ERROR_TYPE_CE] = ACA_REG__MISC0__ERRCNT(misc0);
+               ret = aca_error_cache_log_bank_error(handle, &info, ACA_ERROR_TYPE_CE,
+                                                    ACA_REG__MISC0__ERRCNT(misc0));
                break;
        default:
                return -EINVAL;
        }
 
-       return 0;
+       return ret;
 }
 
 /* CODE_SDMA0 - CODE_SDMA4, reference to smu driver if header file */