All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/amdgpu: error out on mode1 reset failure
@ 2019-03-15  6:01 Evan Quan
       [not found] ` <20190315060139.1770-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Evan Quan @ 2019-03-15  6:01 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Evan Quan

The error return value should be correctly reflected.

Change-Id: I93bf6fa77193d4e3f102a4e223aa8cb18cb525cc
Signed-off-by: Evan Quan <evan.quan@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/soc15.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index 0c5ce4bd6feb..9d33a5d73072 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -393,6 +393,7 @@ void soc15_program_register_sequence(struct amdgpu_device *adev,
 static int soc15_asic_mode1_reset(struct amdgpu_device *adev)
 {
 	u32 i;
+	int ret = 0;
 
 	amdgpu_atombios_scratch_regs_engine_hung(adev, true);
 
@@ -403,7 +404,9 @@ static int soc15_asic_mode1_reset(struct amdgpu_device *adev)
 
 	pci_save_state(adev->pdev);
 
-	psp_gpu_reset(adev);
+	ret = psp_gpu_reset(adev);
+	if (ret)
+		dev_err(adev->dev, "GPU mode1 reset failed\n");
 
 	pci_restore_state(adev->pdev);
 
@@ -418,7 +421,7 @@ static int soc15_asic_mode1_reset(struct amdgpu_device *adev)
 
 	amdgpu_atombios_scratch_regs_engine_hung(adev, false);
 
-	return 0;
+	return ret;
 }
 
 static int soc15_asic_get_baco_capability(struct amdgpu_device *adev, bool *cap)
-- 
2.21.0

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

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

* [PATCH 2/3] drm/amdgpu: trivial typo fix
       [not found] ` <20190315060139.1770-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
@ 2019-03-15  6:01   ` Evan Quan
       [not found]     ` <20190315060139.1770-2-evan.quan-5C7GfCeVMHo@public.gmane.org>
  2019-03-15  6:01   ` [PATCH 3/3] drm/amdgpu: add more debug friendly prompts Evan Quan
  2019-03-22  8:31   ` [PATCH 1/3] drm/amdgpu: error out on mode1 reset failure Quan, Evan
  2 siblings, 1 reply; 8+ messages in thread
From: Evan Quan @ 2019-03-15  6:01 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Evan Quan

"error" was not correctly spelled.

Change-Id: Idc3acb6172469c1d63227cb5f0df75f912c10871
Signed-off-by: Evan Quan <evan.quan@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 07c6b23b3e2b..0243f1bdfeb6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2396,7 +2396,7 @@ static void amdgpu_device_xgmi_reset_func(struct work_struct *__work)
 
 	adev->asic_reset_res =  amdgpu_asic_reset(adev);
 	if (adev->asic_reset_res)
-		DRM_WARN("ASIC reset failed with err r, %d for drm dev, %s",
+		DRM_WARN("ASIC reset failed with error, %d for drm dev, %s",
 			 adev->asic_reset_res, adev->ddev->unique);
 }
 
