Lines Matching full:throttling
3 * processor_throttling.c - Throttling submodule of the ACPI processor driver
31 MODULE_PARM_DESC(ignore_tpc, "Disable broken BIOS _TPC throttling support");
74 pthrottling = &(pr->throttling); in acpi_processor_update_tsd_coord()
96 pthrottling = &pr->throttling; in acpi_processor_update_tsd_coord()
119 match_pthrottling = &(match_pr->throttling); in acpi_processor_update_tsd_coord()
151 match_pthrottling = &(match_pr->throttling); in acpi_processor_update_tsd_coord()
178 pthrottling = &(pr->throttling); in acpi_processor_update_tsd_coord()
213 if (!pr->flags.throttling) { in acpi_processor_throttling_notifier()
215 "Throttling control unsupported on CPU %d\n", in acpi_processor_throttling_notifier()
220 p_throttling = &(pr->throttling); in acpi_processor_throttling_notifier()
254 pr_warn("Unsupported Throttling notifier event\n"); in acpi_processor_throttling_notifier()
262 * _TPC - Throttling Present Capabilities
301 /* Throttling Limit is unsupported */ in acpi_processor_tstate_has_changed()
306 if (throttling_limit >= pr->throttling.state_count) { in acpi_processor_tstate_has_changed()
307 /* Uncorrect Throttling Limit */ in acpi_processor_tstate_has_changed()
311 current_state = pr->throttling.state; in acpi_processor_tstate_has_changed()
328 * Unnecessary to change the throttling state in acpi_processor_tstate_has_changed()
334 * will be forced to switch to the throttling state defined in acpi_processor_tstate_has_changed()
359 /* When one CPU is offline, the T-state throttling in acpi_processor_reevaluate_tstate()
362 pr->flags.throttling = 0; in acpi_processor_reevaluate_tstate()
368 if (!pr->throttling.state_count) { in acpi_processor_reevaluate_tstate()
372 pr->flags.throttling = 0; in acpi_processor_reevaluate_tstate()
375 pr->flags.throttling = 1; in acpi_processor_reevaluate_tstate()
377 /* Disable throttling (if enabled). We'll let subsequent in acpi_processor_reevaluate_tstate()
386 if (pr->throttling.state) { in acpi_processor_reevaluate_tstate()
394 pr->flags.throttling = 0; in acpi_processor_reevaluate_tstate()
397 * _PTC - Processor Throttling Control (and status) register location
406 struct acpi_processor_throttling *throttling; in acpi_processor_get_throttling_control() local
437 memcpy(&pr->throttling.control_register, obj.buffer.pointer, in acpi_processor_get_throttling_control()
454 memcpy(&pr->throttling.status_register, obj.buffer.pointer, in acpi_processor_get_throttling_control()
457 throttling = &pr->throttling; in acpi_processor_get_throttling_control()
459 if ((throttling->control_register.bit_width + in acpi_processor_get_throttling_control()
460 throttling->control_register.bit_offset) > 32) { in acpi_processor_get_throttling_control()
466 if ((throttling->status_register.bit_width + in acpi_processor_get_throttling_control()
467 throttling->status_register.bit_offset) > 32) { in acpi_processor_get_throttling_control()
480 * _TSS - Throttling Supported States
507 acpi_handle_debug(pr->handle, "Found %d throttling states\n", in acpi_processor_get_throttling_states()
510 pr->throttling.state_count = tss->package.count; in acpi_processor_get_throttling_states()
511 pr->throttling.states_tss = in acpi_processor_get_throttling_states()
515 if (!pr->throttling.states_tss) { in acpi_processor_get_throttling_states()
520 for (i = 0; i < pr->throttling.state_count; i++) { in acpi_processor_get_throttling_states()
523 (struct acpi_processor_tx_tss *)&(pr->throttling. in acpi_processor_get_throttling_states()
537 kfree(pr->throttling.states_tss); in acpi_processor_get_throttling_states()
544 kfree(pr->throttling.states_tss); in acpi_processor_get_throttling_states()
569 pthrottling = &pr->throttling; in acpi_processor_get_tsd()
593 pdomain = &(pr->throttling.domain_info); in acpi_processor_get_tsd()
618 pthrottling = &pr->throttling; in acpi_processor_get_tsd()
640 Throttling Control
652 if (!pr->flags.throttling) in acpi_processor_get_throttling_fadt()
662 request_region(pr->throttling.address, 6, "ACPI CPU throttle"); in acpi_processor_get_throttling_fadt()
664 pr->throttling.state = 0; in acpi_processor_get_throttling_fadt()
666 duty_mask = pr->throttling.state_count - 1; in acpi_processor_get_throttling_fadt()
668 duty_mask <<= pr->throttling.duty_offset; in acpi_processor_get_throttling_fadt()
672 value = inl(pr->throttling.address); in acpi_processor_get_throttling_fadt()
675 * Compute the current throttling state when throttling is enabled in acpi_processor_get_throttling_fadt()
680 duty_value >>= pr->throttling.duty_offset; in acpi_processor_get_throttling_fadt()
683 state = pr->throttling.state_count - duty_value; in acpi_processor_get_throttling_fadt()
686 pr->throttling.state = state; in acpi_processor_get_throttling_fadt()
691 "Throttling state is T%d (%d%% throttling applied)\n", in acpi_processor_get_throttling_fadt()
692 state, pr->throttling.states[state].performance); in acpi_processor_get_throttling_fadt()
755 struct acpi_processor_throttling *throttling; in acpi_read_throttling_status() local
758 throttling = &pr->throttling; in acpi_read_throttling_status()
759 switch (throttling->status_register.space_id) { in acpi_read_throttling_status()
761 bit_width = throttling->status_register.bit_width; in acpi_read_throttling_status()
762 bit_offset = throttling->status_register.bit_offset; in acpi_read_throttling_status()
764 acpi_os_read_port((acpi_io_address) throttling->status_register. in acpi_read_throttling_status()
776 (u32) (throttling->status_register.space_id)); in acpi_read_throttling_status()
787 struct acpi_processor_throttling *throttling; in acpi_write_throttling_state() local
790 throttling = &pr->throttling; in acpi_write_throttling_state()
791 switch (throttling->control_register.space_id) { in acpi_write_throttling_state()
793 bit_width = throttling->control_register.bit_width; in acpi_write_throttling_state()
794 bit_offset = throttling->control_register.bit_offset; in acpi_write_throttling_state()
798 acpi_os_write_port((acpi_io_address) throttling-> in acpi_write_throttling_state()
809 (u32) (throttling->control_register.space_id)); in acpi_write_throttling_state()
819 for (i = 0; i < pr->throttling.state_count; i++) { in acpi_get_throttling_state()
821 (struct acpi_processor_tx_tss *)&(pr->throttling. in acpi_get_throttling_state()
834 if (state >= 0 && state <= pr->throttling.state_count) { in acpi_get_throttling_value()
836 (struct acpi_processor_tx_tss *)&(pr->throttling. in acpi_get_throttling_value()
853 if (!pr->flags.throttling) in acpi_processor_get_throttling_ptc()
856 pr->throttling.state = 0; in acpi_processor_get_throttling_ptc()
864 "Invalid throttling state, reset\n"); in acpi_processor_get_throttling_ptc()
871 pr->throttling.state = state; in acpi_processor_get_throttling_ptc()
881 return pr->throttling.acpi_processor_get_throttling(pr); in __acpi_processor_get_throttling()
889 if (!pr->flags.throttling) in acpi_processor_get_throttling()
908 if (!pr->throttling.address) { in acpi_processor_get_fadt_info()
909 acpi_handle_debug(pr->handle, "No throttling register\n"); in acpi_processor_get_fadt_info()
911 } else if (!pr->throttling.duty_width) { in acpi_processor_get_fadt_info()
912 acpi_handle_debug(pr->handle, "No throttling states\n"); in acpi_processor_get_fadt_info()
916 else if ((pr->throttling.duty_offset + pr->throttling.duty_width) > 4) { in acpi_processor_get_fadt_info()
921 pr->throttling.state_count = 1 << acpi_gbl_FADT.duty_width; in acpi_processor_get_fadt_info()
924 * Compute state values. Note that throttling displays a linear power in acpi_processor_get_fadt_info()
929 step = (1000 / pr->throttling.state_count); in acpi_processor_get_fadt_info()
931 for (i = 0; i < pr->throttling.state_count; i++) { in acpi_processor_get_fadt_info()
932 pr->throttling.states[i].performance = 1000 - step * i; in acpi_processor_get_fadt_info()
933 pr->throttling.states[i].power = 1000 - step * i; in acpi_processor_get_fadt_info()
948 if ((state < 0) || (state > (pr->throttling.state_count - 1))) in acpi_processor_set_throttling_fadt()
951 if (!pr->flags.throttling) in acpi_processor_set_throttling_fadt()
954 if (!force && (state == pr->throttling.state)) in acpi_processor_set_throttling_fadt()
963 duty_value = pr->throttling.state_count - state; in acpi_processor_set_throttling_fadt()
965 duty_value <<= pr->throttling.duty_offset; in acpi_processor_set_throttling_fadt()
968 duty_mask = pr->throttling.state_count - 1; in acpi_processor_set_throttling_fadt()
977 * Disable throttling by writing a 0 to bit 4. Note that we must in acpi_processor_set_throttling_fadt()
980 value = inl(pr->throttling.address); in acpi_processor_set_throttling_fadt()
983 outl(value, pr->throttling.address); in acpi_processor_set_throttling_fadt()
987 * Write the new duty_value and then enable throttling. Note in acpi_processor_set_throttling_fadt()
988 * that a state value of 0 leaves throttling disabled. in acpi_processor_set_throttling_fadt()
993 outl(value, pr->throttling.address); in acpi_processor_set_throttling_fadt()
996 outl(value, pr->throttling.address); in acpi_processor_set_throttling_fadt()
999 pr->throttling.state = state; in acpi_processor_set_throttling_fadt()
1004 "Throttling state set to T%d (%d%%)\n", state, in acpi_processor_set_throttling_fadt()
1005 (pr->throttling.states[state].performance ? pr-> in acpi_processor_set_throttling_fadt()
1006 throttling.states[state].performance / 10 : 0)); in acpi_processor_set_throttling_fadt()
1020 if ((state < 0) || (state > (pr->throttling.state_count - 1))) in acpi_processor_set_throttling_ptc()
1023 if (!pr->flags.throttling) in acpi_processor_set_throttling_ptc()
1026 if (!force && (state == pr->throttling.state)) in acpi_processor_set_throttling_ptc()
1036 pr->throttling.state = state; in acpi_processor_set_throttling_ptc()
1047 return pr->throttling.acpi_processor_set_throttling(pr, in acpi_processor_throttling_fn()
1064 if (!pr->flags.throttling) in __acpi_processor_set_throttling()
1067 if ((state < 0) || (state > (pr->throttling.state_count - 1))) in __acpi_processor_set_throttling()
1073 * the throttling state any more. in __acpi_processor_set_throttling()
1079 p_throttling = &(pr->throttling); in __acpi_processor_set_throttling()
1082 * The throttling notifier will be called for every in __acpi_processor_set_throttling()
1122 * If the throttling control is unsupported on CPU i, in __acpi_processor_set_throttling()
1125 if (!match_pr->flags.throttling) { in __acpi_processor_set_throttling()
1127 "Throttling Control unsupported on CPU %d\n", i); in __acpi_processor_set_throttling()
1140 * throttling notifier is called for every in __acpi_processor_set_throttling()
1166 pr->throttling.address, in acpi_processor_get_throttling_info()
1167 pr->throttling.duty_offset, in acpi_processor_get_throttling_info()
1168 pr->throttling.duty_width); in acpi_processor_get_throttling_info()
1177 pr->throttling.acpi_processor_get_throttling = in acpi_processor_get_throttling_info()
1179 pr->throttling.acpi_processor_set_throttling = in acpi_processor_get_throttling_info()
1184 pr->throttling.acpi_processor_get_throttling = in acpi_processor_get_throttling_info()
1186 pr->throttling.acpi_processor_set_throttling = in acpi_processor_get_throttling_info()
1195 pthrottling = &pr->throttling; in acpi_processor_get_throttling_info()
1202 * PIIX4 Errata: We don't support throttling on the original PIIX4. in acpi_processor_get_throttling_info()
1208 "Throttling not supported on PIIX4 A- or B-step\n"); in acpi_processor_get_throttling_info()
1212 acpi_handle_debug(pr->handle, "Found %d throttling states\n", in acpi_processor_get_throttling_info()
1213 pr->throttling.state_count); in acpi_processor_get_throttling_info()
1215 pr->flags.throttling = 1; in acpi_processor_get_throttling_info()
1218 * Disable throttling (if enabled). We'll let subsequent policy (e.g. in acpi_processor_get_throttling_info()
1227 if (pr->throttling.state) { in acpi_processor_get_throttling_info()
1229 "Disabling throttling (was T%d)\n", in acpi_processor_get_throttling_info()
1230 pr->throttling.state); in acpi_processor_get_throttling_info()
1238 pr->flags.throttling = 0; in acpi_processor_get_throttling_info()