aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/ci_dpm.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2015-09-30 17:05:40 -0400
committerAlex Deucher <alexander.deucher@amd.com>2015-10-02 16:09:47 -0400
commitfa022a9b65d2886486a022fd66b20c823cd76ad9 (patch)
tree4d1db1f47b2c3284d614c4b27f04ac8e75115520 /drivers/gpu/drm/amd/amdgpu/ci_dpm.c
parent51a4726b04e880fdd9b4e0e58b13f70b0a68a7f5 (diff)
drm/amdgpu: add pm sysfs files late
They were added relatively early in the driver init process which meant that in some cases the driver was not finished initializing before external tools tried to use them which could result in a crash depending on the timing. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/ci_dpm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/ci_dpm.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/ci_dpm.c b/drivers/gpu/drm/amd/amdgpu/ci_dpm.c
index 82e8d0730517..a1a35a5df8e7 100644
--- a/drivers/gpu/drm/amd/amdgpu/ci_dpm.c
+++ b/drivers/gpu/drm/amd/amdgpu/ci_dpm.c
@@ -6185,6 +6185,11 @@ static int ci_dpm_late_init(void *handle)
6185 if (!amdgpu_dpm) 6185 if (!amdgpu_dpm)
6186 return 0; 6186 return 0;
6187 6187
6188 /* init the sysfs and debugfs files late */
6189 ret = amdgpu_pm_sysfs_init(adev);
6190 if (ret)
6191 return ret;
6192
6188 ret = ci_set_temperature_range(adev); 6193 ret = ci_set_temperature_range(adev);
6189 if (ret) 6194 if (ret)
6190 return ret; 6195 return ret;
@@ -6232,9 +6237,6 @@ static int ci_dpm_sw_init(void *handle)
6232 adev->pm.dpm.current_ps = adev->pm.dpm.requested_ps = adev->pm.dpm.boot_ps; 6237 adev->pm.dpm.current_ps = adev->pm.dpm.requested_ps = adev->pm.dpm.boot_ps;
6233 if (amdgpu_dpm == 1) 6238 if (amdgpu_dpm == 1)
6234 amdgpu_pm_print_power_states(adev); 6239 amdgpu_pm_print_power_states(adev);
6235 ret = amdgpu_pm_sysfs_init(adev);
6236 if (ret)
6237 goto dpm_failed;
6238 mutex_unlock(&adev->pm.mutex); 6240 mutex_unlock(&adev->pm.mutex);
6239 DRM_INFO("amdgpu: dpm initialized\n"); 6241 DRM_INFO("amdgpu: dpm initialized\n");
6240 6242