drm/amdgpu: compatible with specific RAS old eeprom format
Subsystems (2)
PATCH 1/2 drm/amdgpu: compatible with specific RAS old eeprom format
Handle RAS eeprom record when UMC_CHANNEL_IDX_V2 is set.
v2: get UMC_CHANNEL_IDX_V2 flag before the clear of it.
Signed-off-by Tao Zhou <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +12 -5
@@ -3118,9 +3118,11 @@ static int __amdgpu_ras_convert_rec_array_from_rom(struct amdgpu_device *adev, enum amdgpu_memory_partition nps) {int i =0 ; +uint32_t chan_idx_v2;enum amdgpu_memory_partition save_nps; save_nps = (bps[0 ].retired_page >>UMC_NPS_SHIFT ) &UMC_NPS_MASK ; + chan_idx_v2 = bps[0 ].retired_page &UMC_CHANNEL_IDX_V2 ;/*old asics just have pa in eeprom*/ if (IP_VERSION_MAJ (amdgpu_ip_version (adev,UMC_HWIP ,0 )) <12 ) {
@@ -3132,7 +3134,7 @@ static int __amdgpu_ras_convert_rec_array_from_rom(struct amdgpu_device *adev,for (i =0 ; i < adev->umc.retire_unit; i++) bps[i].retired_page &= ~(UMC_NPS_MASK <<UMC_NPS_SHIFT ); -if (save_nps) { +if (save_nps || chan_idx_v2) {if (save_nps == nps) {if (amdgpu_umc_pages_in_a_row (adev, err_data, bps[0 ].retired_page <<AMDGPU_GPU_PAGE_SHIFT ))
@@ -3176,10 +3178,12 @@ static int __amdgpu_ras_convert_rec_from_rom(struct amdgpu_device *adev, enum amdgpu_memory_partition nps) {int i =0 ; +uint32_t chan_idx_v2;enum amdgpu_memory_partition save_nps;if (!amdgpu_ras_smu_eeprom_supported (adev)) { save_nps = (bps->retired_page >>UMC_NPS_SHIFT ) &UMC_NPS_MASK ; + chan_idx_v2 = bps->retired_page &UMC_CHANNEL_IDX_V2 ; bps->retired_page &= ~(UMC_NPS_MASK <<UMC_NPS_SHIFT ); }else {/* if pmfw manages eeprom, save_nps is not stored on eeprom,
@@ -3201,16 +3205,19 @@ static int __amdgpu_ras_convert_rec_from_rom(struct amdgpu_device *adev, err_data->err_addr[i].mcumc_id = bps->mcumc_id; } }else { -if (bps->address) { +if (save_nps || chan_idx_v2) {if (amdgpu_ras_mca2pa_by_idx (adev, bps, err_data))return -EINVAL ; }else {/* for specific old eeprom data, mca address is not stored, * calc it from pa */ -if (amdgpu_umc_pa2mca (adev, bps->retired_page <<AMDGPU_GPU_PAGE_SHIFT , - &(bps->address),AMDGPU_NPS1_PARTITION_MODE )) -return -EINVAL ; +if (bps->address ==0 ) +if (amdgpu_umc_pa2mca (adev, + bps->retired_page <<AMDGPU_GPU_PAGE_SHIFT , + &(bps->address), +AMDGPU_NPS1_PARTITION_MODE )) +return -EINVAL ;if (amdgpu_ras_mca2pa (adev, bps, err_data))return -EOPNOTSUPP ;
Signature · 1 line
2.34.1
PATCH 2/2 drm/amdgpu: clear related counter after RAS eeprom reset
Make eeprom data and its counter consistent.
Signed-off-by Tao Zhou <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +3 -0
@@ -508,6 +508,9 @@ int amdgpu_ras_eeprom_reset_table(struct amdgpu_ras_eeprom_control *control) control->bad_channel_bitmap =0 ;amdgpu_dpm_send_hbm_bad_channel_flag (adev, control->bad_channel_bitmap); con->update_channel_flag = false; +/* there is no record on eeprom now, clear the counter */ +if (con->eh_data) + con->eh_data->count_saved =0 ;amdgpu_ras_debugfs_set_ret_size (control);
Signature · 1 line
2.34.1
RE: [PATCH 2/2] drm/amdgpu: clear related counter after RAS eeprom reset
[AMD Official Use Only - AMD Internal Distribution Only]
Series is
Reviewed-by Hawking Zhang <[email protected]>
Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Tao Zhou
Sent: Thursday, February 26, 2026 16:13
To: [email protected]
Cc: Zhou1, Tao <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu: clear related counter after RAS eeprom reset
Make eeprom data and its counter consistent.
Signed-off-by Tao Zhou <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +3 -0
@@ -508,6 +508,9 @@ int amdgpu_ras_eeprom_reset_table(struct amdgpu_ras_eeprom_control *control) control->bad_channel_bitmap =0 ;amdgpu_dpm_send_hbm_bad_channel_flag (adev, control->bad_channel_bitmap); con->update_channel_flag = false; +/* there is no record on eeprom now, clear the counter */ +if (con->eh_data) + con->eh_data->count_saved =0 ;amdgpu_ras_debugfs_set_ret_size (control);
--
2.34.1