drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_7_ppt.c:1326:12: warning: stack frame size (1040) exceeds limit (1024) in 'smu_v13_0_7_get_power_profile_mode'

From: kernel test robot
Date: Sat May 28 2022 - 03:43:03 EST


Hi Kenneth,

FYI, the error/warning still remains.

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9d004b2f4fea97cde123e7f1939b80e77bf2e695
commit: 334682ae81513638aa49da9615c2c0054a711ed4 drm/amd/pm: enable workload type change on smu_v13_0_7
date: 3 weeks ago
config: riscv-randconfig-r026-20220527 (https://download.01.org/0day-ci/archive/20220528/202205281546.8st5p4J7-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 134d7f9a4b97e9035150d970bd9e376043c4577e)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=334682ae81513638aa49da9615c2c0054a711ed4
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 334682ae81513638aa49da9615c2c0054a711ed4
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/gpu/drm/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_7_ppt.c:294:5: warning: no previous prototype for function 'smu_v13_0_7_check_fw_status' [-Wmissing-prototypes]
int smu_v13_0_7_check_fw_status(struct smu_context *smu) {
^
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_7_ppt.c:294:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int smu_v13_0_7_check_fw_status(struct smu_context *smu) {
^
static
>> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_7_ppt.c:1326:12: warning: stack frame size (1040) exceeds limit (1024) in 'smu_v13_0_7_get_power_profile_mode' [-Wframe-larger-than]
static int smu_v13_0_7_get_power_profile_mode(struct smu_context *smu, char *buf)
^
2 warnings generated.


vim +/smu_v13_0_7_get_power_profile_mode +1326 drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_7_ppt.c

1325
> 1326 static int smu_v13_0_7_get_power_profile_mode(struct smu_context *smu, char *buf)
1327 {
1328 DpmActivityMonitorCoeffIntExternal_t activity_monitor_external[PP_SMC_POWER_PROFILE_COUNT];
1329 uint32_t i, j, size = 0;
1330 int16_t workload_type = 0;
1331 int result = 0;
1332
1333 if (!buf)
1334 return -EINVAL;
1335
1336 size += sysfs_emit_at(buf, size, " ");
1337 for (i = 0; i <= PP_SMC_POWER_PROFILE_WINDOW3D; i++)
1338 size += sysfs_emit_at(buf, size, "%-14s%s", amdgpu_pp_profile_name[i],
1339 (i == smu->power_profile_mode) ? "* " : " ");
1340
1341 size += sysfs_emit_at(buf, size, "\n");
1342
1343 for (i = 0; i <= PP_SMC_POWER_PROFILE_WINDOW3D; i++) {
1344 /* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */
1345 workload_type = smu_cmn_to_asic_specific_index(smu,
1346 CMN2ASIC_MAPPING_WORKLOAD,
1347 i);
1348 if (workload_type < 0)
1349 return -EINVAL;
1350
1351 result = smu_cmn_update_table(smu,
1352 SMU_TABLE_ACTIVITY_MONITOR_COEFF, workload_type,
1353 (void *)(&activity_monitor_external[i]), false);
1354 if (result) {
1355 dev_err(smu->adev->dev, "[%s] Failed to get activity monitor!", __func__);
1356 return result;
1357 }
1358 }
1359

--
0-DAY CI Kernel Test Service
https://01.org/lkp