drm/amdgpu: fix rmmod KCQ disable failed error
authorWang Hongcheng <Annie.Wang@amd.com>
Fri, 17 Nov 2017 02:39:02 +0000 (10:39 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 21 Nov 2017 15:45:05 +0000 (10:45 -0500)
If  gfx_v8_0_hw_fini is called after amdgpu_ucode_fini_bo, we will
hit KCQ disabled failed. Let amdgpu_ucode_fini_bo run after
gfx_v8_0_hw_fini.

BUG: SWDEV-135547
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Wang Hongcheng <Annie.Wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

index cbe5620654e7c2df4dd2c6003aab402957a06842..2c85e0a98608d0a8fb4a1ae5991f6d6eece3b1ec 100644 (file)
@@ -1836,6 +1836,9 @@ static int amdgpu_fini(struct amdgpu_device *adev)
                adev->ip_blocks[i].status.hw = false;
        }
 
+       if (adev->firmware.load_type == AMDGPU_FW_LOAD_SMU)
+               amdgpu_ucode_fini_bo(adev);
+
        for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
                if (!adev->ip_blocks[i].status.sw)
                        continue;
index 5f5aa5fddc169355077a4e61665563c087d860f5..033fba2def6f775b35f4f840f7032477c4403ad3 100644 (file)
@@ -164,9 +164,6 @@ static int amdgpu_pp_hw_fini(void *handle)
                ret = adev->powerplay.ip_funcs->hw_fini(
                                        adev->powerplay.pp_handle);
 
-       if (adev->firmware.load_type == AMDGPU_FW_LOAD_SMU)
-               amdgpu_ucode_fini_bo(adev);
-
        return ret;
 }
 
index 447d446b50150d475cb9a01945706b17bbfc2e78..7714f4a6c8b000072c2b7c3d8691884b3d902a35 100644 (file)
@@ -442,8 +442,6 @@ static int psp_hw_fini(void *handle)
        if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP)
                return 0;
 
-       amdgpu_ucode_fini_bo(adev);
-
        psp_ring_destroy(psp, PSP_RING_TYPE__KM);
 
        amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, &psp->tmr_buf);