{}
};
+static bool pid_in_use(void);
+
static int intel_pstate_init_cpu(unsigned int cpunum)
{
struct cpudata *cpu;
intel_pstate_disable_ee(cpunum);
intel_pstate_hwp_enable(cpu);
- } else if (pstate_funcs.update_util == intel_pstate_update_util_pid) {
+ } else if (pid_in_use()) {
intel_pstate_pid_reset(cpu);
}
static struct cpufreq_driver *default_driver = &intel_pstate;
+static bool pid_in_use(void)
+{
+ return intel_pstate_driver == &intel_pstate &&
+ pstate_funcs.update_util == intel_pstate_update_util_pid;
+}
+
static void intel_pstate_driver_cleanup(void)
{
unsigned int cpu;
global.min_perf_pct = min_perf_pct_min();
- if (intel_pstate_driver == &intel_pstate && !hwp_active &&
- pstate_funcs.update_util == intel_pstate_update_util_pid)
+ if (pid_in_use())
intel_pstate_debug_expose_params();
return 0;
if (hwp_active)
return -EBUSY;
- if (intel_pstate_driver == &intel_pstate &&
- pstate_funcs.update_util == intel_pstate_update_util_pid)
+ if (pid_in_use())
intel_pstate_debug_hide_params();
cpufreq_unregister_driver(intel_pstate_driver);