Commit 22503d80 authored by Dennis Li's avatar Dennis Li Committed by Alex Deucher

drm/amdgpu: change to save bad pages in UMC error interrupt callback

Instead of saving bad pages in amdgpu_ras_reset_gpu, it will reduce
the unnecessary calling of amdgpu_ras_save_bad_pages.
Signed-off-by: default avatarDennis Li <Dennis.Li@amd.com>
Reviewed-by: default avatarHawking Zhang <hawking.zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 9c94b5ef
...@@ -1668,7 +1668,7 @@ int amdgpu_ras_add_bad_pages(struct amdgpu_device *adev, ...@@ -1668,7 +1668,7 @@ int amdgpu_ras_add_bad_pages(struct amdgpu_device *adev,
* write error record array to eeprom, the function should be * write error record array to eeprom, the function should be
* protected by recovery_lock * protected by recovery_lock
*/ */
static int amdgpu_ras_save_bad_pages(struct amdgpu_device *adev) int amdgpu_ras_save_bad_pages(struct amdgpu_device *adev)
{ {
struct amdgpu_ras *con = amdgpu_ras_get_context(adev); struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
struct ras_err_handler_data *data; struct ras_err_handler_data *data;
...@@ -1841,9 +1841,6 @@ int amdgpu_ras_reserve_bad_pages(struct amdgpu_device *adev) ...@@ -1841,9 +1841,6 @@ int amdgpu_ras_reserve_bad_pages(struct amdgpu_device *adev)
data->last_reserved = i + 1; data->last_reserved = i + 1;
bo = NULL; bo = NULL;
} }
/* continue to save bad pages to eeprom even reesrve_vram fails */
ret = amdgpu_ras_save_bad_pages(adev);
out: out:
mutex_unlock(&con->recovery_lock); mutex_unlock(&con->recovery_lock);
return ret; return ret;
......
...@@ -506,6 +506,7 @@ bool amdgpu_ras_check_err_threshold(struct amdgpu_device *adev); ...@@ -506,6 +506,7 @@ bool amdgpu_ras_check_err_threshold(struct amdgpu_device *adev);
int amdgpu_ras_add_bad_pages(struct amdgpu_device *adev, int amdgpu_ras_add_bad_pages(struct amdgpu_device *adev,
struct eeprom_table_record *bps, int pages); struct eeprom_table_record *bps, int pages);
int amdgpu_ras_save_bad_pages(struct amdgpu_device *adev);
int amdgpu_ras_reserve_bad_pages(struct amdgpu_device *adev); int amdgpu_ras_reserve_bad_pages(struct amdgpu_device *adev);
static inline int amdgpu_ras_reset_gpu(struct amdgpu_device *adev) static inline int amdgpu_ras_reset_gpu(struct amdgpu_device *adev)
......
...@@ -126,10 +126,11 @@ int amdgpu_umc_process_ras_data_cb(struct amdgpu_device *adev, ...@@ -126,10 +126,11 @@ int amdgpu_umc_process_ras_data_cb(struct amdgpu_device *adev,
err_data->ue_count); err_data->ue_count);
if ((amdgpu_bad_page_threshold != 0) && if ((amdgpu_bad_page_threshold != 0) &&
err_data->err_addr_cnt && 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"); amdgpu_ras_save_bad_pages(adev);
}
amdgpu_ras_reset_gpu(adev); amdgpu_ras_reset_gpu(adev);
} }
......
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