drm/amdgpu: error out on mode1 reset failure
Subsystems (2)
PATCH 1/3 drm/amdgpu: error out on mode1 reset failure
The error return value should be correctly reflected.
--- drivers/gpu/drm/amd/amdgpu/soc15.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +5 -2
@@ -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)
Signature · 6 lines
2.21.0 _______________________________________________ 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): [email protected]
PATCH 2/3 drm/amdgpu: trivial typo fix
"error" was not correctly spelled.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -2
@@ -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 ; }
Signature · 6 lines
2.21.0 _______________________________________________ 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): [email protected]
Christian König
Reviewed-byRe: [PATCH 2/3] drm/amdgpu: trivial typo fix
Am 15.03.19 um 07:01 schrieb Evan Quan:
Quoted 4 lines
"error" was not correctly spelled.
Change-Id Idc3acb6172469c1d63227cb5f0df75f912c10871Signed-off-by Evan Quan <[email protected]>
Quoted 18 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-1@@ -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); }
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int amdgpu_do_asic_reset(struct amdgpu_hive_info *hive, · line 3402
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-1@@ -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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/3 drm/amdgpu: add more debug friendly prompts
In reply to a message not in the archiveLarge piece of codes share one error prompt. That
is not friendly for debugging.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 38 ++++++++++++++++++------- 1 file changed, 28 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +28 -10
@@ -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);
Signature · 6 lines
2.21.0 _______________________________________________ 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): [email protected]
RE: [PATCH 3/3] drm/amdgpu: add more debug friendly prompts
Ping..
Quoted 115 lines
-----Original Message-----
From: Evan Quan <[email protected]>
Sent: 2019年3月15日 14:02
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 3/3] drm/amdgpu: add more debug friendly promptsLarge piece of codes share one error prompt. That is not friendly for debugging.
Change-Id I15f77210af6a409981fe44cf5dd3aa8ce48d948fSigned-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 38 ++++++++++++++++++- ------ 1 file changed, 28 insertions(+), 10 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +4
-2@@ -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 intpsp_hw_start(struct psp_context *psp)drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +24
-8if (!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:
Quoted 3 lines
ret =
psp_hw_start(psp);
--
2.21.0
_______________________________________________
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): MN2PR12MB3344D46779A9EE3EA9BE03F6E4430-rweVpJHSKToDMgCC8P//[email protected]
Xu, Feifei
Reviewed-by Feifei XuRE: [PATCH 3/3] drm/amdgpu: add more debug friendly prompts
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Quan, Evan
Sent: Friday, March 22, 2019 4:31 PM
To: Quan, Evan <[email protected]>; [email protected]
Subject: RE: [PATCH 3/3] drm/amdgpu: add more debug friendly prompts
Ping..
Quoted 114 lines
-----Original Message-----
From: Evan Quan <[email protected]>
Sent: 2019年3月15日 14:02
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 3/3] drm/amdgpu: add more debug friendly promptsLarge piece of codes share one error prompt. That is not friendly for debugging.
Change-Id I15f77210af6a409981fe44cf5dd3aa8ce48d948fSigned-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 38 ++++++++++++++++++- ------ 1 file changed, 28 insertions(+), 10 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +4
-2@@ -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)drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +24
-8if (!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:
Quoted 3 lines
ret =
psp_hw_start(psp);
--
2.21.0
_______________________________________________
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
Ping..
Quoted 49 lines
-----Original Message-----
From: Evan Quan <[email protected]>
Sent: 2019年3月15日 14:02
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 1/3] drm/amdgpu: error out on mode1 reset failureThe error return value should be correctly reflected.
Change-Id I93bf6fa77193d4e3f102a4e223aa8cb18cb525ccSigned-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/soc15.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/soc15.c +0
-0@@ -393,6 +393,7 @@ void soc15_program_register_sequence(struct
amdgpu_device*adev, static intsoc15_asic_mode1_reset(struct amdgpu_device *adev){drivers/gpu/drm/amd/amdgpu/soc15.c +5
-2u32 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; }
Quoted 4 lines
static int soc15_asic_get_baco_capability(struct
amdgpu_device*adev, bool
*cap)
--
2.21.0
_______________________________________________
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): MN2PR12MB3344B70F5DA8EEB34412D592E4430-rweVpJHSKToDMgCC8P//[email protected]
Xu, Feifei
Reviewed-by Feifei Xu-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Quan, Evan
Sent: Friday, March 22, 2019 4:32 PM
To: Quan, Evan <[email protected]>; [email protected]
Subject: RE: [PATCH 1/3] drm/amdgpu: error out on mode1 reset failure
Ping..
Quoted 49 lines
-----Original Message-----
From: Evan Quan <[email protected]>
Sent: 2019年3月15日 14:02
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 1/3] drm/amdgpu: error out on mode1 reset failureThe error return value should be correctly reflected.
Change-Id I93bf6fa77193d4e3f102a4e223aa8cb18cb525ccSigned-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/soc15.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/soc15.c +0
-0@@ -393,6 +393,7 @@ void soc15_program_register_sequence(struct
amdgpu_device*adev, static intsoc15_asic_mode1_reset(struct amdgpu_device *adev){drivers/gpu/drm/amd/amdgpu/soc15.c +5
-2u32 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; }
Quoted 5 lines
static int soc15_asic_get_baco_capability(struct
amdgpu_device*adev,
bool
*cap)
--
2.21.0
_______________________________________________
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