diff options
| author | Tao Zhou <tao.zhou1@amd.com> | 2024-10-30 09:17:49 +0300 | 
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2024-12-10 18:26:46 +0300 | 
| commit | 2206daa1f9182a08aea92213dc2bcb387173dab1 (patch) | |
| tree | e1543d0b4908d72e1f95cbe6fdcaa0ec9b6c3970 /drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | |
| parent | 71a0e9630027f77d7646c5b750593c9ecfaa27d3 (diff) | |
| download | linux-2206daa1f9182a08aea92213dc2bcb387173dab1.tar.xz | |
drm/amdgpu: add a flag to indicate UMC channel index version
v1 (legacy way): store channel index within a UMC instance in eeprom
v2: store global channel index in eeprom
V2: only save the flag on eeprom, clear it after saving.
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/drm/amd/amdgpu/amdgpu_ras_eeprom.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 11 | 
1 files changed, 10 insertions, 1 deletions
| diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c index f28f6b4ba765..f4a9e15389ae 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c @@ -841,7 +841,7 @@ int amdgpu_ras_eeprom_append(struct amdgpu_ras_eeprom_control *control,  			     const u32 num)  {  	struct amdgpu_device *adev = to_amdgpu_device(control); -	int res; +	int res, i;  	if (!__is_ras_eeprom_supported(adev))  		return 0; @@ -855,6 +855,10 @@ int amdgpu_ras_eeprom_append(struct amdgpu_ras_eeprom_control *control,  		return -EINVAL;  	} +	/* set the new channel index flag */ +	for (i = 0; i < num; i++) +		record[i].retired_page |= UMC_CHANNEL_IDX_V2; +  	mutex_lock(&control->ras_tbl_mutex);  	res = amdgpu_ras_eeprom_append_table(control, record, num); @@ -864,6 +868,11 @@ int amdgpu_ras_eeprom_append(struct amdgpu_ras_eeprom_control *control,  		amdgpu_ras_debugfs_set_ret_size(control);  	mutex_unlock(&control->ras_tbl_mutex); + +	/* clear channel index flag, the flag is only saved on eeprom */ +	for (i = 0; i < num; i++) +		record[i].retired_page &= ~UMC_CHANNEL_IDX_V2; +  	return res;  } | 
