All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] drm/amdgpu/psp: Fix can't detect psp INVOKE command failed
@ 2018-12-13  7:41 Xiangliang Yu
       [not found] ` <1544686892-32619-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Xiangliang Yu @ 2018-12-13  7:41 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Xiangliang Yu

There isn't ucode when executing INVOKE command, so current code can't
check the failure of INVOKE command.

Remove the ucode check.

Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index 2f126ea7..7f5ce37 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -140,10 +140,13 @@ psp_cmd_submit_buf(struct psp_context *psp,
 	while (*((unsigned int *)psp->fence_buf) != index)
 		msleep(1);
 
-	/* the status field must be 0 after FW is loaded */
-	if (ucode && psp->cmd_buf_mem->resp.status) {
-		DRM_ERROR("failed loading with status (%d) and ucode id (%d)\n",
-			  psp->cmd_buf_mem->resp.status, ucode->ucode_id);
+	/* the status field must be 0 after psp command completion */
+	if (psp->cmd_buf_mem->resp.status) {
+		if (ucode)
+			DRM_ERROR("failed to load ucode id (%d) ",
+				  ucode->ucode_id);
+		DRM_ERROR("psp command failed and response status is (%d)\n",
+			  psp->cmd_buf_mem->resp.status);
 		return -EINVAL;
 	}
 
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* RE: [PATCH 2/2] drm/amdgpu/psp: Fix can't detect psp INVOKE command failed
       [not found] ` <1544686892-32619-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
@ 2018-12-18  2:42   ` Yu, Xiangliang
  2018-12-18  2:45   ` Xu, Feifei
  1 sibling, 0 replies; 7+ messages in thread
From: Yu, Xiangliang @ 2018-12-18  2:42 UTC (permalink / raw)
  To: Yu, Xiangliang, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Deucher, Alexander

Anyone to help reviewing?

Thanks!
-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Xiangliang Yu
Sent: Thursday, December 13, 2018 3:42 PM
To: amd-gfx@lists.freedesktop.org
Cc: Yu, Xiangliang <Xiangliang.Yu@amd.com>
Subject: [PATCH 2/2] drm/amdgpu/psp: Fix can't detect psp INVOKE command failed

There isn't ucode when executing INVOKE command, so current code can't check the failure of INVOKE command.

Remove the ucode check.

Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index 2f126ea7..7f5ce37 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -140,10 +140,13 @@ psp_cmd_submit_buf(struct psp_context *psp,
 	while (*((unsigned int *)psp->fence_buf) != index)
 		msleep(1);
 
-	/* the status field must be 0 after FW is loaded */
-	if (ucode && psp->cmd_buf_mem->resp.status) {
-		DRM_ERROR("failed loading with status (%d) and ucode id (%d)\n",
-			  psp->cmd_buf_mem->resp.status, ucode->ucode_id);
+	/* the status field must be 0 after psp command completion */
+	if (psp->cmd_buf_mem->resp.status) {
+		if (ucode)
+			DRM_ERROR("failed to load ucode id (%d) ",
+				  ucode->ucode_id);
+		DRM_ERROR("psp command failed and response status is (%d)\n",
+			  psp->cmd_buf_mem->resp.status);
 		return -EINVAL;
 	}
 
--
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* RE: [PATCH 2/2] drm/amdgpu/psp: Fix can't detect psp INVOKE command failed
       [not found] ` <1544686892-32619-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
  2018-12-18  2:42   ` Yu, Xiangliang
@ 2018-12-18  2:45   ` Xu, Feifei
       [not found]     ` <BYAPR12MB3048316A14F811CAE4675B30FEBD0-ZGDeBxoHBPnONjofGsFOUAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  1 sibling, 1 reply; 7+ messages in thread
From: Xu, Feifei @ 2018-12-18  2:45 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Yu, Xiangliang

Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Xiangliang Yu
Sent: Thursday, December 13, 2018 3:42 PM
To: amd-gfx@lists.freedesktop.org
Cc: Yu, Xiangliang <Xiangliang.Yu@amd.com>
Subject: [PATCH 2/2] drm/amdgpu/psp: Fix can't detect psp INVOKE command failed

There isn't ucode when executing INVOKE command, so current code can't check the failure of INVOKE command.

Remove the ucode check.

Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index 2f126ea7..7f5ce37 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -140,10 +140,13 @@ psp_cmd_submit_buf(struct psp_context *psp,
 	while (*((unsigned int *)psp->fence_buf) != index)
 		msleep(1);
 
-	/* the status field must be 0 after FW is loaded */
-	if (ucode && psp->cmd_buf_mem->resp.status) {
-		DRM_ERROR("failed loading with status (%d) and ucode id (%d)\n",
-			  psp->cmd_buf_mem->resp.status, ucode->ucode_id);
+	/* the status field must be 0 after psp command completion */
+	if (psp->cmd_buf_mem->resp.status) {
+		if (ucode)
+			DRM_ERROR("failed to load ucode id (%d) ",
+				  ucode->ucode_id);
+		DRM_ERROR("psp command failed and response status is (%d)\n",
+			  psp->cmd_buf_mem->resp.status);
 		return -EINVAL;
 	}
 
--
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu/psp: Fix can't detect psp INVOKE command failed
       [not found]     ` <BYAPR12MB3048316A14F811CAE4675B30FEBD0-ZGDeBxoHBPnONjofGsFOUAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2019-01-03 15:00       ` Christian König
       [not found]         ` <71d6a5f3-51dd-9e02-a99f-a4acb3c2ce35-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Christian König @ 2019-01-03 15:00 UTC (permalink / raw)
  To: Xu, Feifei, Yu, Xiangliang,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Alex Deucher

Hi guys,

this patch broke loading older versions of PSP firmware on Vega10.

What exactly is the background here? E.g. why do we need it? And can we 
revert it ASAP?

Thanks,
Christian.

Am 18.12.18 um 03:45 schrieb Xu, Feifei:
> Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
>
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Xiangliang Yu
> Sent: Thursday, December 13, 2018 3:42 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Yu, Xiangliang <Xiangliang.Yu@amd.com>
> Subject: [PATCH 2/2] drm/amdgpu/psp: Fix can't detect psp INVOKE command failed
>
> There isn't ucode when executing INVOKE command, so current code can't check the failure of INVOKE command.
>
> Remove the ucode check.
>
> Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 11 +++++++----
>   1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index 2f126ea7..7f5ce37 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -140,10 +140,13 @@ psp_cmd_submit_buf(struct psp_context *psp,
>   	while (*((unsigned int *)psp->fence_buf) != index)
>   		msleep(1);
>   
> -	/* the status field must be 0 after FW is loaded */
> -	if (ucode && psp->cmd_buf_mem->resp.status) {
> -		DRM_ERROR("failed loading with status (%d) and ucode id (%d)\n",
> -			  psp->cmd_buf_mem->resp.status, ucode->ucode_id);
> +	/* the status field must be 0 after psp command completion */
> +	if (psp->cmd_buf_mem->resp.status) {
> +		if (ucode)
> +			DRM_ERROR("failed to load ucode id (%d) ",
> +				  ucode->ucode_id);
> +		DRM_ERROR("psp command failed and response status is (%d)\n",
> +			  psp->cmd_buf_mem->resp.status);
>   		return -EINVAL;
>   	}
>   
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH 2/2] drm/amdgpu/psp: Fix can't detect psp INVOKE command failed
       [not found]         ` <71d6a5f3-51dd-9e02-a99f-a4acb3c2ce35-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2019-01-03 15:21           ` Yu, Xiangliang
       [not found]             ` <MN2PR12MB30388EC1BF1282140F3AC7BAEB8D0-rweVpJHSKTpEBhlW4KzBdQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Yu, Xiangliang @ 2019-01-03 15:21 UTC (permalink / raw)
  To: Koenig, Christian, Xu, Feifei,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Deucher, Alexander

XGMI command will not load ucode, so it can't find the command failed if check ucode at first.
For code logic, should check response status to see if command complete successfully at first.
For Vega10, could you explain why it block older version fw?


-----Original Message-----
From: Christian König <ckoenig.leichtzumerken@gmail.com> 
Sent: Thursday, January 03, 2019 11:00 PM
To: Xu, Feifei <Feifei.Xu@amd.com>; Yu, Xiangliang <Xiangliang.Yu@amd.com>; amd-gfx@lists.freedesktop.org; Deucher, Alexander <Alexander.Deucher@amd.com>
Subject: Re: [PATCH 2/2] drm/amdgpu/psp: Fix can't detect psp INVOKE command failed

Hi guys,

this patch broke loading older versions of PSP firmware on Vega10.

What exactly is the background here? E.g. why do we need it? And can we revert it ASAP?

Thanks,
Christian.

Am 18.12.18 um 03:45 schrieb Xu, Feifei:
> Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
>
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of 
> Xiangliang Yu
> Sent: Thursday, December 13, 2018 3:42 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Yu, Xiangliang <Xiangliang.Yu@amd.com>
> Subject: [PATCH 2/2] drm/amdgpu/psp: Fix can't detect psp INVOKE 
> command failed
>
> There isn't ucode when executing INVOKE command, so current code can't check the failure of INVOKE command.
>
> Remove the ucode check.
>
> Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 11 +++++++----
>   1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index 2f126ea7..7f5ce37 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -140,10 +140,13 @@ psp_cmd_submit_buf(struct psp_context *psp,
>   	while (*((unsigned int *)psp->fence_buf) != index)
>   		msleep(1);
>   
> -	/* the status field must be 0 after FW is loaded */
> -	if (ucode && psp->cmd_buf_mem->resp.status) {
> -		DRM_ERROR("failed loading with status (%d) and ucode id (%d)\n",
> -			  psp->cmd_buf_mem->resp.status, ucode->ucode_id);
> +	/* the status field must be 0 after psp command completion */
> +	if (psp->cmd_buf_mem->resp.status) {
> +		if (ucode)
> +			DRM_ERROR("failed to load ucode id (%d) ",
> +				  ucode->ucode_id);
> +		DRM_ERROR("psp command failed and response status is (%d)\n",
> +			  psp->cmd_buf_mem->resp.status);
>   		return -EINVAL;
>   	}
>   
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu/psp: Fix can't detect psp INVOKE command failed
       [not found]             ` <MN2PR12MB30388EC1BF1282140F3AC7BAEB8D0-rweVpJHSKTpEBhlW4KzBdQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2019-01-03 15:57               ` Koenig, Christian
       [not found]                 ` <28b7eafd-3473-1480-e1b4-cfbd995f5fe3-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Koenig, Christian @ 2019-01-03 15:57 UTC (permalink / raw)
  To: Yu, Xiangliang, Xu, Feifei,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Deucher, Alexander

> For Vega10, could you explain why it block older version fw?
I'm not very familiar with the PSP, so I don't know what exactly is 
going wrong here.

Symptoms are that we get the following in dmesg:
> Jan 03 15:55:17 abel kernel: [drm] PSP loading VCE firmware
> Jan 03 15:55:17 abel kernel: [drm] reserve 0x400000 from 0xf400c00000 
> for PSP TMR SIZE
> Jan 03 15:55:17 abel kernel: [drm:psp_cmd_submit_buf [amdgpu]] *ERROR* 
> psp command failed and response status is (1)
> Jan 03 15:55:17 abel kernel: [drm:psp_hw_init [amdgpu]] *ERROR* PSP 
> firmware loading failed
> Jan 03 15:55:17 abel kernel: [drm:amdgpu_device_fw_loading [amdgpu]] 
> *ERROR* hw_init of IP block <psp> failed -22
> Jan 03 15:55:17 abel kernel: amdgpu 0000:43:00.0: 
> amdgpu_device_ip_init failed
> Jan 03 15:55:17 abel kernel: amdgpu 0000:43:00.0: Fatal error during 
> GPU init

I think the code was purposely ignoring some return status because the 
command wasn't available on older fw generations.

Now that we bail out on every non zero return code that fails when you 
try to use the older PSP firmware on Vega10.

Anyway breaking older fw versions is not something we can do, so we need 
to either fix or revert that ASAP or end users will start to complain.

Any idea how to investigate further?

Christian.

Am 03.01.19 um 16:21 schrieb Yu, Xiangliang:
> XGMI command will not load ucode, so it can't find the command failed if check ucode at first.
> For code logic, should check response status to see if command complete successfully at first.
> For Vega10, could you explain why it block older version fw?
>
>
> -----Original Message-----
> From: Christian König <ckoenig.leichtzumerken@gmail.com>
> Sent: Thursday, January 03, 2019 11:00 PM
> To: Xu, Feifei <Feifei.Xu@amd.com>; Yu, Xiangliang <Xiangliang.Yu@amd.com>; amd-gfx@lists.freedesktop.org; Deucher, Alexander <Alexander.Deucher@amd.com>
> Subject: Re: [PATCH 2/2] drm/amdgpu/psp: Fix can't detect psp INVOKE command failed
>
> Hi guys,
>
> this patch broke loading older versions of PSP firmware on Vega10.
>
> What exactly is the background here? E.g. why do we need it? And can we revert it ASAP?
>
> Thanks,
> Christian.
>
> Am 18.12.18 um 03:45 schrieb Xu, Feifei:
>> Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
>>
>> -----Original Message-----
>> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of
>> Xiangliang Yu
>> Sent: Thursday, December 13, 2018 3:42 PM
>> To: amd-gfx@lists.freedesktop.org
>> Cc: Yu, Xiangliang <Xiangliang.Yu@amd.com>
>> Subject: [PATCH 2/2] drm/amdgpu/psp: Fix can't detect psp INVOKE
>> command failed
>>
>> There isn't ucode when executing INVOKE command, so current code can't check the failure of INVOKE command.
>>
>> Remove the ucode check.
>>
>> Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
>> ---
>>    drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 11 +++++++----
>>    1 file changed, 7 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
>> index 2f126ea7..7f5ce37 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
>> @@ -140,10 +140,13 @@ psp_cmd_submit_buf(struct psp_context *psp,
>>    	while (*((unsigned int *)psp->fence_buf) != index)
>>    		msleep(1);
>>    
>> -	/* the status field must be 0 after FW is loaded */
>> -	if (ucode && psp->cmd_buf_mem->resp.status) {
>> -		DRM_ERROR("failed loading with status (%d) and ucode id (%d)\n",
>> -			  psp->cmd_buf_mem->resp.status, ucode->ucode_id);
>> +	/* the status field must be 0 after psp command completion */
>> +	if (psp->cmd_buf_mem->resp.status) {
>> +		if (ucode)
>> +			DRM_ERROR("failed to load ucode id (%d) ",
>> +				  ucode->ucode_id);
>> +		DRM_ERROR("psp command failed and response status is (%d)\n",
>> +			  psp->cmd_buf_mem->resp.status);
>>    		return -EINVAL;
>>    	}
>>    
>> --
>> 2.7.4
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu/psp: Fix can't detect psp INVOKE command failed
       [not found]                 ` <28b7eafd-3473-1480-e1b4-cfbd995f5fe3-5C7GfCeVMHo@public.gmane.org>
@ 2019-01-03 16:01                   ` Deucher, Alexander
  0 siblings, 0 replies; 7+ messages in thread
From: Deucher, Alexander @ 2019-01-03 16:01 UTC (permalink / raw)
  To: Koenig, Christian, Yu, Xiangliang, Xu, Feifei,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 5165 bytes --]

This bug may also be related:

https://bugs.freedesktop.org/show_bug.cgi?id=109206


Alex

________________________________
From: Koenig, Christian
Sent: Thursday, January 3, 2019 10:57:50 AM
To: Yu, Xiangliang; Xu, Feifei; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org; Deucher, Alexander
Subject: Re: [PATCH 2/2] drm/amdgpu/psp: Fix can't detect psp INVOKE command failed

> For Vega10, could you explain why it block older version fw?
I'm not very familiar with the PSP, so I don't know what exactly is
going wrong here.

Symptoms are that we get the following in dmesg:
> Jan 03 15:55:17 abel kernel: [drm] PSP loading VCE firmware
> Jan 03 15:55:17 abel kernel: [drm] reserve 0x400000 from 0xf400c00000
> for PSP TMR SIZE
> Jan 03 15:55:17 abel kernel: [drm:psp_cmd_submit_buf [amdgpu]] *ERROR*
> psp command failed and response status is (1)
> Jan 03 15:55:17 abel kernel: [drm:psp_hw_init [amdgpu]] *ERROR* PSP
> firmware loading failed
> Jan 03 15:55:17 abel kernel: [drm:amdgpu_device_fw_loading [amdgpu]]
> *ERROR* hw_init of IP block <psp> failed -22
> Jan 03 15:55:17 abel kernel: amdgpu 0000:43:00.0:
> amdgpu_device_ip_init failed
> Jan 03 15:55:17 abel kernel: amdgpu 0000:43:00.0: Fatal error during
> GPU init

I think the code was purposely ignoring some return status because the
command wasn't available on older fw generations.

Now that we bail out on every non zero return code that fails when you
try to use the older PSP firmware on Vega10.

Anyway breaking older fw versions is not something we can do, so we need
to either fix or revert that ASAP or end users will start to complain.

Any idea how to investigate further?

Christian.

Am 03.01.19 um 16:21 schrieb Yu, Xiangliang:
> XGMI command will not load ucode, so it can't find the command failed if check ucode at first.
> For code logic, should check response status to see if command complete successfully at first.
> For Vega10, could you explain why it block older version fw?
>
>
> -----Original Message-----
> From: Christian König <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Sent: Thursday, January 03, 2019 11:00 PM
> To: Xu, Feifei <Feifei.Xu-5C7GfCeVMHo@public.gmane.org>; Yu, Xiangliang <Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org; Deucher, Alexander <Alexander.Deucher@amd.com>
> Subject: Re: [PATCH 2/2] drm/amdgpu/psp: Fix can't detect psp INVOKE command failed
>
> Hi guys,
>
> this patch broke loading older versions of PSP firmware on Vega10.
>
> What exactly is the background here? E.g. why do we need it? And can we revert it ASAP?
>
> Thanks,
> Christian.
>
> Am 18.12.18 um 03:45 schrieb Xu, Feifei:
>> Reviewed-by: Feifei Xu <Feifei.Xu-5C7GfCeVMHo@public.gmane.org>
>>
>> -----Original Message-----
>> From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> On Behalf Of
>> Xiangliang Yu
>> Sent: Thursday, December 13, 2018 3:42 PM
>> To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
>> Cc: Yu, Xiangliang <Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
>> Subject: [PATCH 2/2] drm/amdgpu/psp: Fix can't detect psp INVOKE
>> command failed
>>
>> There isn't ucode when executing INVOKE command, so current code can't check the failure of INVOKE command.
>>
>> Remove the ucode check.
>>
>> Signed-off-by: Xiangliang Yu <Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
>> ---
>>    drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 11 +++++++----
>>    1 file changed, 7 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
>> index 2f126ea7..7f5ce37 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
>> @@ -140,10 +140,13 @@ psp_cmd_submit_buf(struct psp_context *psp,
>>       while (*((unsigned int *)psp->fence_buf) != index)
>>               msleep(1);
>>
>> -    /* the status field must be 0 after FW is loaded */
>> -    if (ucode && psp->cmd_buf_mem->resp.status) {
>> -            DRM_ERROR("failed loading with status (%d) and ucode id (%d)\n",
>> -                      psp->cmd_buf_mem->resp.status, ucode->ucode_id);
>> +    /* the status field must be 0 after psp command completion */
>> +    if (psp->cmd_buf_mem->resp.status) {
>> +            if (ucode)
>> +                    DRM_ERROR("failed to load ucode id (%d) ",
>> +                              ucode->ucode_id);
>> +            DRM_ERROR("psp command failed and response status is (%d)\n",
>> +                      psp->cmd_buf_mem->resp.status);
>>               return -EINVAL;
>>       }
>>
>> --
>> 2.7.4
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[-- Attachment #1.2: Type: text/html, Size: 8341 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-01-03 16:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-13  7:41 [PATCH 2/2] drm/amdgpu/psp: Fix can't detect psp INVOKE command failed Xiangliang Yu
     [not found] ` <1544686892-32619-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
2018-12-18  2:42   ` Yu, Xiangliang
2018-12-18  2:45   ` Xu, Feifei
     [not found]     ` <BYAPR12MB3048316A14F811CAE4675B30FEBD0-ZGDeBxoHBPnONjofGsFOUAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-01-03 15:00       ` Christian König
     [not found]         ` <71d6a5f3-51dd-9e02-a99f-a4acb3c2ce35-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-01-03 15:21           ` Yu, Xiangliang
     [not found]             ` <MN2PR12MB30388EC1BF1282140F3AC7BAEB8D0-rweVpJHSKTpEBhlW4KzBdQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-01-03 15:57               ` Koenig, Christian
     [not found]                 ` <28b7eafd-3473-1480-e1b4-cfbd995f5fe3-5C7GfCeVMHo@public.gmane.org>
2019-01-03 16:01                   ` Deucher, Alexander

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.