Lines Matching refs:policy
236 unsigned int policy; member
399 static void intel_pstate_init_acpi_perf_limits(struct cpufreq_policy *policy) in intel_pstate_init_acpi_perf_limits() argument
406 intel_pstate_set_itmt_prio(policy->cpu); in intel_pstate_init_acpi_perf_limits()
413 cpu = all_cpu_data[policy->cpu]; in intel_pstate_init_acpi_perf_limits()
416 policy->cpu); in intel_pstate_init_acpi_perf_limits()
436 pr_debug("CPU%u - ACPI _PSS perf data\n", policy->cpu); in intel_pstate_init_acpi_perf_limits()
458 policy->cpuinfo.max_freq / 1000; in intel_pstate_init_acpi_perf_limits()
466 acpi_processor_unregister_performance(policy->cpu); in intel_pstate_init_acpi_perf_limits()
469 static void intel_pstate_exit_perf_limits(struct cpufreq_policy *policy) in intel_pstate_exit_perf_limits() argument
473 cpu = all_cpu_data[policy->cpu]; in intel_pstate_exit_perf_limits()
477 acpi_processor_unregister_performance(policy->cpu); in intel_pstate_exit_perf_limits()
480 static inline void intel_pstate_init_acpi_perf_limits(struct cpufreq_policy *policy) in intel_pstate_init_acpi_perf_limits() argument
484 static inline void intel_pstate_exit_perf_limits(struct cpufreq_policy *policy) in intel_pstate_exit_perf_limits() argument
677 struct cpufreq_policy *policy, char *buf) in show_energy_performance_available_preferences() argument
693 struct cpufreq_policy *policy, const char *buf, size_t count) in store_energy_performance_preference() argument
695 struct cpudata *cpu_data = all_cpu_data[policy->cpu]; in store_energy_performance_preference()
712 struct cpufreq_policy *policy, char *buf) in show_energy_performance_preference() argument
714 struct cpudata *cpu_data = all_cpu_data[policy->cpu]; in show_energy_performance_preference()
726 static ssize_t show_base_frequency(struct cpufreq_policy *policy, char *buf) in show_base_frequency() argument
732 ratio = intel_pstate_get_cppc_guranteed(policy->cpu); in show_base_frequency()
734 rdmsrl_on_cpu(policy->cpu, MSR_HWP_CAPABILITIES, &cap); in show_base_frequency()
738 cpu = all_cpu_data[policy->cpu]; in show_base_frequency()
777 if (cpu_data->policy == CPUFREQ_POLICY_PERFORMANCE) in intel_pstate_hwp_set()
788 if (cpu_data->epp_policy == cpu_data->policy) in intel_pstate_hwp_set()
791 cpu_data->epp_policy = cpu_data->policy; in intel_pstate_hwp_set()
799 if (cpu_data->policy == CPUFREQ_POLICY_PERFORMANCE) { in intel_pstate_hwp_set()
857 static int intel_pstate_hwp_save_state(struct cpufreq_policy *policy) in intel_pstate_hwp_save_state() argument
859 struct cpudata *cpu_data = all_cpu_data[policy->cpu]; in intel_pstate_hwp_save_state()
871 static int intel_pstate_resume(struct cpufreq_policy *policy) in intel_pstate_resume() argument
878 if (policy->cpu == 0) in intel_pstate_resume()
879 intel_pstate_hwp_enable(all_cpu_data[policy->cpu]); in intel_pstate_resume()
881 all_cpu_data[policy->cpu]->epp_policy = 0; in intel_pstate_resume()
882 intel_pstate_hwp_set(policy->cpu); in intel_pstate_resume()
899 struct cpufreq_policy *policy = cpufreq_cpu_acquire(cpu); in intel_pstate_update_max_freq() local
902 if (!policy) in intel_pstate_update_max_freq()
906 policy->cpuinfo.max_freq = global.turbo_disabled_mf ? in intel_pstate_update_max_freq()
909 refresh_frequency_limits(policy); in intel_pstate_update_max_freq()
911 cpufreq_cpu_release(policy); in intel_pstate_update_max_freq()
1093 struct cpufreq_policy *policy; in update_qos_request() local
1098 policy = cpufreq_cpu_get(i); in update_qos_request()
1099 if (!policy) in update_qos_request()
1102 req = policy->driver_data; in update_qos_request()
1103 cpufreq_cpu_put(policy); in update_qos_request()
1911 #define ICPU(model, policy) \ argument
1913 (unsigned long)&policy }
2039 static void intel_pstate_update_perf_limits(struct cpufreq_policy *policy, in intel_pstate_update_perf_limits() argument
2059 max_policy_perf = max_state * policy->max / max_freq; in intel_pstate_update_perf_limits()
2060 if (policy->max == policy->min) { in intel_pstate_update_perf_limits()
2063 min_policy_perf = max_state * policy->min / max_freq; in intel_pstate_update_perf_limits()
2069 policy->cpu, max_state, in intel_pstate_update_perf_limits()
2084 pr_debug("cpu:%d global_min:%d global_max:%d\n", policy->cpu, in intel_pstate_update_perf_limits()
2097 pr_debug("cpu:%d max_perf_ratio:%d min_perf_ratio:%d\n", policy->cpu, in intel_pstate_update_perf_limits()
2102 static int intel_pstate_set_policy(struct cpufreq_policy *policy) in intel_pstate_set_policy() argument
2106 if (!policy->cpuinfo.max_freq) in intel_pstate_set_policy()
2110 policy->cpuinfo.max_freq, policy->max); in intel_pstate_set_policy()
2112 cpu = all_cpu_data[policy->cpu]; in intel_pstate_set_policy()
2113 cpu->policy = policy->policy; in intel_pstate_set_policy()
2117 intel_pstate_update_perf_limits(policy, cpu); in intel_pstate_set_policy()
2119 if (cpu->policy == CPUFREQ_POLICY_PERFORMANCE) { in intel_pstate_set_policy()
2124 intel_pstate_clear_update_util_hook(policy->cpu); in intel_pstate_set_policy()
2127 intel_pstate_set_update_util_hook(policy->cpu); in intel_pstate_set_policy()
2137 intel_pstate_clear_update_util_hook(policy->cpu); in intel_pstate_set_policy()
2138 intel_pstate_hwp_set(policy->cpu); in intel_pstate_set_policy()
2146 static void intel_pstate_adjust_policy_max(struct cpufreq_policy *policy, in intel_pstate_adjust_policy_max() argument
2151 policy->max < policy->cpuinfo.max_freq && in intel_pstate_adjust_policy_max()
2152 policy->max > cpu->pstate.max_freq) { in intel_pstate_adjust_policy_max()
2154 policy->max = policy->cpuinfo.max_freq; in intel_pstate_adjust_policy_max()
2158 static int intel_pstate_verify_policy(struct cpufreq_policy *policy) in intel_pstate_verify_policy() argument
2160 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_pstate_verify_policy()
2163 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, in intel_pstate_verify_policy()
2166 if (policy->policy != CPUFREQ_POLICY_POWERSAVE && in intel_pstate_verify_policy()
2167 policy->policy != CPUFREQ_POLICY_PERFORMANCE) in intel_pstate_verify_policy()
2170 intel_pstate_adjust_policy_max(policy, cpu); in intel_pstate_verify_policy()
2175 static void intel_cpufreq_stop_cpu(struct cpufreq_policy *policy) in intel_cpufreq_stop_cpu() argument
2177 intel_pstate_set_min_pstate(all_cpu_data[policy->cpu]); in intel_cpufreq_stop_cpu()
2180 static void intel_pstate_stop_cpu(struct cpufreq_policy *policy) in intel_pstate_stop_cpu() argument
2182 pr_debug("CPU %d exiting\n", policy->cpu); in intel_pstate_stop_cpu()
2184 intel_pstate_clear_update_util_hook(policy->cpu); in intel_pstate_stop_cpu()
2186 intel_pstate_hwp_save_state(policy); in intel_pstate_stop_cpu()
2187 intel_pstate_hwp_force_min_perf(policy->cpu); in intel_pstate_stop_cpu()
2189 intel_cpufreq_stop_cpu(policy); in intel_pstate_stop_cpu()
2193 static int intel_pstate_cpu_exit(struct cpufreq_policy *policy) in intel_pstate_cpu_exit() argument
2195 intel_pstate_exit_perf_limits(policy); in intel_pstate_cpu_exit()
2197 policy->fast_switch_possible = false; in intel_pstate_cpu_exit()
2202 static int __intel_pstate_cpu_init(struct cpufreq_policy *policy) in __intel_pstate_cpu_init() argument
2207 rc = intel_pstate_init_cpu(policy->cpu); in __intel_pstate_cpu_init()
2211 cpu = all_cpu_data[policy->cpu]; in __intel_pstate_cpu_init()
2216 policy->min = cpu->pstate.min_pstate * cpu->pstate.scaling; in __intel_pstate_cpu_init()
2217 policy->max = cpu->pstate.turbo_pstate * cpu->pstate.scaling; in __intel_pstate_cpu_init()
2220 policy->cpuinfo.min_freq = cpu->pstate.min_pstate * cpu->pstate.scaling; in __intel_pstate_cpu_init()
2223 policy->cpuinfo.max_freq = global.turbo_disabled ? in __intel_pstate_cpu_init()
2225 policy->cpuinfo.max_freq *= cpu->pstate.scaling; in __intel_pstate_cpu_init()
2232 if (max_freq < policy->cpuinfo.max_freq) in __intel_pstate_cpu_init()
2233 policy->cpuinfo.max_freq = max_freq; in __intel_pstate_cpu_init()
2236 intel_pstate_init_acpi_perf_limits(policy); in __intel_pstate_cpu_init()
2238 policy->fast_switch_possible = true; in __intel_pstate_cpu_init()
2243 static int intel_pstate_cpu_init(struct cpufreq_policy *policy) in intel_pstate_cpu_init() argument
2245 int ret = __intel_pstate_cpu_init(policy); in intel_pstate_cpu_init()
2251 policy->policy = CPUFREQ_POLICY_PERFORMANCE; in intel_pstate_cpu_init()
2253 policy->policy = CPUFREQ_POLICY_POWERSAVE; in intel_pstate_cpu_init()
2271 static int intel_cpufreq_verify_policy(struct cpufreq_policy *policy) in intel_cpufreq_verify_policy() argument
2273 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_verify_policy()
2276 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, in intel_cpufreq_verify_policy()
2279 intel_pstate_adjust_policy_max(policy, cpu); in intel_cpufreq_verify_policy()
2281 intel_pstate_update_perf_limits(policy, cpu); in intel_cpufreq_verify_policy()
2324 static int intel_cpufreq_target(struct cpufreq_policy *policy, in intel_cpufreq_target() argument
2328 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_target()
2334 freqs.old = policy->cur; in intel_cpufreq_target()
2337 cpufreq_freq_transition_begin(policy, &freqs); in intel_cpufreq_target()
2353 wrmsrl_on_cpu(policy->cpu, MSR_IA32_PERF_CTL, in intel_cpufreq_target()
2358 cpufreq_freq_transition_end(policy, &freqs, false); in intel_cpufreq_target()
2363 static unsigned int intel_cpufreq_fast_switch(struct cpufreq_policy *policy, in intel_cpufreq_fast_switch() argument
2366 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_fast_switch()
2379 static int intel_cpufreq_cpu_init(struct cpufreq_policy *policy) in intel_cpufreq_cpu_init() argument
2386 dev = get_cpu_device(policy->cpu); in intel_cpufreq_cpu_init()
2390 ret = __intel_pstate_cpu_init(policy); in intel_cpufreq_cpu_init()
2394 policy->cpuinfo.transition_latency = INTEL_CPUFREQ_TRANSITION_LATENCY; in intel_cpufreq_cpu_init()
2395 policy->transition_delay_us = INTEL_CPUFREQ_TRANSITION_DELAY; in intel_cpufreq_cpu_init()
2397 policy->cur = policy->cpuinfo.min_freq; in intel_cpufreq_cpu_init()
2405 cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_cpu_init()
2408 intel_pstate_get_hwp_max(policy->cpu, &turbo_max, &max_state); in intel_cpufreq_cpu_init()
2417 ret = freq_qos_add_request(&policy->constraints, req, FREQ_QOS_MIN, in intel_cpufreq_cpu_init()
2424 ret = freq_qos_add_request(&policy->constraints, req + 1, FREQ_QOS_MAX, in intel_cpufreq_cpu_init()
2431 policy->driver_data = req; in intel_cpufreq_cpu_init()
2440 intel_pstate_exit_perf_limits(policy); in intel_cpufreq_cpu_init()
2445 static int intel_cpufreq_cpu_exit(struct cpufreq_policy *policy) in intel_cpufreq_cpu_exit() argument
2449 req = policy->driver_data; in intel_cpufreq_cpu_exit()
2455 return intel_pstate_cpu_exit(policy); in intel_cpufreq_cpu_exit()