@@ -3396,7 +3396,7 @@ static int amdgpu_do_asic_reset(struct amdgpu_hive_info *hive,
 				r = amdgpu_asic_reset(tmp_adev);
 
 			if (r) {
-				DRM_ERROR("ASIC reset failed with err r, %d for drm dev, %s",
+				DRM_ERROR("ASIC reset failed with error, %d for drm dev, %s",
 					 r, tmp_adev->ddev->unique);
 				break;
 			}
-- 
2.21.0

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

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

* [PATCH 3/3] drm/amdgpu: add more debug friendly prompts
       [not found] ` <20190315060139.1770-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
  2019-03-15  6:01   ` [PATCH 2/3] drm/amdgpu: trivial typo fix Evan Quan
@ 2019-03-15  6:01   ` Evan Quan
       [not found]     ` <20190315060139.1770-3-evan.quan-5C7GfCeVMHo@public.gmane.org>
  2019-03-22  8:31   ` [PATCH 1/3] drm/amdgpu: error out on mode1 reset failure Quan, Evan
  2 siblings, 1 reply; 8+ messages in thread
From: Evan Quan @ 2019-03-15  6:01 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Evan Quan

Large piece of codes share one error prompt. That
is not friendly for debugging.

Change-Id: I15f77210af6a409981fe44cf5dd3aa8ce48d948f
Signed-off-by: Evan Quan <evan.quan@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 38 ++++++++++++++++++-------
 1 file changed, 28 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index 32388b5218e9..5888e24219d9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -136,7 +136,7 @@ psp_cmd_submit_buf(struct psp_context *psp,
 
 	while (*((unsigned int *)psp->fence_buf) != index) {
 		if (--timeout == 0)
-			return -EINVAL;
+			break;
 		msleep(1);
 	}
 
@@ -147,12 +147,14 @@ psp_cmd_submit_buf(struct psp_context *psp,
 	 * during psp initialization to avoid breaking hw_init and it doesn't
 	 * return -EINVAL.
 	 */
-	if (psp->cmd_buf_mem->resp.status) {
+	if (psp->cmd_buf_mem->resp.status || !timeout) {
 		if (ucode)
 			DRM_WARN("failed to load ucode id (%d) ",
 				  ucode->ucode_id);
 		DRM_WARN("psp command failed and response status is (%d)\n",
 			  psp->cmd_buf_mem->resp.status);
+		if (!timeout)
+			return -EINVAL;
 	}
 
 	/* get xGMI session id from response buffer */
@@ -677,25 +679,35 @@ static int psp_hw_start(struct psp_context *psp)
 
 	if (!amdgpu_sriov_vf(adev) || !adev->in_gpu_reset) {
 		ret = psp_bootloader_load_sysdrv(psp);
-		if (ret)
+		if (ret) {
+			DRM_ERROR("PSP load sysdrv failed!\n");
 			return ret;
+		}
 
 		ret = psp_bootloader_load_sos(psp);
-		if (ret)
+		if (ret) {
+			DRM_ERROR("PSP load sos failed!\n");
 			return ret;
+		}
 	}
 
 	ret = psp_ring_create(psp, PSP_RING_TYPE__KM);
-	if (ret)
+	if (ret) {
+		DRM_ERROR("PSP create ring failed!\n");
 		return ret;
+	}
 
 	ret = psp_tmr_load(psp);
-	if (ret)
+	if (ret) {
+		DRM_ERROR("PSP load tmr failed!\n");
 		return ret;
+	}
 
 	ret = psp_asd_load(psp);
-	if (ret)
+	if (ret) {
+		DRM_ERROR("PSP load asd failed!\n");
 		return ret;
+	}
 
 	if (adev->gmc.xgmi.num_physical_nodes > 1) {
 		ret = psp_xgmi_initialize(psp);
@@ -890,16 +902,22 @@ static int psp_load_fw(struct amdgpu_device *adev)
 	memset(psp->fence_buf, 0, PSP_FENCE_BUFFER_SIZE);
 
 	ret = psp_ring_init(psp, PSP_RING_TYPE__KM);
-	if (ret)
+	if (ret) {
+		DRM_ERROR("PSP ring init failed!\n");
 		goto failed_mem;
+	}
 
 	ret = psp_tmr_init(psp);
-	if (ret)
+	if (ret) {
+		DRM_ERROR("PSP tmr init failed!\n");
 		goto failed_mem;
+	}
 
 	ret = psp_asd_init(psp);
-	if (ret)
+	if (ret) {
+		DRM_ERROR("PSP asd init failed!\n");
 		goto failed_mem;
+	}
 
 skip_memalloc:
 	ret = psp_hw_start(psp);
-- 
2.21.0

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

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

* Re: [PATCH 2/3] drm/amdgpu: trivial typo fix
       [not found]     ` <20190315060139.1770-2-evan.quan-5C7GfCeVMHo@public.gmane.org>
@ 2019-03-15  8:35       ` Christian König
  0 siblings, 0 replies; 8+ messages in thread
From: Christian König @ 2019-03-15  8:35 UTC (permalink / raw)
  To: Evan Quan, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Am 15.03.19 um 07:01 schrieb Evan Quan:
> "error" was not correctly spelled.
>
> Change-Id: Idc3acb6172469c1d63227cb5f0df75f912c10871
> Signed-off-by: Evan Quan <evan.quan@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com> for this one.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 07c6b23b3e2b..0243f1bdfeb6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -2396,7 +2396,7 @@ static void amdgpu_device_xgmi_reset_func(struct work_struct *__work)
>   
>   	adev->asic_reset_res =  amdgpu_asic_reset(adev);
>   	if (adev->asic_reset_res)
> -		DRM_WARN("ASIC reset failed with err r, %d for drm dev, %s",
> +		DRM_WARN("ASIC reset failed with error, %d for drm dev, %s",
>   			 adev->asic_reset_res, adev->ddev->unique);
>   }
>   
> @@ -3396,7 +3396,7 @@ static int amdgpu_do_asic_reset(struct amdgpu_hive_info *hive,
>   				r = amdgpu_asic_reset(tmp_adev);
>   
>   			if (r) {
> -				DRM_ERROR("ASIC reset failed with err r, %d for drm dev, %s",
> +				DRM_ERROR("ASIC reset failed with error, %d for drm dev, %s",
>   					 r, tmp_adev->ddev->unique);
>   				break;
>   			}

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

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

* RE: [PATCH 3/3] drm/amdgpu: add more debug friendly prompts
       [not found]     ` <20190315060139.1770-3-evan.quan-5C7GfCeVMHo@public.gmane.org>
@ 2019-03-22  8:31       ` Quan, Evan
       [not found]         ` <MN2PR12MB3344D46779A9EE3EA9BE03F6E4430-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Quan, Evan @ 2019-03-22  8:31 UTC (permalink / raw)
  To: Quan, Evan, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Ping..

> -----Original Message-----
> From: Evan Quan <evan.quan@amd.com>
> Sent: 2019年3月15日 14:02
> To: amd-gfx@lists.freedesktop.org
> Cc: Quan, Evan <Evan.Quan@amd.com>
> Subject: [PATCH 3/3] drm/amdgpu: add more debug friendly prompts
> 
> Large piece of codes share one error prompt. That is not friendly for
> debugging.
> 
> Change-Id: I15f77210af6a409981fe44cf5dd3aa8ce48d948f
> Signed-off-by: Evan Quan <evan.quan@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 38 ++++++++++++++++++-
> ------
>  1 file changed, 28 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index 32388b5218e9..5888e24219d9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -136,7 +136,7 @@ psp_cmd_submit_buf(struct psp_context *psp,
> 
>  	while (*((unsigned int *)psp->fence_buf) != index) {
>  		if (--timeout == 0)
> -			return -EINVAL;
> +			break;
>  		msleep(1);
>  	}
> 
> @@ -147,12 +147,14 @@ psp_cmd_submit_buf(struct psp_context *psp,
>  	 * during psp initialization to avoid breaking hw_init and it doesn't
>  	 * return -EINVAL.
>  	 */
> -	if (psp->cmd_buf_mem->resp.status) {
> +	if (psp->cmd_buf_mem->resp.status || !timeout) {
>  		if (ucode)
>  			DRM_WARN("failed to load ucode id (%d) ",
>  				  ucode->ucode_id);
>  		DRM_WARN("psp command failed and response status is
> (%d)\n",
>  			  psp->cmd_buf_mem->resp.status);
> +		if (!timeout)
> +			return -EINVAL;
>  	}
> 
>  	/* get xGMI session id from response buffer */ @@ -677,25 +679,35
> @@ static int psp_hw_start(struct psp_context *psp)
> 
>  	if (!amdgpu_sriov_vf(adev) || !adev->in_gpu_reset) {
>  		ret = psp_bootloader_load_sysdrv(psp);
> -		if (ret)
> +		if (ret) {
> +			DRM_ERROR("PSP load sysdrv failed!\n");
>  			return ret;
> +		}
> 
>  		ret = psp_bootloader_load_sos(psp);
> -		if (ret)
> +		if (ret) {
> +			DRM_ERROR("PSP load sos failed!\n");
>  			return ret;
> +		}
>  	}
> 
>  	ret = psp_ring_create(psp, PSP_RING_TYPE__KM);
> -	if (ret)
> +	if (ret) {
> +		DRM_ERROR("PSP create ring failed!\n");
>  		return ret;
> +	}
> 
>  	ret = psp_tmr_load(psp);
> -	if (ret)
> +	if (ret) {
> +		DRM_ERROR("PSP load tmr failed!\n");
>  		return ret;
> +	}
> 
>  	ret = psp_asd_load(psp);
> -	if (ret)
> +	if (ret) {
> +		DRM_ERROR("PSP load asd failed!\n");
>  		return ret;
> +	}
> 
>  	if (adev->gmc.xgmi.num_physical_nodes > 1) {
>  		ret = psp_xgmi_initialize(psp);
> @@ -890,16 +902,22 @@ static int psp_load_fw(struct amdgpu_device
> *adev)
>  	memset(psp->fence_buf, 0, PSP_FENCE_BUFFER_SIZE);
> 
>  	ret = psp_ring_init(psp, PSP_RING_TYPE__KM);
> -	if (ret)
> +	if (ret) {
> +		DRM_ERROR("PSP ring init failed!\n");
>  		goto failed_mem;
> +	}
> 
>  	ret = psp_tmr_init(psp);
> -	if (ret)
> +	if (ret) {
> +		DRM_ERROR("PSP tmr init failed!\n");
>  		goto failed_mem;
> +	}
> 
>  	ret = psp_asd_init(psp);
> -	if (ret)
> +	if (ret) {
> +		DRM_ERROR("PSP asd init failed!\n");
>  		goto failed_mem;
> +	}
> 
>  skip_memalloc:
>  	ret = psp_hw_start(psp);
> --
> 2.21.0

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

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

* RE: [PATCH 1/3] drm/amdgpu: error out on mode1 reset failure
       [not found] ` <20190315060139.1770-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
  2019-03-15  6:01   ` [PATCH 2/3] drm/amdgpu: trivial typo fix Evan Quan
  2019-03-15  6:01   ` [PATCH 3/3] drm/amdgpu: add more debug friendly prompts Evan Quan
@ 2019-03-22  8:31   ` Quan, Evan
       [not found]     ` <MN2PR12MB3344B70F5DA8EEB34412D592E4430-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  2 siblings, 1 reply; 8+ messages in thread
From: Quan, Evan @ 2019-03-22  8:31 UTC (permalink / raw)
  To: Quan, Evan, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Ping..

> -----Original Message-----
> From: Evan Quan <evan.quan@amd.com>
> Sent: 2019年3月15日 14:02
> To: amd-gfx@lists.freedesktop.org
> Cc: Quan, Evan <Evan.Quan@amd.com>
> Subject: [PATCH 1/3] drm/amdgpu: error out on mode1 reset failure
> 
> The error return value should be correctly reflected.
> 
> Change-Id: I93bf6fa77193d4e3f102a4e223aa8cb18cb525cc
> Signed-off-by: Evan Quan <evan.quan@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/soc15.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c
> b/drivers/gpu/drm/amd/amdgpu/soc15.c
> index 0c5ce4bd6feb..9d33a5d73072 100644
> --- a/drivers/gpu/drm/amd/amdgpu/soc15.c
> +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
> @@ -393,6 +393,7 @@ void soc15_program_register_sequence(struct
> amdgpu_device *adev,  static int soc15_asic_mode1_reset(struct
> amdgpu_device *adev)  {
>  	u32 i;
> +	int ret = 0;
> 
>  	amdgpu_atombios_scratch_regs_engine_hung(adev, true);
> 
> @@ -403,7 +404,9 @@ static int soc15_asic_mode1_reset(struct
> amdgpu_device *adev)
> 
>  	pci_save_state(adev->pdev);
> 
> -	psp_gpu_reset(adev);
> +	ret = psp_gpu_reset(adev);
> +	if (ret)
> +		dev_err(adev->dev, "GPU mode1 reset failed\n");
> 
>  	pci_restore_state(adev->pdev);
> 
> @@ -418,7 +421,7 @@ static int soc15_asic_mode1_reset(struct
> amdgpu_device *adev)
> 
>  	amdgpu_atombios_scratch_regs_engine_hung(adev, false);
> 
> -	return 0;
> +	return ret;
>  }
> 
>  static int soc15_asic_get_baco_capability(struct amdgpu_device *adev, bool
> *cap)
> --
> 2.21.0

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

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

* RE: [PATCH 3/3] drm/amdgpu: add more debug friendly prompts
       [not found]         ` <MN2PR12MB3344D46779A9EE3EA9BE03F6E4430-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2019-03-22  8:52           ` Xu, Feifei
  0 siblings, 0 replies; 8+ messages in thread
From: Xu, Feifei @ 2019-03-22  8:52 UTC (permalink / raw)
  To: Quan, Evan

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

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Quan, Evan
Sent: Friday, March 22, 2019 4:31 PM
To: Quan, Evan <Evan.Quan@amd.com>; amd-gfx@lists.freedesktop.org
Subject: RE: [PATCH 3/3] drm/amdgpu: add more debug friendly prompts

Ping..

> -----Original Message-----
> From: Evan Quan <evan.quan@amd.com>
> Sent: 2019年3月15日 14:02
> To: amd-gfx@lists.freedesktop.org
> Cc: Quan, Evan <Evan.Quan@amd.com>
> Subject: [PATCH 3/3] drm/amdgpu: add more debug friendly prompts
> 
> Large piece of codes share one error prompt. That is not friendly for 
> debugging.
> 
> Change-Id: I15f77210af6a409981fe44cf5dd3aa8ce48d948f
> Signed-off-by: Evan Quan <evan.quan@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 38 ++++++++++++++++++-
> ------
>  1 file changed, 28 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index 32388b5218e9..5888e24219d9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -136,7 +136,7 @@ psp_cmd_submit_buf(struct psp_context *psp,
> 
>  	while (*((unsigned int *)psp->fence_buf) != index) {
>  		if (--timeout == 0)
> -			return -EINVAL;
> +			break;
>  		msleep(1);
>  	}
> 
> @@ -147,12 +147,14 @@ psp_cmd_submit_buf(struct psp_context *psp,
>  	 * during psp initialization to avoid breaking hw_init and it doesn't
>  	 * return -EINVAL.
>  	 */
> -	if (psp->cmd_buf_mem->resp.status) {
> +	if (psp->cmd_buf_mem->resp.status || !timeout) {
>  		if (ucode)
>  			DRM_WARN("failed to load ucode id (%d) ",
>  				  ucode->ucode_id);
>  		DRM_WARN("psp command failed and response status is (%d)\n",
>  			  psp->cmd_buf_mem->resp.status);
> +		if (!timeout)
> +			return -EINVAL;
>  	}
> 
>  	/* get xGMI session id from response buffer */ @@ -677,25 +679,35 @@ 
> static int psp_hw_start(struct psp_context *psp)
> 
>  	if (!amdgpu_sriov_vf(adev) || !adev->in_gpu_reset) {
>  		ret = psp_bootloader_load_sysdrv(psp);
> -		if (ret)
> +		if (ret) {
> +			DRM_ERROR("PSP load sysdrv failed!\n");
>  			return ret;
> +		}
> 
>  		ret = psp_bootloader_load_sos(psp);
> -		if (ret)
> +		if (ret) {
> +			DRM_ERROR("PSP load sos failed!\n");
>  			return ret;
> +		}
>  	}
> 
>  	ret = psp_ring_create(psp, PSP_RING_TYPE__KM);
> -	if (ret)
> +	if (ret) {
> +		DRM_ERROR("PSP create ring failed!\n");
>  		return ret;
> +	}
> 
>  	ret = psp_tmr_load(psp);
> -	if (ret)
> +	if (ret) {
> +		DRM_ERROR("PSP load tmr failed!\n");
>  		return ret;
> +	}
> 
>  	ret = psp_asd_load(psp);
> -	if (ret)
> +	if (ret) {
> +		DRM_ERROR("PSP load asd failed!\n");
>  		return ret;
> +	}
> 
>  	if (adev->gmc.xgmi.num_physical_nodes > 1) {
>  		ret = psp_xgmi_initialize(psp);
> @@ -890,16 +902,22 @@ static int psp_load_fw(struct amdgpu_device
> *adev)
>  	memset(psp->fence_buf, 0, PSP_FENCE_BUFFER_SIZE);
> 
>  	ret = psp_ring_init(psp, PSP_RING_TYPE__KM);
> -	if (ret)
> +	if (ret) {
> +		DRM_ERROR("PSP ring init failed!\n");
>  		goto failed_mem;
> +	}
> 
>  	ret = psp_tmr_init(psp);
> -	if (ret)
> +	if (ret) {
> +		DRM_ERROR("PSP tmr init failed!\n");
>  		goto failed_mem;
> +	}
> 
>  	ret = psp_asd_init(psp);
> -	if (ret)
> +	if (ret) {
> +		DRM_ERROR("PSP asd init failed!\n");
>  		goto failed_mem;
> +	}
> 
>  skip_memalloc:
>  	ret = psp_hw_start(psp);
> --
> 2.21.0

_______________________________________________
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] 8+ messages in thread

* RE: [PATCH 1/3] drm/amdgpu: error out on mode1 reset failure
       [not found]     ` <MN2PR12MB3344B70F5DA8EEB34412D592E4430-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2019-03-22  8:53       ` Xu, Feifei
  0 siblings, 0 replies; 8+ messages in thread
From: Xu, Feifei @ 2019-03-22  8:53 UTC (permalink / raw)
  To: Quan, Evan

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

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Quan, Evan
Sent: Friday, March 22, 2019 4:32 PM
To: Quan, Evan <Evan.Quan@amd.com>; amd-gfx@lists.freedesktop.org
Subject: RE: [PATCH 1/3] drm/amdgpu: error out on mode1 reset failure

Ping..

> -----Original Message-----
> From: Evan Quan <evan.quan@amd.com>
> Sent: 2019年3月15日 14:02
> To: amd-gfx@lists.freedesktop.org
> Cc: Quan, Evan <Evan.Quan@amd.com>
> Subject: [PATCH 1/3] drm/amdgpu: error out on mode1 reset failure
> 
> The error return value should be correctly reflected.
> 
> Change-Id: I93bf6fa77193d4e3f102a4e223aa8cb18cb525cc
> Signed-off-by: Evan Quan <evan.quan@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/soc15.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c
> b/drivers/gpu/drm/amd/amdgpu/soc15.c
> index 0c5ce4bd6feb..9d33a5d73072 100644
> --- a/drivers/gpu/drm/amd/amdgpu/soc15.c
> +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
> @@ -393,6 +393,7 @@ void soc15_program_register_sequence(struct
> amdgpu_device *adev,  static int soc15_asic_mode1_reset(struct 
> amdgpu_device *adev)  {
>  	u32 i;
> +	int ret = 0;
> 
>  	amdgpu_atombios_scratch_regs_engine_hung(adev, true);
> 
> @@ -403,7 +404,9 @@ static int soc15_asic_mode1_reset(struct 
> amdgpu_device *adev)
> 
>  	pci_save_state(adev->pdev);
> 
> -	psp_gpu_reset(adev);
> +	ret = psp_gpu_reset(adev);
> +	if (ret)
> +		dev_err(adev->dev, "GPU mode1 reset failed\n");
> 
>  	pci_restore_state(adev->pdev);
> 
> @@ -418,7 +421,7 @@ static int soc15_asic_mode1_reset(struct 
> amdgpu_device *adev)
> 
>  	amdgpu_atombios_scratch_regs_engine_hung(adev, false);
> 
> -	return 0;
> +	return ret;
>  }
> 
>  static int soc15_asic_get_baco_capability(struct amdgpu_device *adev, 
> bool
> *cap)
> --
> 2.21.0

_______________________________________________
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] 8+ messages in thread

end of thread, other threads:[~2019-03-22  8:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-15  6:01 [PATCH 1/3] drm/amdgpu: error out on mode1 reset failure Evan Quan
     [not found] ` <20190315060139.1770-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
2019-03-15  6:01   ` [PATCH 2/3] drm/amdgpu: trivial typo fix Evan Quan
     [not found]     ` <20190315060139.1770-2-evan.quan-5C7GfCeVMHo@public.gmane.org>
2019-03-15  8:35       ` Christian König
2019-03-15  6:01   ` [PATCH 3/3] drm/amdgpu: add more debug friendly prompts Evan Quan
     [not found]     ` <20190315060139.1770-3-evan.quan-5C7GfCeVMHo@public.gmane.org>
2019-03-22  8:31       ` Quan, Evan
     [not found]         ` <MN2PR12MB3344D46779A9EE3EA9BE03F6E4430-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-03-22  8:52           ` Xu, Feifei
2019-03-22  8:31   ` [PATCH 1/3] drm/amdgpu: error out on mode1 reset failure Quan, Evan
     [not found]     ` <MN2PR12MB3344B70F5DA8EEB34412D592E4430-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-03-22  8:53       ` Xu, Feifei

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.