Commit a219ecbb authored by Guchun Chen's avatar Guchun Chen Committed by Alex Deucher

drm/amdgpu: disable page reservation when amdgpu_bad_page_threshold = 0

When amdgpu_bad_page_threshold = 0, bad page reservation stuffs
are skipped in either UMC ECC irq or page retirement calling of
sync flood isr.
Signed-off-by: default avatarGuchun Chen <guchun.chen@amd.com>
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent f848159b
...@@ -1676,7 +1676,7 @@ static int amdgpu_ras_load_bad_pages(struct amdgpu_device *adev) ...@@ -1676,7 +1676,7 @@ static int amdgpu_ras_load_bad_pages(struct amdgpu_device *adev)
int ret = 0; int ret = 0;
/* no bad page record, skip eeprom access */ /* no bad page record, skip eeprom access */
if (!control->num_recs) if (!control->num_recs || (amdgpu_bad_page_threshold == 0))
return ret; return ret;
bps = kcalloc(control->num_recs, sizeof(*bps), GFP_KERNEL); bps = kcalloc(control->num_recs, sizeof(*bps), GFP_KERNEL);
...@@ -1780,7 +1780,8 @@ int amdgpu_ras_reserve_bad_pages(struct amdgpu_device *adev) ...@@ -1780,7 +1780,8 @@ int amdgpu_ras_reserve_bad_pages(struct amdgpu_device *adev)
struct amdgpu_bo *bo = NULL; struct amdgpu_bo *bo = NULL;
int i, ret = 0; int i, ret = 0;
if (!con || !con->eh_data) /* Not reserve bad page when amdgpu_bad_page_threshold == 0. */
if (!con || !con->eh_data || (amdgpu_bad_page_threshold == 0))
return 0; return 0;
mutex_lock(&con->recovery_lock); mutex_lock(&con->recovery_lock);
......
...@@ -125,7 +125,8 @@ int amdgpu_umc_process_ras_data_cb(struct amdgpu_device *adev, ...@@ -125,7 +125,8 @@ int amdgpu_umc_process_ras_data_cb(struct amdgpu_device *adev,
"detected in UMC block\n", "detected in UMC block\n",
err_data->ue_count); err_data->ue_count);
if (err_data->err_addr_cnt && if ((amdgpu_bad_page_threshold != 0) &&
err_data->err_addr_cnt &&
amdgpu_ras_add_bad_pages(adev, err_data->err_addr, amdgpu_ras_add_bad_pages(adev, err_data->err_addr,
err_data->err_addr_cnt)) err_data->err_addr_cnt))
dev_warn(adev->dev, "Failed to add ras bad page!\n"); dev_warn(adev->dev, "Failed to add ras bad page!\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment