drm/amd/pm: Fix the error of dpm_enabled flag
Subsystems (3)
PATCH 1/1 drm/amd/pm: Fix the error of dpm_enabled flag
Set dpm_enabled flag to false only when dpms is
successfully disabled.
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 -4
@@ -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;
Signature · 1 line
2.34.1
Quoted 3 lines · Ma Jun
Set
dpm_enabledflag 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
Quoted 36 lines
Signed-off-by Ma Jun <[email protected]>--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2
-4@@ -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;
Hi Lijo,
No real issue here.
Thanks for your explanation. :)
Regards,
Ma Jun
Quoted 51 lines · Lijo
Quoted 3 lines · Ma Jun
Set
dpm_enabledflag 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,
LijoQuoted 36 lines
Signed-off-by Ma Jun <[email protected]>--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2
-4@@ -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;