From: Likun Gao <likun....@amd.com>

Move microcode loading from sw_init to early_init to align with
the perious version of imu init sequence.

Signed-off-by: Likun Gao <likun....@amd.com>
Signed-off-by: Alex Deucher <alexander.deuc...@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
index df5873ba54e76..e8505c77e12e8 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
@@ -461,6 +461,14 @@ static int gfx_v12_0_init_microcode(struct amdgpu_device 
*adev)
        /* only one MEC for gfx 12 */
        adev->gfx.mec2_fw = NULL;
 
+       if (adev->gfx.imu.funcs && (amdgpu_dpm > 0)) {
+               if (adev->gfx.imu.funcs->init_microcode) {
+                       err = adev->gfx.imu.funcs->init_microcode(adev);
+                       if (err)
+                               dev_err(adev->dev, "Failed to load imu 
firmware!\n");
+               }
+       }
+
 out:
        if (err) {
                amdgpu_ucode_release(&adev->gfx.pfp_fw);
@@ -1172,14 +1180,6 @@ static int gfx_v12_0_sw_init(void *handle)
 
        adev->gfx.gfx_current_status = AMDGPU_GFX_NORMAL_MODE;
 
-       if (adev->gfx.imu.funcs && (amdgpu_dpm > 0)) {
-               if (adev->gfx.imu.funcs->init_microcode) {
-                       r = adev->gfx.imu.funcs->init_microcode(adev);
-                       if (r)
-                               dev_err(adev->dev, "Failed to load imu 
firmware!\n");
-               }
-       }
-
        gfx_v12_0_me_init(adev);
 
        r = gfx_v12_0_rlc_init(adev);
-- 
2.44.0

Reply via email to