]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
drm/amd/pm: avoid large variable on kernel stack
authorArnd Bergmann <arnd@arndb.de>
Thu, 15 Dec 2022 16:36:31 +0000 (17:36 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 20 Dec 2022 17:59:34 +0000 (12:59 -0500)
commitd118b18fb1da02b41df2da78cb2794b3638d89cd
tree9fd8b1525bde501edfa3614ba872f5994e8a14b9
parent1a799c4c190ea9f0e81028e3eb3037ed0ab17ff5
drm/amd/pm: avoid large variable on kernel stack

The activity_monitor_external[] array is too big to fit on the
kernel stack, resulting in this warning with clang:

drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_7_ppt.c:1438:12: error: stack frame size (1040) exceeds limit (1024) in 'smu_v13_0_7_get_power_profile_mode' [-Werror,-Wframe-larger-than]

Use dynamic allocation instead. It should also be possible to
have single element here instead of the array, but this seems
easier.

v2: fix up argument to sizeof() (Alex)

Fixes: 334682ae8151 ("drm/amd/pm: enable workload type change on smu_v13_0_7")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c