Lines Matching refs:cpu
99 static unsigned int cppc_cpufreq_perf_to_khz(struct cppc_cpudata *cpu, in cppc_cpufreq_perf_to_khz() argument
103 struct cppc_perf_caps *caps = &cpu->perf_caps; in cppc_cpufreq_perf_to_khz()
123 static unsigned int cppc_cpufreq_khz_to_perf(struct cppc_cpudata *cpu, in cppc_cpufreq_khz_to_perf() argument
127 struct cppc_perf_caps *caps = &cpu->perf_caps; in cppc_cpufreq_khz_to_perf()
152 struct cppc_cpudata *cpu; in cppc_cpufreq_set_target() local
157 cpu = all_cpu_data[policy->cpu]; in cppc_cpufreq_set_target()
159 desired_perf = cppc_cpufreq_khz_to_perf(cpu, target_freq); in cppc_cpufreq_set_target()
161 if (desired_perf == cpu->perf_ctrls.desired_perf) in cppc_cpufreq_set_target()
164 cpu->perf_ctrls.desired_perf = desired_perf; in cppc_cpufreq_set_target()
169 ret = cppc_set_perf(cpu->cpu, &cpu->perf_ctrls); in cppc_cpufreq_set_target()
174 cpu->cpu, ret); in cppc_cpufreq_set_target()
187 int cpu_num = policy->cpu; in cppc_cpufreq_stop_cpu()
188 struct cppc_cpudata *cpu = all_cpu_data[cpu_num]; in cppc_cpufreq_stop_cpu() local
191 cpu->perf_ctrls.desired_perf = cpu->perf_caps.lowest_perf; in cppc_cpufreq_stop_cpu()
193 ret = cppc_set_perf(cpu_num, &cpu->perf_ctrls); in cppc_cpufreq_stop_cpu()
196 cpu->perf_caps.lowest_perf, cpu_num, ret); in cppc_cpufreq_stop_cpu()
208 static unsigned int cppc_cpufreq_get_transition_delay_us(int cpu) in cppc_cpufreq_get_transition_delay_us() argument
222 delay_us = cppc_get_transition_latency(cpu) / NSEC_PER_USEC; in cppc_cpufreq_get_transition_delay_us()
227 delay_us = cppc_get_transition_latency(cpu) / NSEC_PER_USEC; in cppc_cpufreq_get_transition_delay_us()
236 static unsigned int cppc_cpufreq_get_transition_delay_us(int cpu) in cppc_cpufreq_get_transition_delay_us() argument
238 return cppc_get_transition_latency(cpu) / NSEC_PER_USEC; in cppc_cpufreq_get_transition_delay_us()
244 struct cppc_cpudata *cpu; in cppc_cpufreq_cpu_init() local
245 unsigned int cpu_num = policy->cpu; in cppc_cpufreq_cpu_init()
248 cpu = all_cpu_data[policy->cpu]; in cppc_cpufreq_cpu_init()
250 cpu->cpu = cpu_num; in cppc_cpufreq_cpu_init()
251 ret = cppc_get_perf_caps(policy->cpu, &cpu->perf_caps); in cppc_cpufreq_cpu_init()
260 cpu->perf_caps.lowest_freq *= 1000; in cppc_cpufreq_cpu_init()
261 cpu->perf_caps.nominal_freq *= 1000; in cppc_cpufreq_cpu_init()
267 policy->min = cppc_cpufreq_perf_to_khz(cpu, cpu->perf_caps.lowest_nonlinear_perf); in cppc_cpufreq_cpu_init()
268 policy->max = cppc_cpufreq_perf_to_khz(cpu, cpu->perf_caps.nominal_perf); in cppc_cpufreq_cpu_init()
275 policy->cpuinfo.min_freq = cppc_cpufreq_perf_to_khz(cpu, cpu->perf_caps.lowest_perf); in cppc_cpufreq_cpu_init()
276 policy->cpuinfo.max_freq = cppc_cpufreq_perf_to_khz(cpu, cpu->perf_caps.nominal_perf); in cppc_cpufreq_cpu_init()
279 policy->shared_type = cpu->shared_type; in cppc_cpufreq_cpu_init()
284 cpumask_copy(policy->cpus, cpu->shared_cpu_map); in cppc_cpufreq_cpu_init()
287 if (unlikely(i == policy->cpu)) in cppc_cpufreq_cpu_init()
290 memcpy(&all_cpu_data[i]->perf_caps, &cpu->perf_caps, in cppc_cpufreq_cpu_init()
291 sizeof(cpu->perf_caps)); in cppc_cpufreq_cpu_init()
299 cpu->cur_policy = policy; in cppc_cpufreq_cpu_init()
305 if (cpu->perf_caps.highest_perf > cpu->perf_caps.nominal_perf) in cppc_cpufreq_cpu_init()
309 policy->cur = cppc_cpufreq_perf_to_khz(cpu, in cppc_cpufreq_cpu_init()
310 cpu->perf_caps.highest_perf); in cppc_cpufreq_cpu_init()
311 cpu->perf_ctrls.desired_perf = cpu->perf_caps.highest_perf; in cppc_cpufreq_cpu_init()
313 ret = cppc_set_perf(cpu_num, &cpu->perf_ctrls); in cppc_cpufreq_cpu_init()
316 cpu->perf_caps.highest_perf, cpu_num, ret); in cppc_cpufreq_cpu_init()
329 static int cppc_get_rate_from_fbctrs(struct cppc_cpudata *cpu, in cppc_get_rate_from_fbctrs() argument
348 delivered_perf = cpu->perf_ctrls.desired_perf; in cppc_get_rate_from_fbctrs()
350 return cppc_cpufreq_perf_to_khz(cpu, delivered_perf); in cppc_get_rate_from_fbctrs()
356 struct cppc_cpudata *cpu = all_cpu_data[cpunum]; in cppc_cpufreq_get_rate() local
369 return cppc_get_rate_from_fbctrs(cpu, fb_ctrs_t0, fb_ctrs_t1); in cppc_cpufreq_get_rate()
382 cpudata = all_cpu_data[policy->cpu]; in cppc_cpufreq_set_boost()
454 struct cppc_cpudata *cpu; in cppc_cpufreq_init() local
469 cpu = all_cpu_data[i]; in cppc_cpufreq_init()
470 if (!zalloc_cpumask_var(&cpu->shared_cpu_map, GFP_KERNEL)) in cppc_cpufreq_init()
490 cpu = all_cpu_data[i]; in cppc_cpufreq_init()
491 if (!cpu) in cppc_cpufreq_init()
493 free_cpumask_var(cpu->shared_cpu_map); in cppc_cpufreq_init()
494 kfree(cpu); in cppc_cpufreq_init()
503 struct cppc_cpudata *cpu; in cppc_cpufreq_exit() local
509 cpu = all_cpu_data[i]; in cppc_cpufreq_exit()
510 free_cpumask_var(cpu->shared_cpu_map); in cppc_cpufreq_exit()
511 kfree(cpu); in cppc_cpufreq_exit()