Check and report firmware boot status if it doesn't
reach steady status.

Signed-off-by: Hawking Zhang <hawking.zh...@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/psp_v13_0.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v13_0.c 
b/drivers/gpu/drm/amd/amdgpu/psp_v13_0.c
index 6fad451a85be..676bec2cc157 100644
--- a/drivers/gpu/drm/amd/amdgpu/psp_v13_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v13_0.c
@@ -187,11 +187,18 @@ static int psp_v13_0_wait_for_bootloader(struct 
psp_context *psp)
 static int psp_v13_0_wait_for_bootloader_steady_state(struct psp_context *psp)
 {
        struct amdgpu_device *adev = psp->adev;
+       int ret;
 
        if (amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 6)) {
-               psp_v13_0_wait_for_vmbx_ready(psp);
+               ret = psp_v13_0_wait_for_vmbx_ready(psp);
+               if (ret)
+                       amdgpu_ras_query_boot_status(adev, 4);
+
+               ret = psp_v13_0_wait_for_bootloader(psp);
+               if (ret)
+                       amdgpu_ras_query_boot_status(adev, 4);
 
-               return psp_v13_0_wait_for_bootloader(psp);
+               return ret;
        }
 
        return 0;
-- 
2.17.1

Reply via email to