From: jsg Date: Mon, 17 Jun 2024 07:29:10 +0000 (+0000) Subject: drm/amd: Fix shutdown (again) on some SMU v13.0.4/11 platforms X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=21008cde1b808785b3b6cccf52f66047e58a62fe;p=openbsd drm/amd: Fix shutdown (again) on some SMU v13.0.4/11 platforms From Mario Limonciello 7bc52dce073222c1b6dd23a1e76a68495fc14794 in linux-6.6.y/6.6.34 267cace556e8a53d703119f7435ab556209e5b6a in mainline linux --- diff --git a/sys/dev/pci/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c b/sys/dev/pci/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c index cd674ef5adb..1fd4702dc63 100644 --- a/sys/dev/pci/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c +++ b/sys/dev/pci/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c @@ -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); }