[PATCH] drm/amd/pm: Fix the error of dpm_enabled flag
Ma Jun
Jun.Ma2 at amd.com
Wed Nov 15 05:18:08 UTC 2023
Set dpm_enabled flag to false only when dpms is
successfully disabled.
Signed-off-by: Ma Jun <Jun.Ma2 at amd.com>
---
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index 1b9896001172..4bb86315e8c1 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -1740,6 +1740,8 @@ static int smu_smc_hw_cleanup(struct smu_context *smu)
return ret;
}
+ adev->pm.dpm_enabled = false;
+
return 0;
}
@@ -1762,8 +1764,6 @@ static int smu_hw_fini(void *handle)
if (!smu->pm_enabled)
return 0;
- adev->pm.dpm_enabled = false;
-
return smu_smc_hw_cleanup(smu);
}
@@ -1808,8 +1808,6 @@ static int smu_suspend(void *handle)
if (!smu->pm_enabled)
return 0;
- adev->pm.dpm_enabled = false;
-
ret = smu_smc_hw_cleanup(smu);
if (ret)
return ret;
--
2.34.1
More information about the amd-gfx
mailing list