[PATCH] drm/amd/pm: Fix the error of dpm_enabled flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Set dpm_enabled flag to false only when dpms is
successfully disabled.

Signed-off-by: Ma Jun <Jun.Ma2@xxxxxxx>
---
 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




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux