Skip to content

Commit

Permalink
UBUNTU: SAUCE: drm/amdgpu: Fix oops when pp_funcs is unset in ACPI event
Browse files Browse the repository at this point in the history
BugLink: https://bugs.launchpad.net/bugs/1871316

On ARCTURUS and RENOIR, powerplay is not supported yet.
When plug in or unplug power jack, ACPI event will issue.
Then kernel NULL pointer BUG will be triggered.
Check for NULL pointers before calling.

Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 170dbbf
 git://people.freedesktop.org/~agd5f/linux drm-next)
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
  • Loading branch information
Aaron Ma authored and Timo Aaltonen committed Apr 15, 2020
1 parent 2583a34 commit f553700
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
Original file line number Diff line number Diff line change
@@ -91,7 +91,8 @@ void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev)
adev->pm.ac_power = true;
else
adev->pm.ac_power = false;
if (adev->powerplay.pp_funcs->enable_bapm)
if (adev->powerplay.pp_funcs &&
adev->powerplay.pp_funcs->enable_bapm)
amdgpu_dpm_enable_bapm(adev, adev->pm.ac_power);
mutex_unlock(&adev->pm.mutex);
}

0 comments on commit f553700

Please sign in to comment.