瀏覽代碼

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>
Alex Deucher 10 年之前
父節點
當前提交
898b1dead9
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c

+ 4 - 1
drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c

@@ -131,6 +131,10 @@ static int amdgpu_pp_late_init(void *handle)
 		ret = adev->powerplay.ip_funcs->late_init(
 		ret = adev->powerplay.ip_funcs->late_init(
 					adev->powerplay.pp_handle);
 					adev->powerplay.pp_handle);
 
 
+#ifdef CONFIG_DRM_AMD_POWERPLAY
+	if (adev->pp_enabled)
+		amdgpu_pm_sysfs_init(adev);
+#endif
 	return ret;
 	return ret;
 }
 }
 
 
@@ -145,7 +149,6 @@ static int amdgpu_pp_sw_init(void *handle)
 
 
 #ifdef CONFIG_DRM_AMD_POWERPLAY
 #ifdef CONFIG_DRM_AMD_POWERPLAY
 	if (adev->pp_enabled) {
 	if (adev->pp_enabled) {
-		amdgpu_pm_sysfs_init(adev);
 		if (amdgpu_dpm == 0)
 		if (amdgpu_dpm == 0)
 			adev->pm.dpm_enabled = false;
 			adev->pm.dpm_enabled = false;
 		else
 		else