drm/amdgpu: Get mca address for old eeprom records
authorganglxie <ganglxie@amd.com>
Thu, 22 May 2025 07:14:28 +0000 (15:14 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 29 May 2025 14:57:09 +0000 (10:57 -0400)
after getting mca address for old eeprom records with 'address==0', it can be
correctly parsed under none-nps1, or it will be dropped.

Signed-off-by: ganglxie <ganglxie@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

index b0b1dbd4ae357a15c67a53eb89251c9cc7ecb12f..de0944947eaf1e52c9f544fc3096fd9cc383d7d1 100644 (file)
@@ -2859,6 +2859,15 @@ static int __amdgpu_ras_convert_rec_array_from_rom(struct amdgpu_device *adev,
                                return -EINVAL;
                }
        } else {
+               if (bps[0].address == 0) {
+                       /* for specific old eeprom data, mca address is not stored,
+                        * calc it from pa
+                        */
+                       if (amdgpu_umc_pa2mca(adev, bps[0].retired_page << AMDGPU_GPU_PAGE_SHIFT,
+                               &(bps[0].address), AMDGPU_NPS1_PARTITION_MODE))
+                               return -EINVAL;
+               }
+
                if (amdgpu_ras_mca2pa(adev, &bps[0], err_data)) {
                        if (nps == AMDGPU_NPS1_PARTITION_MODE)
                                memcpy(err_data->err_addr, bps,