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

Alex Deucher alexdeucher at gmail.com
Fri Apr 3 20:36:52 UTC 2020


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

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 at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list