Re: [PATCH 6/8] cpufreq: amd-pstate: Merge amd_pstate_highest_perf_set() into amd_get_boost_ratio_numerator()

kernel test robot
2024-08-27T21:32:20Z

Hi Mario,

kernel test robot noticed the following build warnings:

[auto build test WARNING on rafael-pm/linux-next]
[also build test WARNING on rafael-pm/bleeding-edge tip/x86/core tip/master linus/master v6.11-rc5 next-20240827]
[cannot apply to tip/auto-latest]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Mario-Limonciello/x86-amd-Move-amd_get_highest_perf-from-amd-c-to-cppc-c/20240827-051648
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
patch link: https://lore.kernel.org/r/20240826211358.2694603-7-superm1%40kernel.org
patch subject: [PATCH 6/8] cpufreq: amd-pstate: Merge amd_pstate_highest_perf_set() into amd_get_boost_ratio_numerator()
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20240828/202408280553.k4hXRtZy-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240828/202408280553.k4hXRtZy-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408280553.k4hXRtZy-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/cpufreq/amd-pstate.c:402:38: warning: variable 'highest_perf' is uninitialized when used here [-Wuninitialized]
402 | WRITE_ONCE(cpudata->max_limit_perf, highest_perf);
| ^~~~~~~~~~~~
include/asm-generic/rwonce.h:61:18: note: expanded from macro 'WRITE_ONCE'
61 | __WRITE_ONCE(x, val); \
| ^~~
include/asm-generic/rwonce.h:55:33: note: expanded from macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:395:18: note: initialize the variable 'highest_perf' to silence this warning
395 | u32 highest_perf;
| ^
| = 0
1 warning generated.

vim +/highest_perf +402 drivers/cpufreq/amd-pstate.c

ec437d71db77a1 Huang Rui 2021-12-24 391
e059c184da47e9 Huang Rui 2021-12-24 392 static int cppc_init_perf(struct amd_cpudata *cpudata)
e059c184da47e9 Huang Rui 2021-12-24 393 {
e059c184da47e9 Huang Rui 2021-12-24 394 struct cppc_perf_caps cppc_perf;
bedadcfb011fef Perry Yuan 2022-08-30 395 u32 highest_perf;
e059c184da47e9 Huang Rui 2021-12-24 396
e059c184da47e9 Huang Rui 2021-12-24 397 int ret = cppc_get_perf_caps(cpudata->cpu, &cppc_perf);
e059c184da47e9 Huang Rui 2021-12-24 398 if (ret)
e059c184da47e9 Huang Rui 2021-12-24 399 return ret;
e059c184da47e9 Huang Rui 2021-12-24 400
347b3754cc9780 Mario Limonciello 2024-08-26 401 WRITE_ONCE(cpudata->highest_perf, cppc_perf.highest_perf);
febab20caebac9 Wyes Karny 2023-11-17 @402 WRITE_ONCE(cpudata->max_limit_perf, highest_perf);
e059c184da47e9 Huang Rui 2021-12-24 403 WRITE_ONCE(cpudata->nominal_perf, cppc_perf.nominal_perf);
e059c184da47e9 Huang Rui 2021-12-24 404 WRITE_ONCE(cpudata->lowest_nonlinear_perf,
e059c184da47e9 Huang Rui 2021-12-24 405 cppc_perf.lowest_nonlinear_perf);
e059c184da47e9 Huang Rui 2021-12-24 406 WRITE_ONCE(cpudata->lowest_perf, cppc_perf.lowest_perf);
e571a5e2068ef5 Meng Li 2024-01-19 407 WRITE_ONCE(cpudata->prefcore_ranking, cppc_perf.highest_perf);
febab20caebac9 Wyes Karny 2023-11-17 408 WRITE_ONCE(cpudata->min_limit_perf, cppc_perf.lowest_perf);
e059c184da47e9 Huang Rui 2021-12-24 409
2dd6d0ebf74049 Wyes Karny 2023-03-07 410 if (cppc_state == AMD_PSTATE_ACTIVE)
2dd6d0ebf74049 Wyes Karny 2023-03-07 411 return 0;
2dd6d0ebf74049 Wyes Karny 2023-03-07 412
2dd6d0ebf74049 Wyes Karny 2023-03-07 413 ret = cppc_get_auto_sel_caps(cpudata->cpu, &cppc_perf);
2dd6d0ebf74049 Wyes Karny 2023-03-07 414 if (ret) {
2dd6d0ebf74049 Wyes Karny 2023-03-07 415 pr_warn("failed to get auto_sel, ret: %d\n", ret);
e059c184da47e9 Huang Rui 2021-12-24 416 return 0;
e059c184da47e9 Huang Rui 2021-12-24 417 }
e059c184da47e9 Huang Rui 2021-12-24 418
2dd6d0ebf74049 Wyes Karny 2023-03-07 419 ret = cppc_set_auto_sel(cpudata->cpu,
2dd6d0ebf74049 Wyes Karny 2023-03-07 420 (cppc_state == AMD_PSTATE_PASSIVE) ? 0 : 1);
2dd6d0ebf74049 Wyes Karny 2023-03-07 421
2dd6d0ebf74049 Wyes Karny 2023-03-07 422 if (ret)
2dd6d0ebf74049 Wyes Karny 2023-03-07 423 pr_warn("failed to set auto_sel, ret: %d\n", ret);
2dd6d0ebf74049 Wyes Karny 2023-03-07 424
2dd6d0ebf74049 Wyes Karny 2023-03-07 425 return ret;
2dd6d0ebf74049 Wyes Karny 2023-03-07 426 }
2dd6d0ebf74049 Wyes Karny 2023-03-07 427

--
0-DAY CI Kernel Test Service