diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-01-16 19:56:47 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-01-16 19:56:47 -0500 |
commit | 9612a461c1e48f75ca1e1f0faf9c928761baae5b (patch) | |
tree | 19b80da3e4cabca51dcbc5a4f7432312ea251351 /drivers/acpi/processor_idle.c | |
parent | 4ff913373a77b99cbe3c5df3c76d2622006200d6 (diff) | |
parent | 4955a5412cad83da6e994d939bdb4f7887e4585e (diff) |
Merge branch 'pm-cpuidle'
* pm-cpuidle:
intel_idle: remove superfluous dev->state_count initialization
intel_idle: do C1E promotion disable quirk for hotplugged CPUs
ACPI / cpuidle: remove dev->state_count setting
ACPI / cpuidle: fix max idle state handling with hotplug CPU support
POWERPC: pseries: cpuidle: use the common cpuidle_[un]register() routines
POWERPC: pseries: cpuidle: remove superfluous dev->state_count initialization
ARM: EXYNOS: cpuidle: fix AFTR mode check
Diffstat (limited to 'drivers/acpi/processor_idle.c')
-rw-r--r-- | drivers/acpi/processor_idle.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 799644c3888c..1fc455b8ce17 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -783,6 +783,13 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, | |||
783 | if (unlikely(!pr)) | 783 | if (unlikely(!pr)) |
784 | return -EINVAL; | 784 | return -EINVAL; |
785 | 785 | ||
786 | #ifdef CONFIG_HOTPLUG_CPU | ||
787 | if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) && | ||
788 | !pr->flags.has_cst && | ||
789 | !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED)) | ||
790 | return acpi_idle_enter_c1(dev, drv, CPUIDLE_DRIVER_STATE_START); | ||
791 | #endif | ||
792 | |||
786 | if (cx->entry_method == ACPI_CSTATE_FFH) { | 793 | if (cx->entry_method == ACPI_CSTATE_FFH) { |
787 | if (current_set_polling_and_test()) | 794 | if (current_set_polling_and_test()) |
788 | return -EINVAL; | 795 | return -EINVAL; |
@@ -829,6 +836,13 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
829 | if (unlikely(!pr)) | 836 | if (unlikely(!pr)) |
830 | return -EINVAL; | 837 | return -EINVAL; |
831 | 838 | ||
839 | #ifdef CONFIG_HOTPLUG_CPU | ||
840 | if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) && | ||
841 | !pr->flags.has_cst && | ||
842 | !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED)) | ||
843 | return acpi_idle_enter_c1(dev, drv, CPUIDLE_DRIVER_STATE_START); | ||
844 | #endif | ||
845 | |||
832 | if (!cx->bm_sts_skip && acpi_idle_bm_check()) { | 846 | if (!cx->bm_sts_skip && acpi_idle_bm_check()) { |
833 | if (drv->safe_state_index >= 0) { | 847 | if (drv->safe_state_index >= 0) { |
834 | return drv->states[drv->safe_state_index].enter(dev, | 848 | return drv->states[drv->safe_state_index].enter(dev, |
@@ -930,12 +944,6 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr, | |||
930 | if (!cx->valid) | 944 | if (!cx->valid) |
931 | continue; | 945 | continue; |
932 | 946 | ||
933 | #ifdef CONFIG_HOTPLUG_CPU | ||
934 | if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) && | ||
935 | !pr->flags.has_cst && | ||
936 | !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED)) | ||
937 | continue; | ||
938 | #endif | ||
939 | per_cpu(acpi_cstate[count], dev->cpu) = cx; | 947 | per_cpu(acpi_cstate[count], dev->cpu) = cx; |
940 | 948 | ||
941 | count++; | 949 | count++; |
@@ -943,8 +951,6 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr, | |||
943 | break; | 951 | break; |
944 | } | 952 | } |
945 | 953 | ||
946 | dev->state_count = count; | ||
947 | |||
948 | if (!count) | 954 | if (!count) |
949 | return -EINVAL; | 955 | return -EINVAL; |
950 | 956 | ||
@@ -985,13 +991,6 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr) | |||
985 | if (!cx->valid) | 991 | if (!cx->valid) |
986 | continue; | 992 | continue; |
987 | 993 | ||
988 | #ifdef CONFIG_HOTPLUG_CPU | ||
989 | if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) && | ||
990 | !pr->flags.has_cst && | ||
991 | !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED)) | ||
992 | continue; | ||
993 | #endif | ||
994 | |||
995 | state = &drv->states[count]; | 994 | state = &drv->states[count]; |
996 | snprintf(state->name, CPUIDLE_NAME_LEN, "C%d", i); | 995 | snprintf(state->name, CPUIDLE_NAME_LEN, "C%d", i); |
997 | strncpy(state->desc, cx->desc, CPUIDLE_DESC_LEN); | 996 | strncpy(state->desc, cx->desc, CPUIDLE_DESC_LEN); |