Merge branches 'release', 'cpuidle-2.6.25' and 'idle' into release
authorLen Brown <len.brown@intel.com>
Thu, 7 Feb 2008 08:11:05 +0000 (03:11 -0500)
committerLen Brown <len.brown@intel.com>
Thu, 7 Feb 2008 08:11:05 +0000 (03:11 -0500)
1  2  3 
arch/x86/Kconfig
drivers/acpi/processor_idle.c
drivers/cpuidle/cpuidle.c
include/linux/cpuidle.h

@@@@ -105,18 -115,9 -105,21 +108,21 @@@@ config GENERIC_TIME_VSYSCAL
        bool
        default X86_64
   
++ config ARCH_HAS_CPU_RELAX
++      def_bool y
++ 
 + config HAVE_SETUP_PER_CPU_AREA
 +      def_bool X86_64
   
 + select HAVE_KVM
   
 + config ARCH_HIBERNATION_POSSIBLE
 +      def_bool y
 +      depends on !SMP || !X86_VOYAGER
   
 + config ARCH_SUSPEND_POSSIBLE
 +      def_bool y
 +      depends on !X86_VOYAGER
   
   config ZONE_DMA32
        bool
@@@@ -201,19 -200,6 -201,23 +204,23 @@@@ static inline u32 ticks_elapsed_in_us(u
                return PM_TIMER_TICKS_TO_US((0xFFFFFFFF - t1) + t2);
   }
   
++ /*
++  * Callers should disable interrupts before the call and enable
++  * interrupts after return.
++  */
 + static void acpi_safe_halt(void)
 + {
 +      current_thread_info()->status &= ~TS_POLLING;
 +      /*
 +       * TS_POLLING-cleared state must be visible before we
 +       * test NEED_RESCHED:
 +       */
 +      smp_mb();
 +      if (!need_resched())
 +              safe_halt();
 +      current_thread_info()->status |= TS_POLLING;
 + }
 + 
   #ifndef CONFIG_CPU_IDLE
   
   static void
@@@@ -1406,11 -1376,19 -1420,14 +1423,14 @@@@ static int acpi_idle_enter_c1(struct cp
        if (pr->flags.bm_check)
                acpi_idle_update_bm_rld(pr, cx);
   
-       acpi_safe_halt();
 -      current_thread_info()->status &= ~TS_POLLING;
 -      /*
 -       * TS_POLLING-cleared state must be visible before we test
 -       * NEED_RESCHED:
 -       */
 -      smp_mb();
 -      if (!need_resched())
 -              safe_halt();
 -      current_thread_info()->status |= TS_POLLING;
++      t1 = inl(acpi_gbl_FADT.xpm_timer_block.address);
++      acpi_idle_do_entry(cx);
++      t2 = inl(acpi_gbl_FADT.xpm_timer_block.address);
   
++      local_irq_enable();
        cx->usage++;
   
--      return 0;
++      return ticks_elapsed_in_us(t1, t2);
   }
   
   /**
@@@@ -1513,15 -1474,6 -1530,17 +1533,17 @@@@ static int acpi_idle_enter_bm(struct cp
        if (acpi_idle_suspend)
                return(acpi_idle_enter_c1(dev, state));
   
 +      if (acpi_idle_bm_check()) {
 +              if (dev->safe_state) {
 +                      return dev->safe_state->enter(dev, dev->safe_state);
 +              } else {
++                      local_irq_disable();
 +                      acpi_safe_halt();
++                      local_irq_enable();
 +                      return 0;
 +              }
 +      }
 + 
        local_irq_disable();
        current_thread_info()->status &= ~TS_POLLING;
        /*
@@@@ -1645,8 -1586,7 -1664,9 +1667,9 @@@@ static int acpi_processor_setup_cpuidle
                switch (cx->type) {
                        case ACPI_STATE_C1:
                        state->flags |= CPUIDLE_FLAG_SHALLOW;
++                      state->flags |= CPUIDLE_FLAG_TIME_VALID;
                        state->enter = acpi_idle_enter_c1;
 +                      dev->safe_state = state;
                        break;
   
                        case ACPI_STATE_C2:
   #include <linux/mutex.h>
   #include <linux/sched.h>
   #include <linux/notifier.h>
 - #include <linux/latency.h>
 + #include <linux/pm_qos_params.h>
   #include <linux/cpu.h>
   #include <linux/cpuidle.h>
++ #include <linux/ktime.h>
   
   #include "cpuidle.h"
   
Simple merge