mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
drm/amdgpu: handle old RAS eeprom data in non-nps1 mode
Get MCA address from PA in nps1, then convert MCA address to PA in specific nps mode. Signed-off-by: ganglxie <ganglxie@amd.com> Reviewed-by: Tao Zhou <tao.zhou1@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
90237b16ec
commit
31e837d242
|
|
@ -2886,8 +2886,20 @@ static int __amdgpu_ras_convert_rec_from_rom(struct amdgpu_device *adev,
|
|||
bps->retired_page << AMDGPU_GPU_PAGE_SHIFT))
|
||||
return -EINVAL;
|
||||
} else {
|
||||
if (amdgpu_ras_mca2pa_by_idx(adev, bps, err_data))
|
||||
return -EINVAL;
|
||||
if (bps->address) {
|
||||
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 (amdgpu_ras_mca2pa(adev, bps, err_data))
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
}
|
||||
|
||||
return __amdgpu_ras_restore_bad_pages(adev, err_data->err_addr,
|
||||
|
|
|
|||
|
|
@ -562,3 +562,26 @@ int amdgpu_umc_mca_to_addr(struct amdgpu_device *adev,
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int amdgpu_umc_pa2mca(struct amdgpu_device *adev,
|
||||
uint64_t pa, uint64_t *mca, enum amdgpu_memory_partition nps)
|
||||
{
|
||||
struct ta_ras_query_address_input addr_in;
|
||||
struct ta_ras_query_address_output addr_out;
|
||||
int ret;
|
||||
|
||||
/* nps: the pa belongs to */
|
||||
addr_in.pa.pa = pa | ((uint64_t)nps << 58);
|
||||
addr_in.addr_type = TA_RAS_PA_TO_MCA;
|
||||
ret = psp_ras_query_address(&adev->psp, &addr_in, &addr_out);
|
||||
if (ret) {
|
||||
dev_warn(adev->dev, "Failed to query RAS MCA address for 0x%llx",
|
||||
pa);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
*mca = addr_out.ma.err_addr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -189,4 +189,6 @@ int amdgpu_umc_mca_to_addr(struct amdgpu_device *adev,
|
|||
uint64_t err_addr, uint32_t ch, uint32_t umc,
|
||||
uint32_t node, uint32_t socket,
|
||||
struct ta_ras_query_address_output *addr_out, bool dump_addr);
|
||||
int amdgpu_umc_pa2mca(struct amdgpu_device *adev,
|
||||
uint64_t pa, uint64_t *mca, enum amdgpu_memory_partition nps);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user