]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
drm/amdgpu/powerplay: enable sysfs and debugfs interfaces late
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 8 Dec 2015 22:28:28 +0000 (17:28 -0500)
committerTim Gardner <tim.gardner@canonical.com>
Wed, 6 Apr 2016 09:25:23 +0000 (10:25 +0100)
BugLink: http://bugs.launchpad.net/bugs/1546572
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>
(cherry picked from commit 898b1dead9a99aeeb103febacf838c7c71d58292)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c

index 049e4a70ec9c122044d1a6fcdddfc7eaf8a8fe7a..c94a9a171118f8ce8e2200ef881fd97ff848afae 100644 (file)
@@ -130,6 +130,10 @@ static int amdgpu_pp_late_init(void *handle)
                ret = adev->powerplay.ip_funcs->late_init(
                                        adev->powerplay.pp_handle);
 
+#ifdef CONFIG_DRM_AMD_POWERPLAY
+       if (adev->pp_enabled)
+               amdgpu_pm_sysfs_init(adev);
+#endif
        return ret;
 }
 
@@ -144,7 +148,6 @@ static int amdgpu_pp_sw_init(void *handle)
 
 #ifdef CONFIG_DRM_AMD_POWERPLAY
        if (adev->pp_enabled) {
-               amdgpu_pm_sysfs_init(adev);
                if (amdgpu_dpm == 0)
                        adev->pm.dpm_enabled = false;
                else