]> git.itanic.dy.fi Git - linux-stable/commit
drm/amd/pm: avoid potential UBSAN issue on legacy asics
authorGuchun Chen <guchun.chen@amd.com>
Tue, 9 May 2023 01:36:49 +0000 (09:36 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Jun 2023 13:36:34 +0000 (09:36 -0400)
commit936e95a461c2606ac2ffae3bb0d991e7081eafd8
treeba42687372976b44f4b49dbf2d5e350175a232ad
parenteb4f01784ec1d589629dd8c85044b7c07e5f6993
drm/amd/pm: avoid potential UBSAN issue on legacy asics

Prevent further dpm casting on legacy asics without od_enabled in
amdgpu_dpm_is_overdrive_supported. This can avoid UBSAN complain
in init sequence.

v2: add a macro to check legacy dpm instead of checking asic family/type
v3: refine macro name for naming consistency

Suggested-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/amdgpu_dpm.c