drm/amdgpu: Fix oops when pp_funcs->switch_power_profile is unset
authorFelix Kuehling <Felix.Kuehling@amd.com>
Fri, 20 Jul 2018 15:37:25 +0000 (11:37 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Dec 2018 08:37:28 +0000 (09:37 +0100)
commite3290a5e24df81bf2cdb603f0a897725d3eb3ea5
tree20c61542eb7a22811ae4994d58e81f1c7f2a4039
parentd9ea911e2b90478b29fd6b2325723099a55f6171
drm/amdgpu: Fix oops when pp_funcs->switch_power_profile is unset

commit 919a52fc4ca137c871f295224507fa3401e08472 upstream.

On Vega20 and other pre-production GPUs, powerplay is not enabled yet.
Check for NULL pointers before calling pp_funcs function pointers.

Also affects Kaveri.

CC: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Tested-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c