Message ID | b2c8fb2da41f9fb21f095f67d99cbdbd0aa34091.1716356681.git.Xiaojian.Du@amd.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
Series | [v2,1/2] x86/cpufeatures: Add AMD FAST CPPC feature flag | expand |
Hi Xiaojian,
kernel test robot noticed the following build warnings:
[auto build test WARNING on tip/master]
[also build test WARNING on rafael-pm/linux-next rafael-pm/bleeding-edge linus/master next-20240522]
[cannot apply to tip/x86/core tip/auto-latest v6.9]
[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/Xiaojian-Du/cpufreq-amd-pstate-change-cpu-freq-transition-delay-for-some-models/20240522-135241
base: tip/master
patch link: https://lore.kernel.org/r/b2c8fb2da41f9fb21f095f67d99cbdbd0aa34091.1716356681.git.Xiaojian.Du%40amd.com
patch subject: [PATCH v2 2/2] cpufreq: amd-pstate: change cpu freq transition delay for some models
config: x86_64-defconfig (https://download.01.org/0day-ci/archive/20240523/202405230126.Ww25ogId-lkp@intel.com/config)
compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240523/202405230126.Ww25ogId-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/202405230126.Ww25ogId-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/cpufreq/amd-pstate.c: In function 'amd_pstate_get_transition_delay_us':
>> drivers/cpufreq/amd-pstate.c:821:12: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
821 | if (transition_delay_ns == CPUFREQ_ETERNAL)
| ^
vim +/else +821 drivers/cpufreq/amd-pstate.c
e571a5e2068ef5 Meng Li 2024-01-19 811
5131a3ca3518d7 Perry Yuan 2024-04-30 812 /*
069a2bb8c48c43 Perry Yuan 2024-04-25 813 * Get pstate transition delay time from ACPI tables that firmware set
069a2bb8c48c43 Perry Yuan 2024-04-25 814 * instead of using hardcode value directly.
069a2bb8c48c43 Perry Yuan 2024-04-25 815 */
069a2bb8c48c43 Perry Yuan 2024-04-25 816 static u32 amd_pstate_get_transition_delay_us(unsigned int cpu)
069a2bb8c48c43 Perry Yuan 2024-04-25 817 {
069a2bb8c48c43 Perry Yuan 2024-04-25 818 u32 transition_delay_ns;
069a2bb8c48c43 Perry Yuan 2024-04-25 819
069a2bb8c48c43 Perry Yuan 2024-04-25 820 transition_delay_ns = cppc_get_transition_latency(cpu);
069a2bb8c48c43 Perry Yuan 2024-04-25 @821 if (transition_delay_ns == CPUFREQ_ETERNAL)
be020c2c1f8622 Xiaojian Du 2024-05-22 822 if (cpu_feature_enabled(X86_FEATURE_FAST_CPPC))
be020c2c1f8622 Xiaojian Du 2024-05-22 823 return AMD_PSTATE_FAST_CPPC_TRANSITION_DELAY;
be020c2c1f8622 Xiaojian Du 2024-05-22 824 else
069a2bb8c48c43 Perry Yuan 2024-04-25 825 return AMD_PSTATE_TRANSITION_DELAY;
069a2bb8c48c43 Perry Yuan 2024-04-25 826
069a2bb8c48c43 Perry Yuan 2024-04-25 827 return transition_delay_ns / NSEC_PER_USEC;
069a2bb8c48c43 Perry Yuan 2024-04-25 828 }
069a2bb8c48c43 Perry Yuan 2024-04-25 829
Hi Xiaojian, kernel test robot noticed the following build warnings: [auto build test WARNING on tip/master] [also build test WARNING on rafael-pm/linux-next rafael-pm/bleeding-edge linus/master next-20240522] [cannot apply to tip/x86/core tip/auto-latest v6.9] [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/Xiaojian-Du/cpufreq-amd-pstate-change-cpu-freq-transition-delay-for-some-models/20240522-135241 base: tip/master patch link: https://lore.kernel.org/r/b2c8fb2da41f9fb21f095f67d99cbdbd0aa34091.1716356681.git.Xiaojian.Du%40amd.com patch subject: [PATCH v2 2/2] cpufreq: amd-pstate: change cpu freq transition delay for some models config: x86_64-randconfig-006-20240522 (https://download.01.org/0day-ci/archive/20240523/202405230325.UPlOikDm-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/20240523/202405230325.UPlOikDm-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/202405230325.UPlOikDm-lkp@intel.com/ All warnings (new ones prefixed by >>): >> drivers/cpufreq/amd-pstate.c:824:3: warning: add explicit braces to avoid dangling else [-Wdangling-else] 824 | else | ^ 1 warning generated. vim +824 drivers/cpufreq/amd-pstate.c 811 812 /* 813 * Get pstate transition delay time from ACPI tables that firmware set 814 * instead of using hardcode value directly. 815 */ 816 static u32 amd_pstate_get_transition_delay_us(unsigned int cpu) 817 { 818 u32 transition_delay_ns; 819 820 transition_delay_ns = cppc_get_transition_latency(cpu); 821 if (transition_delay_ns == CPUFREQ_ETERNAL) 822 if (cpu_feature_enabled(X86_FEATURE_FAST_CPPC)) 823 return AMD_PSTATE_FAST_CPPC_TRANSITION_DELAY; > 824 else 825 return AMD_PSTATE_TRANSITION_DELAY; 826 827 return transition_delay_ns / NSEC_PER_USEC; 828 } 829
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 6a342b0c0140..572064a7682f 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -50,6 +50,7 @@ #define AMD_PSTATE_TRANSITION_LATENCY 20000 #define AMD_PSTATE_TRANSITION_DELAY 1000 +#define AMD_PSTATE_FAST_CPPC_TRANSITION_DELAY 600 #define CPPC_HIGHEST_PERF_PERFORMANCE 196 #define CPPC_HIGHEST_PERF_DEFAULT 166 @@ -818,7 +819,10 @@ static u32 amd_pstate_get_transition_delay_us(unsigned int cpu) transition_delay_ns = cppc_get_transition_latency(cpu); if (transition_delay_ns == CPUFREQ_ETERNAL) - return AMD_PSTATE_TRANSITION_DELAY; + if (cpu_feature_enabled(X86_FEATURE_FAST_CPPC)) + return AMD_PSTATE_FAST_CPPC_TRANSITION_DELAY; + else + return AMD_PSTATE_TRANSITION_DELAY; return transition_delay_ns / NSEC_PER_USEC; }