amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu/psp: Return failure when firmware failed to load in SRIOV
@ 2022-05-04 14:40 Alice Wong
  0 siblings, 0 replies; only message in thread
From: Alice Wong @ 2022-05-04 14:40 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alice Wong

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>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 7 ++++---
 1 file 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 7f9ab12ae1ab..7859d70af596 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -626,10 +626,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;
 		}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-04 14:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-04 14:40 [PATCH] drm/amdgpu/psp: Return failure when firmware failed to load in SRIOV Alice Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).