drm/amdgpu: fix resume failures due to psp fw loading sequence change (v2)
Subsystems (2)
PATCH 1/1 drm/amdgpu: fix resume failures due to psp fw loading sequence change (v2)
this fix the regression caused by asd/ta loading sequence adjustment recently. asd/ta loading was move out from hw_start and should also be applied to psp_resume. otherwise those fw loading will be ignored in resume phase.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +34 -0
@@ -1702,6 +1702,40 @@ static int psp_resume(void *handle)if (ret) goto failed; + ret =psp_asd_load (psp); +if (ret) { +DRM_ERROR ("PSP load asd failed!\n" ); +mutex_unlock (&adev->firmware.mutex); +return ret; + } + +if (adev->gmc.xgmi.num_physical_nodes >1 ) { + ret =psp_xgmi_initialize (psp); +/* Warning the XGMI seesion initialize failure +* Instead of stop driver initialization +*/ +if (ret) +dev_err (psp->adev->dev, +"XGMI: Failed to initialize XGMI session\n" ); + } + +if (psp->adev->psp.ta_fw) { + ret =psp_ras_initialize (psp); +if (ret) +dev_err (psp->adev->dev, +"RAS: Failed to initialize RAS\n" ); + + ret =psp_hdcp_initialize (psp); +if (ret) +dev_err (psp->adev->dev, +"HDCP: Failed to initialize HDCP\n" ); + + ret =psp_dtm_initialize (psp); +if (ret) +dev_err (psp->adev->dev, +"DTM: Failed to initialize DTM\n" ); + } +mutex_unlock (&adev->firmware.mutex);return 0 ;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Public Use]
I recommend we use the existing "goto failed" for psp load failure case, instead of adding one new mutex unlock before returning.
This will help reduce redundant code, and moreover, there is one error print " PSP resume failed " in "failed" route, which may be captured for trace/debug purpose. How do you think?
Regards,
Guchun
-----Original Message-----
From: Hawking Zhang <[email protected]>
Sent: Friday, December 6, 2019 5:45 PM
To: [email protected]; Ma, Le <[email protected]>; Clements, John <[email protected]>; Deucher, Alexander <[email protected]>; Chen, Guchun <[email protected]>
Cc: Zhang, Hawking <[email protected]>
Subject: [PATCH] drm/amdgpu: fix resume failures due to psp fw loading sequence change (v2)
this fix the regression caused by asd/ta loading sequence adjustment recently. asd/ta loading was move out from hw_start and should also be applied to psp_resume. otherwise those fw loading will be ignored in resume phase.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +34 -0
@@ -1702,6 +1702,40 @@ static int psp_resume(void *handle)if (ret) goto failed; + ret =psp_asd_load (psp); +if (ret) { +DRM_ERROR ("PSP load asd failed!\n" ); +mutex_unlock (&adev->firmware.mutex); +return ret; + } + +if (adev->gmc.xgmi.num_physical_nodes >1 ) { + ret =psp_xgmi_initialize (psp); +/* Warning the XGMI seesion initialize failure +* Instead of stop driver initialization +*/ +if (ret) +dev_err (psp->adev->dev, +"XGMI: Failed to initialize XGMI session\n" ); + } + +if (psp->adev->psp.ta_fw) { + ret =psp_ras_initialize (psp); +if (ret) +dev_err (psp->adev->dev, +"RAS: Failed to initialize RAS\n" ); + + ret =psp_hdcp_initialize (psp); +if (ret) +dev_err (psp->adev->dev, +"HDCP: Failed to initialize HDCP\n" ); + + ret =psp_dtm_initialize (psp); +if (ret) +dev_err (psp->adev->dev, +"DTM: Failed to initialize DTM\n" ); + } +mutex_unlock (&adev->firmware.mutex);return 0 ;
--
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
I'm fine with it. Please check v3
Regards,
Hawking
-----Original Message-----
From: Chen, Guchun <[email protected]>
Sent: 2019年12月6日 17:52
To: Zhang, Hawking <[email protected]>; [email protected]; Ma, Le <[email protected]>; Clements, John <[email protected]>; Deucher, Alexander <[email protected]>
Cc: Zhang, Hawking <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: fix resume failures due to psp fw loading sequence change (v2)
[AMD Public Use]
I recommend we use the existing "goto failed" for psp load failure case, instead of adding one new mutex unlock before returning.
This will help reduce redundant code, and moreover, there is one error print " PSP resume failed " in "failed" route, which may be captured for trace/debug purpose. How do you think?
Regards,
Guchun
-----Original Message-----
From: Hawking Zhang <[email protected]>
Sent: Friday, December 6, 2019 5:45 PM
To: [email protected]; Ma, Le <[email protected]>; Clements, John <[email protected]>; Deucher, Alexander <[email protected]>; Chen, Guchun <[email protected]>
Cc: Zhang, Hawking <[email protected]>
Subject: [PATCH] drm/amdgpu: fix resume failures due to psp fw loading sequence change (v2)
this fix the regression caused by asd/ta loading sequence adjustment recently. asd/ta loading was move out from hw_start and should also be applied to psp_resume. otherwise those fw loading will be ignored in resume phase.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +34 -0
@@ -1702,6 +1702,40 @@ static int psp_resume(void *handle)if (ret) goto failed; + ret =psp_asd_load (psp); +if (ret) { +DRM_ERROR ("PSP load asd failed!\n" ); +mutex_unlock (&adev->firmware.mutex); +return ret; + } + +if (adev->gmc.xgmi.num_physical_nodes >1 ) { + ret =psp_xgmi_initialize (psp); +/* Warning the XGMI seesion initialize failure +* Instead of stop driver initialization +*/ +if (ret) +dev_err (psp->adev->dev, +"XGMI: Failed to initialize XGMI session\n" ); + } + +if (psp->adev->psp.ta_fw) { + ret =psp_ras_initialize (psp); +if (ret) +dev_err (psp->adev->dev, +"RAS: Failed to initialize RAS\n" ); + + ret =psp_hdcp_initialize (psp); +if (ret) +dev_err (psp->adev->dev, +"HDCP: Failed to initialize HDCP\n" ); + + ret =psp_dtm_initialize (psp); +if (ret) +dev_err (psp->adev->dev, +"DTM: Failed to initialize DTM\n" ); + } +mutex_unlock (&adev->firmware.mutex);return 0 ;
--
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx