]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amdgpu: fix kernel panic when dpm disabled on Kv.
authorRex Zhu <Rex.Zhu@amd.com>
Fri, 20 Jan 2017 06:30:51 +0000 (14:30 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 27 Jan 2017 17:20:44 +0000 (12:20 -0500)
Return early if it's disabled.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/kv_dpm.c

index 6b6476dae9706a4d3dcd641b79a85f149304b945..8785ca570729826a3647ec697d8f6949e1ef9fa1 100644 (file)
@@ -3079,6 +3079,9 @@ static int kv_dpm_hw_init(void *handle)
        int ret;
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+       if (!amdgpu_dpm)
+               return 0;
+
        mutex_lock(&adev->pm.mutex);
        kv_dpm_setup_asic(adev);
        ret = kv_dpm_enable(adev);