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:46:35 +0000 (12:46 -0500)
commit76a95b833ac75dfc62e8ca0d8acd337a683061f4
tree39e36da5b7cd50cbb382fc7d1d152c9f6b688caa
parent15504993a86d4aa078c8ac22537b7b295bee1a5f
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