]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/processor_idle.c
ACPICA: Fix for Load operator
[linux-2.6-omap-h63xx.git] / drivers / acpi / processor_idle.c
index 6f3b217699e94a4d47f5b3863c4ffe68ff24938f..788da9781f80ffb5311b396cd3557b0786376dcd 100644 (file)
@@ -216,8 +216,10 @@ static void acpi_safe_halt(void)
         * test NEED_RESCHED:
         */
        smp_mb();
-       if (!need_resched())
+       if (!need_resched()) {
                safe_halt();
+               local_irq_disable();
+       }
        current_thread_info()->status |= TS_POLLING;
 }
 
@@ -421,7 +423,9 @@ static void acpi_processor_idle(void)
                else
                        acpi_safe_halt();
 
-               local_irq_enable();
+               if (irqs_disabled())
+                       local_irq_enable();
+
                return;
        }
 
@@ -530,7 +534,9 @@ static void acpi_processor_idle(void)
                 *       skew otherwise.
                 */
                sleep_ticks = 0xFFFFFFFF;
-               local_irq_enable();
+               if (irqs_disabled())
+                       local_irq_enable();
+
                break;
 
        case ACPI_STATE_C2:
@@ -1481,7 +1487,6 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
                return 0;
        }
 
-       acpi_unlazy_tlb(smp_processor_id());
        /*
         * Must be done before busmaster disable as we might need to
         * access HPET !
@@ -1571,6 +1576,8 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
                return 0;
        }
 
+       acpi_unlazy_tlb(smp_processor_id());
+
        /* Tell the scheduler that we are going deep-idle: */
        sched_clock_idle_sleep_event();
        /*
@@ -1686,7 +1693,9 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
                switch (cx->type) {
                        case ACPI_STATE_C1:
                        state->flags |= CPUIDLE_FLAG_SHALLOW;
-                       state->flags |= CPUIDLE_FLAG_TIME_VALID;
+                       if (cx->entry_method == ACPI_CSTATE_FFH)
+                               state->flags |= CPUIDLE_FLAG_TIME_VALID;
+
                        state->enter = acpi_idle_enter_c1;
                        dev->safe_state = state;
                        break;