drm/amdgpu: fix unload driver fail
authorEmily Deng <Emily.Deng@amd.com>
Mon, 27 May 2019 03:12:51 +0000 (11:12 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 28 May 2019 19:43:34 +0000 (14:43 -0500)
dc_destroy should be called amdgpu_cgs_destroy_device,
as it will use cgs context to read or write registers.

Signed-off-by: Emily Deng <Emily.Deng@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index c3e78039d1e6be9e816a5e97e09cc6329694198f..53b76e0de9403572fac9f69c0f65bf11c693d025 100644 (file)
@@ -616,6 +616,10 @@ error:
 static void amdgpu_dm_fini(struct amdgpu_device *adev)
 {
        amdgpu_dm_destroy_drm_device(&adev->dm);
+
+       /* DC Destroy TODO: Replace destroy DAL */
+       if (adev->dm.dc)
+               dc_destroy(&adev->dm.dc);
        /*
         * TODO: pageflip, vlank interrupt
         *
@@ -630,9 +634,6 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev)
                mod_freesync_destroy(adev->dm.freesync_module);
                adev->dm.freesync_module = NULL;
        }
-       /* DC Destroy TODO: Replace destroy DAL */
-       if (adev->dm.dc)
-               dc_destroy(&adev->dm.dc);
 
        mutex_destroy(&adev->dm.dc_lock);