From: Hawking Zhang <[email protected]>

Since from navi10, the tmr_size should be decided by psp sos according to
toc header. Driver should issue LOAD_TOC to psp sos to get the tmr_size needed.
The allocation of tmr_size then should be done only when sos/sysdrv loading
completed

Accordingly, asd_init also move to psp_hw_start after sos fw loading to make
calling sequence consistent.

Signed-off-by: Hawking Zhang <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index b5dc19727edb..297b1e1e3e49 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -776,12 +776,24 @@ static int psp_hw_start(struct psp_context *psp)
                return ret;
        }
 
+       ret = psp_tmr_init(psp);
+       if (ret) {
+               DRM_ERROR("PSP tmr init failed!\n");
+               return ret;
+       }
+
        ret = psp_tmr_load(psp);
        if (ret) {
                DRM_ERROR("PSP load tmr failed!\n");
                return ret;
        }
 
+       ret = psp_asd_init(psp);
+       if (ret) {
+               DRM_ERROR("PSP asd init failed!\n");
+               return ret;
+       }
+
        ret = psp_asd_load(psp);
        if (ret) {
                DRM_ERROR("PSP load asd failed!\n");
@@ -997,18 +1009,6 @@ static int psp_load_fw(struct amdgpu_device *adev)
                goto failed;
        }
 
-       ret = psp_tmr_init(psp);
-       if (ret) {
-               DRM_ERROR("PSP tmr init failed!\n");
-               goto failed;
-       }
-
-       ret = psp_asd_init(psp);
-       if (ret) {
-               DRM_ERROR("PSP asd init failed!\n");
-               goto failed;
-       }
-
 skip_memalloc:
        ret = psp_hw_start(psp);
        if (ret)
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to