Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <kevinyang.wang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Yang Wang and committed by
Alex Deucher
25fd8095 80d4d3a4

+10 -4
+10 -4
drivers/gpu/drm/amd/pm/amdgpu_pm.c
··· 995 995 return ret; 996 996 997 997 ret = amdgpu_dpm_emit_clock_levels(adev, type, buf, &size); 998 - if (ret) 999 - return ret; 998 + if (ret) { 999 + size = ret; 1000 + goto out_pm_put; 1001 + } 1000 1002 1001 1003 if (size == 0) 1002 1004 size = sysfs_emit(buf, "\n"); 1003 1005 1006 + out_pm_put: 1004 1007 amdgpu_pm_put_access(adev); 1005 1008 1006 1009 return size; ··· 3905 3902 return ret; 3906 3903 3907 3904 ret = amdgpu_dpm_emit_clock_levels(adev, od_type, buf, &size); 3908 - if (ret) 3909 - return ret; 3905 + if (ret) { 3906 + size = ret; 3907 + goto out_pm_put; 3908 + } 3910 3909 if (size == 0) 3911 3910 size = sysfs_emit(buf, "\n"); 3912 3911 3912 + out_pm_put: 3913 3913 amdgpu_pm_put_access(adev); 3914 3914 3915 3915 return size;