Skip to content

Commit e1ca536

Browse files
Tao Zhoualexdeucher
authored andcommitted
drm/amdgpu: support to load RAS bad pages from PMFW
PMFW manages eeprom bad page records, update bad page loading accrodingly. 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>
1 parent 1ad25fd commit e1ca536

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3158,8 +3158,12 @@ static int __amdgpu_ras_convert_rec_from_rom(struct amdgpu_device *adev,
31583158
int i = 0;
31593159
enum amdgpu_memory_partition save_nps;
31603160

3161-
save_nps = (bps->retired_page >> UMC_NPS_SHIFT) & UMC_NPS_MASK;
3162-
bps->retired_page &= ~(UMC_NPS_MASK << UMC_NPS_SHIFT);
3161+
if (!amdgpu_ras_smu_eeprom_supported(adev)) {
3162+
save_nps = (bps->retired_page >> UMC_NPS_SHIFT) & UMC_NPS_MASK;
3163+
bps->retired_page &= ~(UMC_NPS_MASK << UMC_NPS_SHIFT);
3164+
} else {
3165+
save_nps = nps;
3166+
}
31633167

31643168
if (save_nps == nps) {
31653169
if (amdgpu_umc_pages_in_a_row(adev, err_data,
@@ -3225,7 +3229,8 @@ int amdgpu_ras_add_bad_pages(struct amdgpu_device *adev,
32253229

32263230
if (from_rom) {
32273231
/* there is no pa recs in V3, so skip pa recs processing */
3228-
if (control->tbl_hdr.version < RAS_TABLE_VER_V3) {
3232+
if ((control->tbl_hdr.version < RAS_TABLE_VER_V3) &&
3233+
!amdgpu_ras_smu_eeprom_supported(adev)) {
32293234
for (i = 0; i < pages; i++) {
32303235
if (control->ras_num_recs - i >= adev->umc.retire_unit) {
32313236
if ((bps[i].address == bps[i + 1].address) &&
@@ -3356,7 +3361,8 @@ static int amdgpu_ras_load_bad_pages(struct amdgpu_device *adev)
33563361
/*In V3, there is no pa recs, and some cases(when address==0) may be parsed
33573362
as pa recs, so add verion check to avoid it.
33583363
*/
3359-
if (control->tbl_hdr.version < RAS_TABLE_VER_V3) {
3364+
if ((control->tbl_hdr.version < RAS_TABLE_VER_V3) &&
3365+
!amdgpu_ras_smu_eeprom_supported(adev)) {
33603366
for (i = 0; i < control->ras_num_recs; i++) {
33613367
if ((control->ras_num_recs - i) >= adev->umc.retire_unit) {
33623368
if ((bps[i].address == bps[i + 1].address) &&

0 commit comments

Comments
 (0)