drm/amd/pm: fix runtime PM imbalance issue in amdgpu_pm.c
Subsystems (3)
PATCH 1/1 drm/amd/pm: fix runtime PM imbalance issue in amdgpu_pm.c
Fix runtime PM counter imbalance to prevent device from failing to enter low power state
Fixes a50d32c41fb2 ("drm/amd/pm: Deprecate print_clock_levels interface")
Signed-off-by Yang Wang <[email protected]>
--- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +10 -4
@@ -995,12 +995,15 @@ static ssize_t amdgpu_get_pp_dpm_clock(struct device *dev,return ret; ret =amdgpu_dpm_emit_clock_levels (adev, type, buf, &size); -if (ret) -return ret; +if (ret) { + size = ret; + goto out_pm_put; + }if (size ==0 ) size =sysfs_emit (buf,"\n" ); +out_pm_put:amdgpu_pm_put_access (adev);return size;
@@ -3902,11 +3905,14 @@ static int amdgpu_retrieve_od_settings(struct amdgpu_device *adev,return ret; ret =amdgpu_dpm_emit_clock_levels (adev, od_type, buf, &size); -if (ret) -return ret; +if (ret) { + size = ret; + goto out_pm_put; + }if (size ==0 ) size =sysfs_emit (buf,"\n" ); +out_pm_put:amdgpu_pm_put_access (adev);return size;
Signature · 1 line
2.47.3
Quoted 5 lines · Yang Wang
Fix runtime PM counter imbalance to prevent device from failing to enter low power state
Fixes a50d32c41fb2 ("drm/amd/pm: Deprecate print_clock_levels interface")Signed-off-by Yang Wang <[email protected]>
Reviewed-by Lijo Lazar <[email protected]>
Thanks,
Lijo
Quoted 43 lines
--- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/pm/amdgpu_pm.c +10
-4@@ -995,12 +995,15 @@ static ssize_t amdgpu_get_pp_dpm_clock(struct device *dev,return ret; ret =amdgpu_dpm_emit_clock_levels (adev, type, buf, &size); -if (ret) -return ret; +if (ret) { + size = ret; + goto out_pm_put; + }if (size ==0 ) size =sysfs_emit (buf,"\n" ); +out_pm_put:amdgpu_pm_put_access (adev);return size;@@ -3902,11 +3905,14 @@ static int amdgpu_retrieve_od_settings(struct amdgpu_device *adev,return ret; ret =amdgpu_dpm_emit_clock_levels (adev, od_type, buf, &size); -if (ret) -return ret; +if (ret) { + size = ret; + goto out_pm_put; + }if (size ==0 ) size =sysfs_emit (buf,"\n" ); +out_pm_put:amdgpu_pm_put_access (adev);return size;