]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd: Fix shutdown (again) on some SMU v13.0.4/11 platforms
authorMario Limonciello <mario.limonciello@amd.com>
Sun, 26 May 2024 12:59:08 +0000 (07:59 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jun 2024 11:41:37 +0000 (13:41 +0200)
commit 267cace556e8a53d703119f7435ab556209e5b6a upstream.

commit cd94d1b182d2 ("dm/amd/pm: Fix problems with reboot/shutdown for
some SMU 13.0.4/13.0.11 users") attempted to fix shutdown issues
that were reported since commit 31729e8c21ec ("drm/amd/pm: fixes a
random hang in S4 for SMU v13.0.4/11") but caused issues for some
people.

Adjust the workaround flow to properly only apply in the S4 case:
-> For shutdown go through SMU_MSG_PrepareMp1ForUnload
-> For S4 go through SMU_MSG_GfxDeviceDriverReset and
   SMU_MSG_PrepareMp1ForUnload

Reported-and-tested-by: lectrode <electrodexsnet@gmail.com>
Closes: https://github.com/void-linux/void-packages/issues/50417
Cc: stable@vger.kernel.org
Fixes: cd94d1b182d2 ("dm/amd/pm: Fix problems with reboot/shutdown for some SMU 13.0.4/13.0.11 users")
Reviewed-by: Tim Huang <Tim.Huang@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c

index 5de31961319a23761027a8ffb294231267114bca..b464a1f7e393cb220cb1af1777bf034285bce648 100644 (file)
@@ -222,15 +222,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);
        }