aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
diff options
context:
space:
mode:
authorAlice Wong <shiwei.wong@amd.com>2022-05-10 17:44:02 -0400
committerAlex Deucher <alexander.deucher@amd.com>2022-05-10 17:53:11 -0400
commit4bef1abe74ceab5bc647e6a04453d3772af802dd (patch)
tree4bf096c8ab84f51ee0e512f9b6f6552e27078129 /drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
parentdrm/amdgpu: Implement get_vmid_pasid_mapping for gfx11 (diff)
downloadlinux-dev-4bef1abe74ceab5bc647e6a04453d3772af802dd.tar.xz
linux-dev-4bef1abe74ceab5bc647e6a04453d3772af802dd.zip
drm/amdgpu/psp: Return failure when firmware failed to load in SRIOV
In SRIOV, PSP will block incompatible firmware from loading. When this happens, driver should be prevented from continue initialization and start cleanup. Return failure in psp_cmd_submit_buf when firmware load failed in SRIOV. Signed-off-by: Alice Wong <shiwei.wong@amd.com> Reviewed-by: Sashank Saye <sashank.saye@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index d01050808626..214e4e89a028 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -630,10 +630,11 @@ psp_cmd_submit_buf(struct psp_context *psp,
DRM_WARN("psp gfx command %s(0x%X) failed and response status is (0x%X)\n",
psp_gfx_cmd_name(psp->cmd_buf_mem->cmd_id), psp->cmd_buf_mem->cmd_id,
psp->cmd_buf_mem->resp.status);
- /* If we load CAP FW, PSP must return 0 under SRIOV
- * also return failure in case of timeout
+ /* If any firmware (including CAP) load fails under SRIOV, it should
+ * return failure to stop the VF from initializing.
+ * Also return failure in case of timeout
*/
- if ((ucode && (ucode->ucode_id == AMDGPU_UCODE_ID_CAP)) || !timeout) {
+ if ((ucode && amdgpu_sriov_vf(psp->adev)) || !timeout) {
ret = -EINVAL;
goto exit;
}