diff mbox series

[4/4] cpufreq: intel_pstate: Use the acpi_pm_profile_server() symbol

Message ID 20230605151133.2615-5-mario.limonciello@amd.com
State New
Headers show
Series Enable amd-pstate active mode by default | expand

Commit Message

Mario Limonciello June 5, 2023, 3:11 p.m. UTC
Avoid duplication of functionality by using the generic symbol.
This does have a functional change that intel-pstate will now
match "SOHO server" as well.

Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/cpufreq/intel_pstate.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

Comments

kernel test robot June 13, 2023, 10:09 a.m. UTC | #1
Hi Mario,

kernel test robot noticed the following build errors:

[auto build test ERROR on rafael-pm/linux-next]
[also build test ERROR on linus/master v6.4-rc6 next-20230613]
[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/ACPI-CPPC-Add-a-symbol-to-check-if-the-preferred-profile-is-a-server/20230605-231602
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
patch link:    https://lore.kernel.org/r/20230605151133.2615-5-mario.limonciello%40amd.com
patch subject: [PATCH 4/4] cpufreq: intel_pstate: Use the acpi_pm_profile_server() symbol
config: i386-buildonly-randconfig-r006-20230612 (https://download.01.org/0day-ci/archive/20230613/202306131736.HZQ9caR6-lkp@intel.com/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project.git 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce (this is a W=1 build):
        mkdir -p ~/bin
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git remote add rafael-pm https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
        git fetch rafael-pm linux-next
        git checkout rafael-pm/linux-next
        b4 shazam https://lore.kernel.org/r/20230605151133.2615-5-mario.limonciello@amd.com
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=i386 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/cpufreq/

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/202306131736.HZQ9caR6-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/cpufreq/intel_pstate.c:2397:8: error: call to undeclared function 'acpi_pm_profile_server'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
                           if (acpi_pm_profile_server())
                               ^
   1 error generated.


vim +/acpi_pm_profile_server +2397 drivers/cpufreq/intel_pstate.c

  2376	
  2377	static int intel_pstate_init_cpu(unsigned int cpunum)
  2378	{
  2379		struct cpudata *cpu;
  2380	
  2381		cpu = all_cpu_data[cpunum];
  2382	
  2383		if (!cpu) {
  2384			cpu = kzalloc(sizeof(*cpu), GFP_KERNEL);
  2385			if (!cpu)
  2386				return -ENOMEM;
  2387	
  2388			WRITE_ONCE(all_cpu_data[cpunum], cpu);
  2389	
  2390			cpu->cpu = cpunum;
  2391	
  2392			cpu->epp_default = -EINVAL;
  2393	
  2394			if (hwp_active) {
  2395				intel_pstate_hwp_enable(cpu);
  2396	
> 2397				if (acpi_pm_profile_server())
  2398					hwp_boost = true;
  2399			}
  2400		} else if (hwp_active) {
  2401			/*
  2402			 * Re-enable HWP in case this happens after a resume from ACPI
  2403			 * S3 if the CPU was offline during the whole system/resume
  2404			 * cycle.
  2405			 */
  2406			intel_pstate_hwp_reenable(cpu);
  2407		}
  2408	
  2409		cpu->epp_powersave = -EINVAL;
  2410		cpu->epp_policy = 0;
  2411	
  2412		intel_pstate_get_cpu_pstates(cpu);
  2413	
  2414		pr_debug("controlling: cpu %d\n", cpunum);
  2415	
  2416		return 0;
  2417	}
  2418
diff mbox series

Patch

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 2548ec92faa2..3a36c0169d82 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -313,18 +313,9 @@  static DEFINE_MUTEX(intel_pstate_limits_lock);
 
 #ifdef CONFIG_ACPI
 
-static bool intel_pstate_acpi_pm_profile_server(void)
-{
-	if (acpi_gbl_FADT.preferred_profile == PM_ENTERPRISE_SERVER ||
-	    acpi_gbl_FADT.preferred_profile == PM_PERFORMANCE_SERVER)
-		return true;
-
-	return false;
-}
-
 static bool intel_pstate_get_ppc_enable_status(void)
 {
-	if (intel_pstate_acpi_pm_profile_server())
+	if (acpi_pm_profile_server())
 		return true;
 
 	return acpi_ppc;
@@ -481,10 +472,6 @@  static inline void intel_pstate_exit_perf_limits(struct cpufreq_policy *policy)
 {
 }
 
-static inline bool intel_pstate_acpi_pm_profile_server(void)
-{
-	return false;
-}
 #endif /* CONFIG_ACPI */
 
 #ifndef CONFIG_ACPI_CPPC_LIB
@@ -2407,7 +2394,7 @@  static int intel_pstate_init_cpu(unsigned int cpunum)
 		if (hwp_active) {
 			intel_pstate_hwp_enable(cpu);
 
-			if (intel_pstate_acpi_pm_profile_server())
+			if (acpi_pm_profile_server())
 				hwp_boost = true;
 		}
 	} else if (hwp_active) {