Skip to content

Commit

Permalink
drm/amdgpu: Modify the count method of defer error
Browse files Browse the repository at this point in the history
The number of newly added de counts and the number of
newly added error addresses remain consistent

Signed-off-by: Ce Sun <cesun102@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Ce Sun authored and Alex Deucher committed May 13, 2025
1 parent 085c997 commit 533aa8b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ int amdgpu_umc_lookup_bad_pages_in_a_row(struct amdgpu_device *adev,
pfns[i] = err_data.err_addr[i].retired_page;
}
ret = i;
adev->umc.err_addr_cnt = err_data.err_addr_cnt;

out:
kfree(err_data.err_addr);
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ struct amdgpu_umc {
unsigned long active_mask;

struct amdgpu_umc_flip_bits flip_bits;

unsigned long err_addr_cnt;
};

int amdgpu_umc_ras_sw_init(struct amdgpu_device *adev);
Expand Down
8 changes: 6 additions & 2 deletions drivers/gpu/drm/amd/amdgpu/umc_v12_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,12 @@ static int umc_v12_0_aca_bank_parser(struct aca_handle *handle, struct aca_bank
bank->regs[ACA_REG_IDX_ADDR]);

ext_error_code = ACA_REG__STATUS__ERRORCODEEXT(status);
count = ext_error_code == 0 ?
ACA_REG__MISC0__ERRCNT(bank->regs[ACA_REG_IDX_MISC0]) : 1ULL;
if (umc_v12_0_is_deferred_error(adev, status))
count = ext_error_code == 0 ?
adev->umc.err_addr_cnt / adev->umc.retire_unit : 1ULL;
else
count = ext_error_code == 0 ?
ACA_REG__MISC0__ERRCNT(bank->regs[ACA_REG_IDX_MISC0]) : 1ULL;

return aca_error_cache_log_bank_error(handle, &info, err_type, count);
}
Expand Down

0 comments on commit 533aa8b

Please sign in to comment.