Lines Matching full:pr

52 static int acpi_processor_get_platform_limit(struct acpi_processor *pr)  in acpi_processor_get_platform_limit()  argument
60 if (!pr) in acpi_processor_get_platform_limit()
67 status = acpi_evaluate_integer(pr->handle, "_PPC", NULL, &ppc); in acpi_processor_get_platform_limit()
72 acpi_evaluation_failure_warn(pr->handle, "_PPC", status); in acpi_processor_get_platform_limit()
79 if (pr->performance_platform_limit == index || in acpi_processor_get_platform_limit()
80 ppc >= pr->performance->state_count) in acpi_processor_get_platform_limit()
83 pr_debug("CPU %d: _PPC is %d - frequency %s limited\n", pr->id, in acpi_processor_get_platform_limit()
86 pr->performance_platform_limit = index; in acpi_processor_get_platform_limit()
88 if (unlikely(!freq_qos_request_active(&pr->perflib_req))) in acpi_processor_get_platform_limit()
98 qos_value = pr->performance->states[index].core_frequency * 1000; in acpi_processor_get_platform_limit()
100 ret = freq_qos_update_request(&pr->perflib_req, qos_value); in acpi_processor_get_platform_limit()
103 pr->id, ret); in acpi_processor_get_platform_limit()
124 void acpi_processor_ppc_has_changed(struct acpi_processor *pr, int event_flag) in acpi_processor_ppc_has_changed() argument
128 if (ignore_ppc || !pr->performance) { in acpi_processor_ppc_has_changed()
134 acpi_processor_ppc_ost(pr->handle, 1); in acpi_processor_ppc_has_changed()
138 ret = acpi_processor_get_platform_limit(pr); in acpi_processor_ppc_has_changed()
145 acpi_processor_ppc_ost(pr->handle, 1); in acpi_processor_ppc_has_changed()
147 acpi_processor_ppc_ost(pr->handle, 0); in acpi_processor_ppc_has_changed()
150 cpufreq_update_limits(pr->id); in acpi_processor_ppc_has_changed()
155 struct acpi_processor *pr; in acpi_processor_get_bios_limit() local
157 pr = per_cpu(processors, cpu); in acpi_processor_get_bios_limit()
158 if (!pr || !pr->performance || !pr->performance->state_count) in acpi_processor_get_bios_limit()
161 *limit = pr->performance->states[pr->performance_platform_limit]. in acpi_processor_get_bios_limit()
178 struct acpi_processor *pr = per_cpu(processors, cpu); in acpi_processor_ppc_init() local
181 if (!pr) in acpi_processor_ppc_init()
189 pr->performance_platform_limit = 0; in acpi_processor_ppc_init()
192 &pr->perflib_req, FREQ_QOS_MAX, in acpi_processor_ppc_init()
205 struct acpi_processor *pr = per_cpu(processors, cpu); in acpi_processor_ppc_exit() local
207 if (pr) in acpi_processor_ppc_exit()
208 freq_qos_remove_request(&pr->perflib_req); in acpi_processor_ppc_exit()
212 static int acpi_processor_get_performance_control(struct acpi_processor *pr) in acpi_processor_get_performance_control() argument
220 status = acpi_evaluate_object(pr->handle, "_PCT", NULL, &buffer); in acpi_processor_get_performance_control()
222 acpi_evaluation_failure_warn(pr->handle, "_PCT", status); in acpi_processor_get_performance_control()
245 memcpy(&pr->performance->control_register, obj.buffer.pointer, in acpi_processor_get_performance_control()
261 memcpy(&pr->performance->status_register, obj.buffer.pointer, in acpi_processor_get_performance_control()
305 static int acpi_processor_get_performance_states(struct acpi_processor *pr) in acpi_processor_get_performance_states() argument
316 status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer); in acpi_processor_get_performance_states()
318 acpi_evaluation_failure_warn(pr->handle, "_PSS", status); in acpi_processor_get_performance_states()
329 acpi_handle_debug(pr->handle, "Found %d performance states\n", in acpi_processor_get_performance_states()
332 pr->performance->state_count = pss->package.count; in acpi_processor_get_performance_states()
333 pr->performance->states = in acpi_processor_get_performance_states()
337 if (!pr->performance->states) { in acpi_processor_get_performance_states()
342 for (i = 0; i < pr->performance->state_count; i++) { in acpi_processor_get_performance_states()
344 struct acpi_processor_px *px = &(pr->performance->states[i]); in acpi_processor_get_performance_states()
349 acpi_handle_debug(pr->handle, "Extracting state %d\n", i); in acpi_processor_get_performance_states()
354 acpi_handle_warn(pr->handle, "Invalid _PSS data: %s\n", in acpi_processor_get_performance_states()
357 kfree(pr->performance->states); in acpi_processor_get_performance_states()
363 acpi_handle_debug(pr->handle, in acpi_processor_get_performance_states()
379 pr->id, px->core_frequency); in acpi_processor_get_performance_states()
387 memcpy(&(pr->performance->states[last_invalid]), in acpi_processor_get_performance_states()
396 "No valid BIOS _PSS frequency found for processor %d\n", pr->id); in acpi_processor_get_performance_states()
398 kfree(pr->performance->states); in acpi_processor_get_performance_states()
399 pr->performance->states = NULL; in acpi_processor_get_performance_states()
403 pr->performance->state_count = last_invalid; in acpi_processor_get_performance_states()
411 int acpi_processor_get_performance_info(struct acpi_processor *pr) in acpi_processor_get_performance_info() argument
415 if (!pr || !pr->performance || !pr->handle) in acpi_processor_get_performance_info()
418 if (!acpi_has_method(pr->handle, "_PCT")) { in acpi_processor_get_performance_info()
419 acpi_handle_debug(pr->handle, in acpi_processor_get_performance_info()
424 result = acpi_processor_get_performance_control(pr); in acpi_processor_get_performance_info()
428 result = acpi_processor_get_performance_states(pr); in acpi_processor_get_performance_info()
434 result = acpi_processor_get_platform_limit(pr); in acpi_processor_get_performance_info()
444 if (acpi_has_method(pr->handle, "_PPC")) { in acpi_processor_get_performance_info()
592 struct acpi_processor *pr; in acpi_processor_preregister_performance() local
604 * changing pr->performance if it has. Check input data as well. in acpi_processor_preregister_performance()
607 pr = per_cpu(processors, i); in acpi_processor_preregister_performance()
608 if (!pr) { in acpi_processor_preregister_performance()
613 if (pr->performance) { in acpi_processor_preregister_performance()
626 pr = per_cpu(processors, i); in acpi_processor_preregister_performance()
627 if (!pr) in acpi_processor_preregister_performance()
630 pr->performance = per_cpu_ptr(performance, i); in acpi_processor_preregister_performance()
631 pdomain = &(pr->performance->domain_info); in acpi_processor_preregister_performance()
632 if (acpi_processor_get_psd(pr->handle, pdomain)) { in acpi_processor_preregister_performance()
645 pr = per_cpu(processors, i); in acpi_processor_preregister_performance()
646 if (!pr) in acpi_processor_preregister_performance()
652 pdomain = &(pr->performance->domain_info); in acpi_processor_preregister_performance()
653 cpumask_set_cpu(i, pr->performance->shared_cpu_map); in acpi_processor_preregister_performance()
661 pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ALL; in acpi_processor_preregister_performance()
663 pr->performance->shared_type = CPUFREQ_SHARED_TYPE_HW; in acpi_processor_preregister_performance()
665 pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ANY; in acpi_processor_preregister_performance()
692 cpumask_set_cpu(j, pr->performance->shared_cpu_map); in acpi_processor_preregister_performance()
708 pr->performance->shared_type; in acpi_processor_preregister_performance()
710 pr->performance->shared_cpu_map); in acpi_processor_preregister_performance()
716 pr = per_cpu(processors, i); in acpi_processor_preregister_performance()
717 if (!pr || !pr->performance) in acpi_processor_preregister_performance()
722 cpumask_clear(pr->performance->shared_cpu_map); in acpi_processor_preregister_performance()
723 cpumask_set_cpu(i, pr->performance->shared_cpu_map); in acpi_processor_preregister_performance()
724 pr->performance->shared_type = CPUFREQ_SHARED_TYPE_NONE; in acpi_processor_preregister_performance()
726 pr->performance = NULL; /* Will be set for real in register */ in acpi_processor_preregister_performance()
739 struct acpi_processor *pr; in acpi_processor_register_performance() local
746 pr = per_cpu(processors, cpu); in acpi_processor_register_performance()
747 if (!pr) { in acpi_processor_register_performance()
752 if (pr->performance) { in acpi_processor_register_performance()
759 pr->performance = performance; in acpi_processor_register_performance()
761 if (acpi_processor_get_performance_info(pr)) { in acpi_processor_register_performance()
762 pr->performance = NULL; in acpi_processor_register_performance()
774 struct acpi_processor *pr; in acpi_processor_unregister_performance() local
778 pr = per_cpu(processors, cpu); in acpi_processor_unregister_performance()
779 if (!pr) in acpi_processor_unregister_performance()
782 if (pr->performance) in acpi_processor_unregister_performance()
783 kfree(pr->performance->states); in acpi_processor_unregister_performance()
785 pr->performance = NULL; in acpi_processor_unregister_performance()