]> git.baikalelectronics.ru Git - kernel.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:33:07 +0000 (13:33 +0100)
commit37ff8115bb5dec355c042df2b8cff416d45ad7b6
tree181872981fb99ce4cd205128f83dea5ec291ef3e
parent48a8184172f9f3d4df154f7b9ba8d5ca6462d034
drm/amd/pm: avoid large variable on kernel stack

[ Upstream commit 1309797675328f6dffdd7009aeb09786e5fb585b ]

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: 39ca65ba8590 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c