Skip to content

Commit e3290a5

Browse files
fxkamdgregkh
authored andcommitted
drm/amdgpu: Fix oops when pp_funcs->switch_power_profile is unset
commit 919a52f 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>
1 parent d9ea911 commit e3290a5

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,11 @@ void amdgpu_amdkfd_set_compute_idle(struct kgd_dev *kgd, bool idle)
496496
{
497497
struct amdgpu_device *adev = (struct amdgpu_device *)kgd;
498498

499-
amdgpu_dpm_switch_power_profile(adev,
500-
PP_SMC_POWER_PROFILE_COMPUTE, !idle);
499+
if (adev->powerplay.pp_funcs &&
500+
adev->powerplay.pp_funcs->switch_power_profile)
501+
amdgpu_dpm_switch_power_profile(adev,
502+
PP_SMC_POWER_PROFILE_COMPUTE,
503+
!idle);
501504
}
502505

503506
bool amdgpu_amdkfd_is_kfd_vmid(struct amdgpu_device *adev, u32 vmid)

0 commit comments

Comments
 (0)