summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorTao Zhou <tao.zhou1@amd.com>2024-10-18 16:21:26 +0800
committerAlex Deucher <alexander.deucher@amd.com>2024-12-10 10:26:46 -0500
commit76723fbc5f8632570c6079a2f497c2f2132bce98 (patch)
tree741be5b40aba395120d1df4e138ae5c36192dd71 /drivers/gpu
parent4e7812e2372bc02809ca6eed285096baffee0ebf (diff)
drm/amdgpu: reduce memory usage for umc_lookup_bad_pages_in_a_row
The function handles one page in one time, allocating umc.retire_unit bad page records is enough. Signed-off-by: Tao Zhou <tao.zhou1@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c
index fe423253ac8c..5dd011a73ace 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c
@@ -452,8 +452,7 @@ int amdgpu_umc_lookup_bad_pages_in_a_row(struct amdgpu_device *adev,
struct ta_ras_query_address_output addr_out;
struct ras_err_data err_data;
- err_data.err_addr =
- kcalloc(adev->umc.max_ras_err_cnt_per_query,
+ err_data.err_addr = kcalloc(adev->umc.retire_unit,
sizeof(struct eeprom_table_record), GFP_KERNEL);
if (!err_data.err_addr) {
dev_warn(adev->dev, "Failed to alloc memory in bad page lookup!\n");
@@ -468,7 +467,7 @@ int amdgpu_umc_lookup_bad_pages_in_a_row(struct amdgpu_device *adev,
else
goto out;
- for (i = 0; i < adev->umc.max_ras_err_cnt_per_query; i++) {
+ for (i = 0; i < adev->umc.retire_unit; i++) {
if (pos >= len)
goto out;