Re: [PATCH] drm/amdgpu: Fix oops when pp_funcs is unset in ACPI event

From: Alex Deucher
Date: Fri Apr 03 2020 - 16:37:09 EST


On Fri, Apr 3, 2020 at 11:18 AM Aaron Ma <aaron.ma@xxxxxxxxxxxxx> wrote:
>
> 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@xxxxxxxxxxxxx>

Applied. Thanks!

Alex


> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> index f197f1be0969..611de69f9d48 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> @@ -89,7 +89,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);
>
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx