drm/amdgpu/pm: notify driver unloading to PMFW for SMU v13.0.6 dGPU
authorLe Ma <le.ma@amd.com>
Wed, 31 May 2023 08:08:50 +0000 (16:08 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Jun 2023 16:39:41 +0000 (12:39 -0400)
Per requested, follow the same sequence as APU to send only
PPSMC_MSG_PrepareForDriverUnload to PMFW during driver unloading.

Signed-off-by: Le Ma <le.ma@amd.com>
Reviewed-by: Shiwu Zhang <shiwu.zhang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c

index 2611241a5ff160b0a2df041d792178c1c07404ad..a92ea4601ea4740d4fb14223f2d605316ccc4017 100644 (file)
@@ -1413,18 +1413,16 @@ static int smu_v13_0_6_system_features_control(struct smu_context *smu,
                                               bool enable)
 {
        struct amdgpu_device *adev = smu->adev;
-       int ret;
-
-       /* On APUs, notify FW that the device is no longer driver managed */
-       if (adev->flags & AMD_IS_APU) {
-               if (!enable)
-                       smu_v13_0_6_notify_unload(smu);
+       int ret = 0;
 
-               return 0;
+       if (enable) {
+               if (!(adev->flags & AMD_IS_APU))
+                       ret = smu_v13_0_system_features_control(smu, enable);
+       } else {
+               /* Notify FW that the device is no longer driver managed */
+               smu_v13_0_6_notify_unload(smu);
        }
 
-       ret = smu_v13_0_system_features_control(smu, enable);
-
        return ret;
 }