diff options
Diffstat (limited to 'drivers/acpi/processor_idle.c')
-rw-r--r-- | drivers/acpi/processor_idle.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 0e8e2de2ed3e..6b1d32a161ae 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -770,6 +770,35 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, | |||
770 | return index; | 770 | return index; |
771 | } | 771 | } |
772 | 772 | ||
773 | |||
774 | /** | ||
775 | * acpi_idle_play_dead - enters an ACPI state for long-term idle (i.e. off-lining) | ||
776 | * @dev: the target CPU | ||
777 | * @index: the index of suggested state | ||
778 | */ | ||
779 | static int acpi_idle_play_dead(struct cpuidle_device *dev, int index) | ||
780 | { | ||
781 | struct cpuidle_state_usage *state_usage = &dev->states_usage[index]; | ||
782 | struct acpi_processor_cx *cx = cpuidle_get_statedata(state_usage); | ||
783 | |||
784 | ACPI_FLUSH_CPU_CACHE(); | ||
785 | |||
786 | while (1) { | ||
787 | |||
788 | if (cx->entry_method == ACPI_CSTATE_HALT) | ||
789 | halt(); | ||
790 | else if (cx->entry_method == ACPI_CSTATE_SYSTEMIO) { | ||
791 | inb(cx->address); | ||
792 | /* See comment in acpi_idle_do_entry() */ | ||
793 | inl(acpi_gbl_FADT.xpm_timer_block.address); | ||
794 | } else | ||
795 | return -ENODEV; | ||
796 | } | ||
797 | |||
798 | /* Never reached */ | ||
799 | return 0; | ||
800 | } | ||
801 | |||
773 | /** | 802 | /** |
774 | * acpi_idle_enter_simple - enters an ACPI state without BM handling | 803 | * acpi_idle_enter_simple - enters an ACPI state without BM handling |
775 | * @dev: the target CPU | 804 | * @dev: the target CPU |
@@ -1077,12 +1106,14 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr) | |||
1077 | state->flags |= CPUIDLE_FLAG_TIME_VALID; | 1106 | state->flags |= CPUIDLE_FLAG_TIME_VALID; |
1078 | 1107 | ||
1079 | state->enter = acpi_idle_enter_c1; | 1108 | state->enter = acpi_idle_enter_c1; |
1109 | state->enter_dead = acpi_idle_play_dead; | ||
1080 | drv->safe_state_index = count; | 1110 | drv->safe_state_index = count; |
1081 | break; | 1111 | break; |
1082 | 1112 | ||
1083 | case ACPI_STATE_C2: | 1113 | case ACPI_STATE_C2: |
1084 | state->flags |= CPUIDLE_FLAG_TIME_VALID; | 1114 | state->flags |= CPUIDLE_FLAG_TIME_VALID; |
1085 | state->enter = acpi_idle_enter_simple; | 1115 | state->enter = acpi_idle_enter_simple; |
1116 | state->enter_dead = acpi_idle_play_dead; | ||
1086 | drv->safe_state_index = count; | 1117 | drv->safe_state_index = count; |
1087 | break; | 1118 | break; |
1088 | 1119 | ||