drm/amd: Fix shutdown (again) on some SMU v13.0.4/11 platforms
authorjsg <jsg@openbsd.org>
Mon, 17 Jun 2024 07:29:10 +0000 (07:29 +0000)
committerjsg <jsg@openbsd.org>
Mon, 17 Jun 2024 07:29:10 +0000 (07:29 +0000)
From Mario Limonciello
7bc52dce073222c1b6dd23a1e76a68495fc14794 in linux-6.6.y/6.6.34
267cace556e8a53d703119f7435ab556209e5b6a in mainline linux

sys/dev/pci/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c

index cd674ef..1fd4702 100644 (file)
@@ -226,15 +226,17 @@ static int smu_v13_0_4_system_features_control(struct smu_context *smu, bool en)
        struct amdgpu_device *adev = smu->adev;
        int ret = 0;
 
-       if (!en && adev->in_s4) {
-               /* Adds a GFX reset as workaround just before sending the
-                * MP1_UNLOAD message to prevent GC/RLC/PMFW from entering
-                * an invalid state.
-                */
-               ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_GfxDeviceDriverReset,
-                                                     SMU_RESET_MODE_2, NULL);
-               if (ret)
-                       return ret;
+       if (!en && !adev->in_s0ix) {
+               if (adev->in_s4) {
+                       /* Adds a GFX reset as workaround just before sending the
+                        * MP1_UNLOAD message to prevent GC/RLC/PMFW from entering
+                        * an invalid state.
+                        */
+                       ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_GfxDeviceDriverReset,
+                                                             SMU_RESET_MODE_2, NULL);
+                       if (ret)
+                               return ret;
+               }
 
                ret = smu_cmn_send_smc_msg(smu, SMU_MSG_PrepareMp1ForUnload, NULL);
        }