Lines Matching full:policy

134 static int set_boost(struct cpufreq_policy *policy, int val)  in set_boost()  argument
136 on_each_cpu_mask(policy->cpus, boost_set_msr_each, in set_boost()
139 cpumask_pr_args(policy->cpus), str_enabled_disabled(val)); in set_boost()
144 static ssize_t show_freqdomain_cpus(struct cpufreq_policy *policy, char *buf) in show_freqdomain_cpus() argument
146 struct acpi_cpufreq_data *data = policy->driver_data; in show_freqdomain_cpus()
157 static ssize_t store_cpb(struct cpufreq_policy *policy, const char *buf, in store_cpb() argument
171 set_boost(policy, val); in store_cpb()
177 static ssize_t show_cpb(struct cpufreq_policy *policy, char *buf) in show_cpb() argument
199 static unsigned extract_io(struct cpufreq_policy *policy, u32 value) in extract_io() argument
201 struct acpi_cpufreq_data *data = policy->driver_data; in extract_io()
209 return policy->freq_table[i].frequency; in extract_io()
214 static unsigned extract_msr(struct cpufreq_policy *policy, u32 msr) in extract_msr() argument
216 struct acpi_cpufreq_data *data = policy->driver_data; in extract_msr()
229 cpufreq_for_each_entry(pos, policy->freq_table) in extract_msr()
232 return policy->freq_table[0].frequency; in extract_msr()
235 static unsigned extract_freq(struct cpufreq_policy *policy, u32 val) in extract_freq() argument
237 struct acpi_cpufreq_data *data = policy->driver_data; in extract_freq()
242 return extract_msr(policy, val); in extract_freq()
244 return extract_io(policy, val); in extract_freq()
368 struct cpufreq_policy *policy; in get_cur_freq_on_cpu() local
374 policy = cpufreq_cpu_get_raw(cpu); in get_cur_freq_on_cpu()
375 if (unlikely(!policy)) in get_cur_freq_on_cpu()
378 data = policy->driver_data; in get_cur_freq_on_cpu()
379 if (unlikely(!data || !policy->freq_table)) in get_cur_freq_on_cpu()
382 cached_freq = policy->freq_table[to_perf_data(data)->state].frequency; in get_cur_freq_on_cpu()
383 freq = extract_freq(policy, get_cur_val(cpumask_of(cpu), data)); in get_cur_freq_on_cpu()
397 static unsigned int check_freqs(struct cpufreq_policy *policy, in check_freqs() argument
400 struct acpi_cpufreq_data *data = policy->driver_data; in check_freqs()
405 cur_freq = extract_freq(policy, get_cur_val(mask, data)); in check_freqs()
413 static int acpi_cpufreq_target(struct cpufreq_policy *policy, in acpi_cpufreq_target() argument
416 struct acpi_cpufreq_data *data = policy->driver_data; in acpi_cpufreq_target()
427 next_perf_state = policy->freq_table[index].driver_data; in acpi_cpufreq_target()
442 * stopped, so we can rely on the stability of policy->cpus. in acpi_cpufreq_target()
444 mask = policy->shared_type == CPUFREQ_SHARED_TYPE_ANY ? in acpi_cpufreq_target()
445 cpumask_of(policy->cpu) : policy->cpus; in acpi_cpufreq_target()
450 if (!check_freqs(policy, mask, in acpi_cpufreq_target()
451 policy->freq_table[index].frequency)) { in acpi_cpufreq_target()
452 pr_debug("%s (%d)\n", __func__, policy->cpu); in acpi_cpufreq_target()
463 static unsigned int acpi_cpufreq_fast_switch(struct cpufreq_policy *policy, in acpi_cpufreq_fast_switch() argument
466 struct acpi_cpufreq_data *data = policy->driver_data; in acpi_cpufreq_fast_switch()
474 if (policy->cached_target_freq == target_freq) in acpi_cpufreq_fast_switch()
475 index = policy->cached_resolved_idx; in acpi_cpufreq_fast_switch()
477 index = cpufreq_table_find_index_dl(policy, target_freq, in acpi_cpufreq_fast_switch()
480 entry = &policy->freq_table[index]; in acpi_cpufreq_fast_switch()
674 static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) in acpi_cpufreq_cpu_init() argument
679 unsigned int cpu = policy->cpu; in acpi_cpufreq_cpu_init()
710 policy->driver_data = data; in acpi_cpufreq_cpu_init()
719 policy->shared_type = perf->shared_type; in acpi_cpufreq_cpu_init()
722 * Will let policy->cpus know about dependency only when software in acpi_cpufreq_cpu_init()
725 if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL || in acpi_cpufreq_cpu_init()
726 policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) { in acpi_cpufreq_cpu_init()
727 cpumask_copy(policy->cpus, perf->shared_cpu_map); in acpi_cpufreq_cpu_init()
733 if (bios_with_sw_any_bug && !policy_is_shared(policy)) { in acpi_cpufreq_cpu_init()
734 policy->shared_type = CPUFREQ_SHARED_TYPE_ALL; in acpi_cpufreq_cpu_init()
735 cpumask_copy(policy->cpus, topology_core_cpumask(cpu)); in acpi_cpufreq_cpu_init()
740 cpumask_clear(policy->cpus); in acpi_cpufreq_cpu_init()
741 cpumask_set_cpu(cpu, policy->cpus); in acpi_cpufreq_cpu_init()
744 policy->shared_type = CPUFREQ_SHARED_TYPE_HW; in acpi_cpufreq_cpu_init()
805 policy->cpuinfo.transition_latency = 0; in acpi_cpufreq_cpu_init()
808 policy->cpuinfo.transition_latency) in acpi_cpufreq_cpu_init()
809 policy->cpuinfo.transition_latency = in acpi_cpufreq_cpu_init()
815 policy->cpuinfo.transition_latency > 20 * 1000) { in acpi_cpufreq_cpu_init()
816 policy->cpuinfo.transition_latency = 20 * 1000; in acpi_cpufreq_cpu_init()
843 policy->cpuinfo.max_freq = freq * max_boost_ratio >> SCHED_CAPACITY_SHIFT; in acpi_cpufreq_cpu_init()
854 policy->freq_table = freq_table; in acpi_cpufreq_cpu_init()
860 * The core will not set policy->cur, because in acpi_cpufreq_cpu_init()
865 policy->cur = acpi_cpufreq_guess_freq(data, policy->cpu); in acpi_cpufreq_cpu_init()
891 policy->fast_switch_possible = !acpi_pstate_strict && in acpi_cpufreq_cpu_init()
892 !(policy_is_shared(policy) && policy->shared_type != CPUFREQ_SHARED_TYPE_ANY); in acpi_cpufreq_cpu_init()
898 set_boost(policy, acpi_cpufreq_driver.boost_enabled); in acpi_cpufreq_cpu_init()
899 policy->boost_enabled = acpi_cpufreq_driver.boost_enabled; in acpi_cpufreq_cpu_init()
910 policy->driver_data = NULL; in acpi_cpufreq_cpu_init()
915 static void acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy) in acpi_cpufreq_cpu_exit() argument
917 struct acpi_cpufreq_data *data = policy->driver_data; in acpi_cpufreq_cpu_exit()
921 cpufreq_boost_down_prep(policy->cpu); in acpi_cpufreq_cpu_exit()
922 policy->fast_switch_possible = false; in acpi_cpufreq_cpu_exit()
923 policy->driver_data = NULL; in acpi_cpufreq_cpu_exit()
926 kfree(policy->freq_table); in acpi_cpufreq_cpu_exit()
930 static int acpi_cpufreq_resume(struct cpufreq_policy *policy) in acpi_cpufreq_resume() argument
932 struct acpi_cpufreq_data *data = policy->driver_data; in acpi_cpufreq_resume()