On 11/15/2023 10:48 AM, Ma Jun wrote:
Set dpm_enabled flag to false only when dpms is
successfully disabled.
This a software flag and we block many services based on this flag
status. I think the purpose of setting it early is to block other
service calls which could come in between. Did you find any real issue
with this?
Thanks,
Lijo
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;