Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
[cascardo/linux.git] / drivers / acpi / processor_idle.c
index 799644c..3dca36d 100644 (file)
@@ -725,11 +725,6 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,
        if (unlikely(!pr))
                return -EINVAL;
 
-       if (cx->entry_method == ACPI_CSTATE_FFH) {
-               if (current_set_polling_and_test())
-                       return -EINVAL;
-       }
-
        lapic_timer_state_broadcast(pr, cx, 1);
        acpi_idle_do_entry(cx);
 
@@ -783,10 +778,12 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
        if (unlikely(!pr))
                return -EINVAL;
 
-       if (cx->entry_method == ACPI_CSTATE_FFH) {
-               if (current_set_polling_and_test())
-                       return -EINVAL;
-       }
+#ifdef CONFIG_HOTPLUG_CPU
+       if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) &&
+           !pr->flags.has_cst &&
+           !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED))
+               return acpi_idle_enter_c1(dev, drv, CPUIDLE_DRIVER_STATE_START);
+#endif
 
        /*
         * Must be done before busmaster disable as we might need to
@@ -829,6 +826,13 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
        if (unlikely(!pr))
                return -EINVAL;
 
+#ifdef CONFIG_HOTPLUG_CPU
+       if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) &&
+           !pr->flags.has_cst &&
+           !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED))
+               return acpi_idle_enter_c1(dev, drv, CPUIDLE_DRIVER_STATE_START);
+#endif
+
        if (!cx->bm_sts_skip && acpi_idle_bm_check()) {
                if (drv->safe_state_index >= 0) {
                        return drv->states[drv->safe_state_index].enter(dev,
@@ -839,11 +843,6 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
                }
        }
 
-       if (cx->entry_method == ACPI_CSTATE_FFH) {
-               if (current_set_polling_and_test())
-                       return -EINVAL;
-       }
-
        acpi_unlazy_tlb(smp_processor_id());
 
        /* Tell the scheduler that we are going deep-idle: */
@@ -930,12 +929,6 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr,
                if (!cx->valid)
                        continue;
 
-#ifdef CONFIG_HOTPLUG_CPU
-               if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) &&
-                   !pr->flags.has_cst &&
-                   !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED))
-                       continue;
-#endif
                per_cpu(acpi_cstate[count], dev->cpu) = cx;
 
                count++;
@@ -943,8 +936,6 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr,
                        break;
        }
 
-       dev->state_count = count;
-
        if (!count)
                return -EINVAL;
 
@@ -985,13 +976,6 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr)
                if (!cx->valid)
                        continue;
 
-#ifdef CONFIG_HOTPLUG_CPU
-               if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) &&
-                   !pr->flags.has_cst &&
-                   !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED))
-                       continue;
-#endif
-
                state = &drv->states[count];
                snprintf(state->name, CPUIDLE_NAME_LEN, "C%d", i);
                strncpy(state->desc, cx->desc, CPUIDLE_DESC_LEN);