Skip to contentSkip to conversation

drm/amdgpu/psp: ignore psp reponse status

PATCH Superseded Aaron Liu 5 participants 5 messages Jan 14, 2019 2 messages not in the archive

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Aaron Liu

author
#0 lore raw

PATCH 1/1 drm/amdgpu/psp: ignore psp reponse status

Don't return err if psp reponse status isn't zero

Change-Id I680679983f972b6969f4949f1faafaf17fe996a6
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +5 -4
index 53c2d60..48778b3 100644
@@ -140,14 +140,15 @@ psp_cmd_submit_buf(struct psp_context *psp,
 	while (*((unsigned int *)psp->fence_buf) != index)
 		msleep(1);
 
-	/* the status field must be 0 after psp command completion */
+	/* the status field should be 0 after psp command completion
+	 * if not, print WARN msg
+	 */
 	if (psp->cmd_buf_mem->resp.status) {
 		if (ucode)
-			DRM_ERROR("failed to load ucode id (%d) ",
+			DRM_WARN("failed to load ucode id (%d) ",
 				  ucode->ucode_id);
-		DRM_ERROR("psp command failed and response status is (%d)\n",
+		DRM_WARN("psp command failed and response status is (%d)\n",
 			  psp->cmd_buf_mem->resp.status);
-		return -EINVAL;
 	}
 
 	/* get xGMI session id from response buffer */
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1547453811-6718-1-git-send-email-aaron.liu-5C7GfCeVMHo@public.gmane.org

Reviewed-by Huang Rui
#2 lore raw

Is some cases, response status is not 0 even there is no problem while the command is submitted.
Some version of PSP FW doesn't write 0 to that field. So here we would like to only print a warning instead of an error during psp initialization to avoid breaking hw_init.

Quoted 43 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Aaron Liu
Sent: Monday, January 14, 2019 4:17 PM
To: [email protected]
Cc: Liu, Aaron <[email protected]>
Subject: [PATCH drm/amdgpu/psp: ignore psp reponse status] drm/amdgpu/psp: ignore psp reponse status

Don't return err if psp reponse status isn't zero

Change-Id I680679983f972b6969f4949f1faafaf17fe996a6
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +5 -4
index 53c2d60..48778b3 100644
@@ -140,14 +140,15 @@ psp_cmd_submit_buf(struct psp_context *psp,
 	while (*((unsigned int *)psp->fence_buf) != index)
 		msleep(1);
 
-	/* the status field must be 0 after psp command completion */
+	/* the status field should be 0 after psp command completion
+	 * if not, print WARN msg
+	 */
 	if (psp->cmd_buf_mem->resp.status) {
 		if (ucode)
-			DRM_ERROR("failed to load ucode id (%d) ",
+			DRM_WARN("failed to load ucode id (%d) ",
 				  ucode->ucode_id);
-		DRM_ERROR("psp command failed and response status is
 (%d)\n",
+		DRM_WARN("psp command failed and response status is
 (%d)\n",
 			  psp->cmd_buf_mem->resp.status);
-		return -EINVAL;
 	}
Quoted 8 lines

/* get xGMI session id from response buffer */
--
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BYAPR12MB3016AEA8454215EA9E14085CEC800-ZGDeBxoHBPkiNGs+b2+dlgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

Reviewed-by Feifei Xu Reviewed-by Huang Rui
#4 lore raw

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Huang, Ray
Sent: Monday, January 14, 2019 4:28 PM
To: Liu, Aaron <[email protected]>; [email protected]; Yu, Xiangliang <[email protected]>; Deucher, Alexander <[email protected]>; Zhang, Hawking <[email protected]>
Cc: Liu, Aaron <[email protected]>; Koenig, Christian <[email protected]>
Subject: RE: [PATCH drm/amdgpu/psp: ignore psp reponse status] drm/amdgpu/psp: ignore psp reponse status

Is some cases, response status is not 0 even there is no problem while the command is submitted.
Some version of PSP FW doesn't write 0 to that field. So here we would like to only print a warning instead of an error during psp initialization to avoid breaking hw_init.

Quoted 43 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Aaron Liu
Sent: Monday, January 14, 2019 4:17 PM
To: [email protected]
Cc: Liu, Aaron <[email protected]>
Subject: [PATCH drm/amdgpu/psp: ignore psp reponse status] drm/amdgpu/psp: ignore psp reponse status

Don't return err if psp reponse status isn't zero

Change-Id I680679983f972b6969f4949f1faafaf17fe996a6
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +5 -4
index 53c2d60..48778b3 100644
@@ -140,14 +140,15 @@ psp_cmd_submit_buf(struct psp_context *psp,
 	while (*((unsigned int *)psp->fence_buf) != index)
 		msleep(1);
 
-	/* the status field must be 0 after psp command completion */
+	/* the status field should be 0 after psp command completion
+	 * if not, print WARN msg
+	 */
 	if (psp->cmd_buf_mem->resp.status) {
 		if (ucode)
-			DRM_ERROR("failed to load ucode id (%d) ",
+			DRM_WARN("failed to load ucode id (%d) ",
 				  ucode->ucode_id);
-		DRM_ERROR("psp command failed and response status is
 (%d)\n",
+		DRM_WARN("psp command failed and response status is
 (%d)\n",
 			  psp->cmd_buf_mem->resp.status);
-		return -EINVAL;
 	}
Quoted 8 lines

/* get xGMI session id from response buffer */
--
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by Xiangliang Yu
#5 lore raw
In reply to a message not in the archive

Please add more comments to explain why don't return error. And add my RB with that fix.

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Aaron Liu
Sent: Monday, January 14, 2019 4:17 PM
To: [email protected]
Cc: Liu, Aaron <[email protected]>
Subject: [PATCH drm/amdgpu/psp: ignore psp reponse status] drm/amdgpu/psp: ignore psp reponse status

Don't return err if psp reponse status isn't zero

Change-Id I680679983f972b6969f4949f1faafaf17fe996a6
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +5 -4
index 53c2d60..48778b3 100644
@@ -140,14 +140,15 @@ psp_cmd_submit_buf(struct psp_context *psp,
 	while (*((unsigned int *)psp->fence_buf) != index)
 		msleep(1);
 
-	/* the status field must be 0 after psp command completion */
+	/* the status field should be 0 after psp command completion
+	 * if not, print WARN msg
+	 */
 	if (psp->cmd_buf_mem->resp.status) {
 		if (ucode)
-			DRM_ERROR("failed to load ucode id (%d) ",
+			DRM_WARN("failed to load ucode id (%d) ",
 				  ucode->ucode_id);
-		DRM_ERROR("psp command failed and response status is (%d)\n",
+		DRM_WARN("psp command failed and response status is (%d)\n",
 			  psp->cmd_buf_mem->resp.status);
-		return -EINVAL;
 	}
 
 	/* get xGMI session id from response buffer */
Signature · 10 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#6 lore raw
In reply to a message not in the archive

Am 14.01.19 um 09:16 schrieb Aaron Liu:

Quoted 4 lines

Don't return err if psp reponse status isn't zero

Change-Id I680679983f972b6969f4949f1faafaf17fe996a6

Thanks for taking care of that. Fix is Acked-by: Christian König <[email protected]>

Quoted 18 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 9 +++++----
  1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +3 -1
index 53c2d60..48778b3 100644
@@ -140,14 +140,15 @@ psp_cmd_submit_buf(struct psp_context *psp,
  	while (*((unsigned int *)psp->fence_buf) != index)
  		msleep(1);
 
-	/* the status field must be 0 after psp command completion */
+	/* the status field should be 0 after psp command completion
+	 * if not, print WARN msg
+	 */
  	if (psp->cmd_buf_mem->resp.status) {
  		if (ucode)

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c psp_cmd_submit_buf(struct psp_context *psp, · line 154

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +2 -3
-			DRM_ERROR("failed to load ucode id (%d) ",
+			DRM_WARN("failed to load ucode id (%d) ",
  				  ucode->ucode_id);
-		DRM_ERROR("psp command failed and response status is (%d)\n",
+		DRM_WARN("psp command failed and response status is (%d)\n",
  			  psp->cmd_buf_mem->resp.status);
-		return -EINVAL;
  	}
 
  	/* get xGMI session id from response buffer */

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx