summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
diff options
context:
space:
mode:
authorEvan Quan <evan.quan@amd.com>2020-07-14 14:25:39 +0800
committerAlex Deucher <alexander.deucher@amd.com>2020-07-27 16:22:37 -0400
commit81b41ff5d287bc2346ee7ffb544ace3557f05642 (patch)
tree0b356cf2f6fb69ddcbea29b1e27d7baff8189d0c /drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
parent1df67a4ecedd34046a867afa6b29c12baf03cd25 (diff)
drm/amd/powerplay: revise the outputs layout of amdgpu_pm_info debugfs
The current outputs of amdgpu_pm_info debugfs come with clock gating status and followed by current clock/power information. However the clock gating status retrieving may pull GFX out of CG status. That will make the succeeding clock/power information retrieving inaccurate. To overcome this and be with minimum impact, the outputs are updated to show current clock/power information first. Signed-off-by: Evan Quan <evan.quan@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index 2f7b0550ff16..581b2d6bea3b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -4131,14 +4131,6 @@ static int amdgpu_debugfs_pm_info(struct seq_file *m, void *data)
return r;
}
- down_read(&adev->reset_sem);
- amdgpu_device_ip_get_clockgating_state(adev, &flags);
- up_read(&adev->reset_sem);
-
- seq_printf(m, "Clock Gating Flags Mask: 0x%x\n", flags);
- amdgpu_parse_cg_state(m, flags);
- seq_printf(m, "\n");
-
if (!adev->pm.dpm_enabled) {
seq_printf(m, "dpm not enabled\n");
pm_runtime_mark_last_busy(dev->dev);
@@ -4160,7 +4152,18 @@ static int amdgpu_debugfs_pm_info(struct seq_file *m, void *data)
r = amdgpu_debugfs_pm_info_pp(m, adev);
}
up_read(&adev->reset_sem);
+ if (r)
+ goto out;
+
+ down_read(&adev->reset_sem);
+ amdgpu_device_ip_get_clockgating_state(adev, &flags);
+ up_read(&adev->reset_sem);
+
+ seq_printf(m, "Clock Gating Flags Mask: 0x%x\n", flags);
+ amdgpu_parse_cg_state(m, flags);
+ seq_printf(m, "\n");
+out:
pm_runtime_mark_last_busy(dev->dev);
pm_runtime_put_autosuspend(dev->dev);