Skip to contentSkip to conversation

drm/amdgpu/psp: ignore psp reponse status] drm/amdgpu/psp: ignore psp reponse status

PATCH In review Aaron Liu 2 participants 4 messages Jan 14, 2019 – Jan 15, 2019 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Aaron Liu

author
#0 lore raw

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

In some cases, psp 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 and it doesn't return -EINVAL.

Change-Id I680679983f972b6969f4949f1faafaf17fe996a6
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +9 -4
index 53c2d60..f26d8fa 100644
@@ -140,14 +140,19 @@ 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 */
+	/* In some cases, psp 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 and it doesn't
+	 * return -EINVAL.
+	 */
 	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): 1547455677-7074-1-git-send-email-aaron.liu-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Dear Aaron,

Am 14.01.19 um 09:47 schrieb Aaron Liu:

Quoted 33 lines

In some cases, psp 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 and it doesn't return -EINVAL.

Change-Id I680679983f972b6969f4949f1faafaf17fe996a6
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 13 +++++++++----
  1 file changed, 9 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +7 -1
index 53c2d60..f26d8fa 100644
@@ -140,14 +140,19 @@ 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 */
+	/* In some cases, psp 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 and it doesn't
+	 * return -EINVAL.
+	 */
  	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 158

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 */

Please describe, why this error can be ignored, and the rest of the function be executed. Won’t that introduce other problems?

How can real error situations be determined now?

Also, please extend the commit messages, that this only affects microcode update loading (if I understand this correctly).

Kind regards,

Paul
_______________________________________________
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): a4b67076-9903-30ed-9478-71cdbac54327-KUpvgZVWgV9o1qOY/[email protected]

author
#4 lore raw

Hi Paul,

The psp code only support ucode loading at the beginning, but forgot to remove the checking when more and more PSP command get into PSP.

So some old PSP FW maybe have problem but PSP driver didn’t find it out.
If reverting the patch, we also can’t find out wrong PSP FW and have big problem when support new PSP command.

The temporary solution is: do not return error if response is invalid but add warning message to notify, it will not block old FW and get attention if new PSP FW have some issue.

BR,
Aaron Liu

Quoted 65 lines

-----Original Message-----
From: Paul Menzel <[email protected]>
Sent: Monday, January 14, 2019 9:24 PM
To: Liu, Aaron <[email protected]>
Cc: [email protected]
Subject: Re: [[PATCH v2]drm/amdgpu/psp: ignore psp reponse status] drm/amdgpu/psp: ignore psp reponse status

Dear Aaron,

Am 14.01.19 um 09:47 schrieb Aaron Liu:

Quoted 21 lines

In some cases, psp 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 and it doesn't return -EINVAL.

Change-Id I680679983f972b6969f4949f1faafaf17fe996a6
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 13 +++++++++----
  1 file changed, 9 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +0 -0
index 53c2d60..f26d8fa 100644

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

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +2 -1
@@ -140,14 +140,19 @@ 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 */
+	/* In some cases, psp response status is not 0 even there is no
+	 * problem while the command is submitted. Some version of PSP

FW

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

Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +6 -2
+	 * 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 and it doesn't
+	 * return -EINVAL.
+	 */
  	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",

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

Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -0
+		DRM_WARN("psp command failed and response status is

(%d)\n",

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

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +0 -1
  			  psp->cmd_buf_mem->resp.status);
-		return -EINVAL;
  	}
 
  	/* get xGMI session id from response buffer */

Please describe, why this error can be ignored, and the rest of the function be executed. Won’t that introduce other problems?

How can real error situations be determined now?

Quoted 7 lines

Also, please extend the commit messages, that this only affects microcode update loading (if I understand this correctly).

Kind regards,

Paul

_______________________________________________
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): DM6PR12MB361131D6DD69B1A720F7A265F0810-lmeGfMZKVrGUZgGQSl7qawdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#6 lore raw

Dear Aaron,

Quoted 2 lines · Aaron

The psp code only support ucode loading at the beginning, but forgot to remove the checking when more and more PSP command get into PSP.

I didn’t know that, and missed that your patch is not only about microcode loading.

Quoted 3 lines

So some old PSP FW maybe have problem but PSP driver didn’t find it out. If reverting the patch, we also can’t find out wrong PSP FW and have big problem when support new PSP command.

Understood.

Quoted 3 lines

The temporary solution is: do not return error if response is invalid but add warning message to notify, it will not block old FW and get attention if new PSP FW have some issue.

There is still a small typo in *response* in the summary.

Kind regards,

Paul

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