]> git.itanic.dy.fi Git - linux-stable/commit
drm/amd/pm: parse pp_handle under appropriate conditions
authorGuchun Chen <guchun.chen@amd.com>
Fri, 5 May 2023 05:20:11 +0000 (13:20 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:53:50 +0000 (11:53 +0200)
commit17a69415679c6e0b55b390e86d59de82d7e53b9e
tree91f184631b21de0944716ed33db4488c1e0af57e
parent348dcdf102a44ab5b389c4cd932bc1a61e210f6d
drm/amd/pm: parse pp_handle under appropriate conditions

commit 58d9b9a14b47c2a3da6effcbb01607ad7edc0275 upstream.

amdgpu_dpm_is_overdrive_supported is a common API across all
asics, so we should cast pp_handle into correct structure
under different power frameworks.

v2: using return directly to simplify code
v3: SI asic does not carry od_enabled member in pp_handle, and update Fixes tag

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2541
Fixes: eb4900aa4c49 ("drm/amdgpu: Fix kernel NULL pointer dereference in dpm functions")
Suggested-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
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/pm/amdgpu_dpm.c