aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2015-12-08 17:28:28 -0500
committerAlex Deucher <alexander.deucher@amd.com>2015-12-21 16:42:51 -0500
commit898b1dead9a99aeeb103febacf838c7c71d58292 (patch)
tree2fd4fe5995140681d9ef945d1be8f09adfde4486 /drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
parent17c00a2fed1bcc80949e0e68607bcea6af3c5358 (diff)
drm/amdgpu/powerplay: enable sysfs and debugfs interfaces late
To avoid users accessing them before the module has finished initializing them and make sure they are only created if dpm has properly initialized. Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
index b8b4a4781f4d..ddb90ebd0e7c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
@@ -131,6 +131,10 @@ static int amdgpu_pp_late_init(void *handle)
131 ret = adev->powerplay.ip_funcs->late_init( 131 ret = adev->powerplay.ip_funcs->late_init(
132 adev->powerplay.pp_handle); 132 adev->powerplay.pp_handle);
133 133
134#ifdef CONFIG_DRM_AMD_POWERPLAY
135 if (adev->pp_enabled)
136 amdgpu_pm_sysfs_init(adev);
137#endif
134 return ret; 138 return ret;
135} 139}
136 140
@@ -145,7 +149,6 @@ static int amdgpu_pp_sw_init(void *handle)
145 149
146#ifdef CONFIG_DRM_AMD_POWERPLAY 150#ifdef CONFIG_DRM_AMD_POWERPLAY
147 if (adev->pp_enabled) { 151 if (adev->pp_enabled) {
148 amdgpu_pm_sysfs_init(adev);
149 if (amdgpu_dpm == 0) 152 if (amdgpu_dpm == 0)
150 adev->pm.dpm_enabled = false; 153 adev->pm.dpm_enabled = false;
151 else 154 else