Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: Optimize RAS TA initialization and TA unload funcs

1. Save TA unload psp response status
2. Add RAS TA loading status check for initializaiton
3. Drop RAS context teardown to allow RAS TA to be reloaded

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Candice Li <candice.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Candice Li and committed by
Alex Deucher
bf7d7772 9682069a

+8 -2
+8 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
··· 988 988 989 989 ret = psp_cmd_submit_buf(psp, NULL, cmd, psp->fence_buf_mc_addr); 990 990 991 + context->resp_status = cmd->resp.status; 992 + 991 993 release_psp_cmd_buf(psp); 992 994 993 995 return ret; ··· 1562 1560 if (amdgpu_sriov_vf(adev)) 1563 1561 return 0; 1564 1562 1563 + if (psp->ras_context.context.initialized) { 1564 + dev_warn(adev->dev, "RAS WARN: TA has already been loaded\n"); 1565 + return 0; 1566 + } 1567 + 1565 1568 if (!adev->psp.ras_context.context.bin_desc.size_bytes || 1566 1569 !adev->psp.ras_context.context.bin_desc.start_addr) { 1567 1570 dev_info(adev->dev, "RAS: optional ras ta ucode is not available\n"); ··· 1617 1610 psp->ras_context.context.mem_context.shared_mem_size = PSP_RAS_SHARED_MEM_SIZE; 1618 1611 psp->ras_context.context.ta_load_type = GFX_CMD_ID_LOAD_TA; 1619 1612 1620 - if (!psp->ras_context.context.initialized) { 1613 + if (!psp->ras_context.context.mem_context.shared_buf) { 1621 1614 ret = psp_ta_init_shared_buf(psp, &psp->ras_context.context.mem_context); 1622 1615 if (ret) 1623 1616 return ret; ··· 1638 1631 else { 1639 1632 if (ras_cmd->ras_status) 1640 1633 dev_warn(psp->adev->dev, "RAS Init Status: 0x%X\n", ras_cmd->ras_status); 1641 - amdgpu_ras_fini(psp->adev); 1642 1634 } 1643 1635 1644 1636 return ret;