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

diff --combined arch/x86/Kconfig
@@@@ -17,74 -17,81 -17,74 +17,74 @@@@ config X86_6
   
   ### Arch settings
   config X86
 -      bool
 -      default y
 +      def_bool y
 +      select HAVE_OPROFILE
 +      select HAVE_KPROBES
 + 
 + config GENERIC_LOCKBREAK
 +      def_bool n
   
   config GENERIC_TIME
 -      bool
 -      default y
 +      def_bool y
   
   config GENERIC_CMOS_UPDATE
 -      bool
 -      default y
 +      def_bool y
   
   config CLOCKSOURCE_WATCHDOG
 -      bool
 -      default y
 +      def_bool y
   
   config GENERIC_CLOCKEVENTS
 -      bool
 -      default y
 +      def_bool y
   
   config GENERIC_CLOCKEVENTS_BROADCAST
 -      bool
 -      default y
 +      def_bool y
        depends on X86_64 || (X86_32 && X86_LOCAL_APIC)
   
   config LOCKDEP_SUPPORT
 -      bool
 -      default y
 +      def_bool y
   
   config STACKTRACE_SUPPORT
 -      bool
 -      default y
 +      def_bool y
 + 
 + config HAVE_LATENCYTOP_SUPPORT
 +      def_bool y
   
   config SEMAPHORE_SLEEPERS
 -      bool
 -      default y
 +      def_bool y
   
   config MMU
 -      bool
 -      default y
 +      def_bool y
   
   config ZONE_DMA
 -      bool
 -      default y
 +      def_bool y
   
   config QUICKLIST
 -      bool
 -      default X86_32
 +      def_bool X86_32
   
   config SBUS
        bool
   
   config GENERIC_ISA_DMA
 -      bool
 -      default y
 +      def_bool y
   
   config GENERIC_IOMAP
 -      bool
 -      default y
 +      def_bool y
   
   config GENERIC_BUG
 -      bool
 -      default y
 +      def_bool y
        depends on BUG
   
   config GENERIC_HWEIGHT
 -      bool
 -      default y
 +      def_bool y
 + 
 + config GENERIC_GPIO
 +      def_bool n
   
   config ARCH_MAY_HAVE_PC_FDC
 -      bool
 -      default y
 +      def_bool y
   
   config DMI
 -      bool
 -      default y
 +      def_bool y
   
   config RWSEM_GENERIC_SPINLOCK
        def_bool !X86_XADD
@@@@ -98,6 -105,9 -98,6 +98,9 @@@@ config ARCH_HAS_ILOG2_U3
   config ARCH_HAS_ILOG2_U64
        def_bool n
   
+ +config ARCH_HAS_CPU_IDLE_WAIT
+ +     def_bool y
+ +
   config GENERIC_CALIBRATE_DELAY
        def_bool y
   
@@@@ -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
@@@@ -145,21 -146,12 -148,21 +151,21 @@@@ config GENERIC_PENDING_IR
   
   config X86_SMP
        bool
 -      depends on X86_32 && SMP && !X86_VOYAGER
 +      depends on SMP && ((X86_32 && !X86_VOYAGER) || X86_64)
        default y
   
 + config X86_32_SMP
 +      def_bool y
 +      depends on X86_32 && SMP
 + 
 + config X86_64_SMP
 +      def_bool y
 +      depends on X86_64 && SMP
 + 
   config X86_HT
        bool
 -      depends on SMP && !(X86_VISWS || X86_VOYAGER || MK8)
 +      depends on SMP
 +      depends on (X86_32 && !(X86_VISWS || X86_VOYAGER)) || (X86_64 && !MK8)
        default y
   
   config X86_BIOS_REBOOT
@@@@ -202,7 -194,8 -205,7 +208,7 @@@@ config SM
          Y to "Enhanced Real Time Clock Support", below. The "Advanced Power
          Management" code will be disabled if you say Y here.
   
 -        See also the <file:Documentation/smp.txt>,
 -        <file:Documentation/i386/IO-APIC.txt>,
 +        See also <file:Documentation/i386/IO-APIC.txt>,
          <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
          <http://www.tldp.org/docs.html#howto>.
   
@@@@ -300,19 -293,6 -303,19 +306,19 @@@@ config X86_ES700
          Only choose this option if you have such a system, otherwise you
          should say N here.
   
 + config X86_RDC321X
 +      bool "RDC R-321x SoC"
 +      depends on X86_32
 +      select M486
 +      select X86_REBOOTFIXUPS
 +      select GENERIC_GPIO
 +      select LEDS_CLASS
 +      select LEDS_GPIO
 +      help
 +        This option is needed for RDC R-321x system-on-chip, also known
 +        as R-8610-(G).
 +        If you don't have one of these chips, you should say N here.
 + 
   config X86_VSMP
        bool "Support for ScaleMP vSMP"
        depends on X86_64 && PCI
   endchoice
   
   config SCHED_NO_NO_OMIT_FRAME_POINTER
 -      bool "Single-depth WCHAN output"
 -      default y
 +      def_bool y
 +      prompt "Single-depth WCHAN output"
        depends on X86_32
        help
          Calculate simpler /proc/<PID>/wchan values. If this option
   
          If in doubt, say "Y".
   
 - config PARAVIRT
 -      bool
 -      depends on X86_32 && !(X86_VISWS || X86_VOYAGER)
 -      help
 -        This changes the kernel so it can modify itself when it is run
 -        under a hypervisor, potentially improving performance significantly
 -        over full virtualization.  However, when run without a hypervisor
 -        the kernel is theoretically slower and slightly larger.
 - 
   menuconfig PARAVIRT_GUEST
        bool "Paravirtualized guest support"
 -      depends on X86_32
        help
          Say Y here to get to see options related to running Linux under
          various hypervisors.  This option alone does not add any kernel code.
@@@@ -350,7 -340,6 -353,7 +356,7 @@@@ source "arch/x86/xen/Kconfig
   config VMI
        bool "VMI Guest support"
        select PARAVIRT
 +      depends on X86_32
        depends on !(X86_VISWS || X86_VOYAGER)
        help
          VMI provides a paravirtualized interface to the VMware ESX server
   
   source "arch/x86/lguest/Kconfig"
   
 + config PARAVIRT
 +      bool "Enable paravirtualization code"
 +      depends on !(X86_VISWS || X86_VOYAGER)
 +      help
 +        This changes the kernel so it can modify itself when it is run
 +        under a hypervisor, potentially improving performance significantly
 +        over full virtualization.  However, when run without a hypervisor
 +        the kernel is theoretically slower and slightly larger.
 + 
   endif
   
   config ACPI_SRAT
 -      bool
 -      default y
 +      def_bool y
        depends on X86_32 && ACPI && NUMA && (X86_SUMMIT || X86_GENERICARCH)
        select ACPI_NUMA
   
   config HAVE_ARCH_PARSE_SRAT
 -        bool
 -        default y
 -        depends on ACPI_SRAT
 +      def_bool y
 +      depends on ACPI_SRAT
   
   config X86_SUMMIT_NUMA
 -      bool
 -      default y
 +      def_bool y
        depends on X86_32 && NUMA && (X86_SUMMIT || X86_GENERICARCH)
   
   config X86_CYCLONE_TIMER
 -      bool
 -      default y
 +      def_bool y
        depends on X86_32 && X86_SUMMIT || X86_GENERICARCH
   
   config ES7000_CLUSTERED_APIC
 -      bool
 -      default y
 +      def_bool y
        depends on SMP && X86_ES7000 && MPENTIUMIII
   
   source "arch/x86/Kconfig.cpu"
   
   config HPET_TIMER
 -      bool
 +      def_bool X86_64
        prompt "HPET Timer Support" if X86_32
 -      default X86_64
        help
            Use the IA-PC HPET (High Precision Event Timer) to manage
            time in preference to the PIT and RTC, if a HPET is
            Choose N to continue using the legacy 8254 timer.
   
   config HPET_EMULATE_RTC
 -      bool
 -      depends on HPET_TIMER && RTC=y
 -      default y
 +      def_bool y
 +      depends on HPET_TIMER && (RTC=y || RTC=m || RTC_DRV_CMOS=m || RTC_DRV_CMOS=y)
   
   # Mark as embedded because too many people got it wrong.
   # The code disables itself when not needed.
@@@@ -455,8 -442,8 -458,8 +461,8 @@@@ config CALGARY_IOMM
          If unsure, say Y.
   
   config CALGARY_IOMMU_ENABLED_BY_DEFAULT
 -      bool "Should Calgary be enabled by default?"
 -      default y
 +      def_bool y
 +      prompt "Should Calgary be enabled by default?"
        depends on CALGARY_IOMMU
        help
          Should Calgary be enabled by default? if you choose 'y', Calgary
          Calgary anyway, pass 'iommu=calgary' on the kernel command line.
          If unsure, say Y.
   
 + config IOMMU_HELPER
 +      def_bool (CALGARY_IOMMU || GART_IOMMU)
 + 
   # need this always selected by IOMMU for the VIA workaround
   config SWIOTLB
        bool
@@@@ -503,9 -487,9 -506,9 +509,9 @@@@ config SCHED_SM
          N here.
   
   config SCHED_MC
 -      bool "Multi-core scheduler support"
 +      def_bool y
 +      prompt "Multi-core scheduler support"
        depends on (X86_64 && SMP) || (X86_32 && X86_HT)
 -      default y
        help
          Multi-core scheduler support improves the CPU scheduler's decision
          making when dealing with multi-core CPU chips at a cost of slightly
@@@@ -539,16 -523,19 -542,16 +545,16 @@@@ config X86_UP_IOAPI
          an IO-APIC, then the kernel will still run with no slowdown at all.
   
   config X86_LOCAL_APIC
 -      bool
 +      def_bool y
        depends on X86_64 || (X86_32 && (X86_UP_APIC || ((X86_VISWS || SMP) && !X86_VOYAGER) || X86_GENERICARCH))
 -      default y
   
   config X86_IO_APIC
 -      bool
 +      def_bool y
        depends on X86_64 || (X86_32 && (X86_UP_IOAPIC || (SMP && !(X86_VISWS || X86_VOYAGER)) || X86_GENERICARCH))
 -      default y
   
   config X86_VISWS_APIC
 -      bool
 +      def_bool y
        depends on X86_32 && X86_VISWS
 -      default y
   
   config X86_MCE
        bool "Machine Check Exception"
          the 386 and 486, so nearly everyone can say Y here.
   
   config X86_MCE_INTEL
 -      bool "Intel MCE features"
 +      def_bool y
 +      prompt "Intel MCE features"
        depends on X86_64 && X86_MCE && X86_LOCAL_APIC
 -      default y
        help
           Additional support for intel specific MCE features such as
           the thermal monitor.
   
   config X86_MCE_AMD
 -      bool "AMD MCE features"
 +      def_bool y
 +      prompt "AMD MCE features"
        depends on X86_64 && X86_MCE && X86_LOCAL_APIC
 -      default y
        help
           Additional support for AMD specific MCE features such as
           the DRAM Error Threshold.
@@@@ -651,9 -638,9 -654,9 +657,9 @@@@ config I8
          Say N otherwise.
   
   config X86_REBOOTFIXUPS
 -      bool "Enable X86 board specific fixups for reboot"
 +      def_bool n
 +      prompt "Enable X86 board specific fixups for reboot"
        depends on X86_32 && X86
 -      default n
        ---help---
          This enables chipset and/or board specific fixups to be done
          in order to get reboot to work correctly. This is only needed on
          system.
   
          Currently, the only fixup is for the Geode machines using
 -        CS5530A and CS5536 chipsets.
 +        CS5530A and CS5536 chipsets and the RDC R-321x SoC.
   
          Say Y if you want to enable the fixup. Currently, it's safe to
          enable this option even if you don't need it.
@@@@ -686,8 -673,9 -689,8 +692,8 @@@@ config MICROCOD
          module will be called microcode.
   
   config MICROCODE_OLD_INTERFACE
 -      bool
 +      def_bool y
        depends on MICROCODE
 -      default y
   
   config X86_MSR
        tristate "/dev/cpu/*/msr - Model-specific register support"
@@@@ -811,12 -799,13 -814,12 +817,12 @@@@ config PAGE_OFFSE
        depends on X86_32
   
   config HIGHMEM
 -      bool
 +      def_bool y
        depends on X86_32 && (HIGHMEM64G || HIGHMEM4G)
 -      default y
   
   config X86_PAE
 -      bool "PAE (Physical Address Extension) Support"
 -      default n
 +      def_bool n
 +      prompt "PAE (Physical Address Extension) Support"
        depends on X86_32 && !HIGHMEM4G
        select RESOURCES_64BIT
        help
@@@@ -848,10 -837,10 -851,10 +854,10 @@@@ comment "NUMA (Summit) requires SMP, 64
        depends on X86_32 && X86_SUMMIT && (!HIGHMEM64G || !ACPI)
   
   config K8_NUMA
 -        bool "Old style AMD Opteron NUMA detection"
 -        depends on X86_64 && NUMA && PCI
 -        default y
 -        help
 +      def_bool y
 +      prompt "Old style AMD Opteron NUMA detection"
 +      depends on X86_64 && NUMA && PCI
 +      help
         Enable K8 NUMA node topology detection.  You should say Y here if
         you have a multi processor AMD K8 system. This uses an old
         method to read the NUMA configuration directly from the builtin
         instead, which also takes priority if both are compiled in.
   
   config X86_64_ACPI_NUMA
 -      bool "ACPI NUMA detection"
 +      def_bool y
 +      prompt "ACPI NUMA detection"
        depends on X86_64 && NUMA && ACPI && PCI
        select ACPI_NUMA
 -      default y
        help
          Enable ACPI SRAT based node topology detection.
   
@@@@ -876,53 -865,52 -879,53 +882,53 @@@@ config NUMA_EM
   
   config NODES_SHIFT
        int
 +      range 1 15  if X86_64
        default "6" if X86_64
        default "4" if X86_NUMAQ
        default "3"
        depends on NEED_MULTIPLE_NODES
   
   config HAVE_ARCH_BOOTMEM_NODE
 -      bool
 +      def_bool y
        depends on X86_32 && NUMA
 -      default y
   
   config ARCH_HAVE_MEMORY_PRESENT
 -      bool
 +      def_bool y
        depends on X86_32 && DISCONTIGMEM
 -      default y
   
   config NEED_NODE_MEMMAP_SIZE
 -      bool
 +      def_bool y
        depends on X86_32 && (DISCONTIGMEM || SPARSEMEM)
 -      default y
   
   config HAVE_ARCH_ALLOC_REMAP
 -      bool
 +      def_bool y
        depends on X86_32 && NUMA
 -      default y
   
   config ARCH_FLATMEM_ENABLE
        def_bool y
 -      depends on (X86_32 && ARCH_SELECT_MEMORY_MODEL && X86_PC) || (X86_64 && !NUMA)
 +      depends on X86_32 && ARCH_SELECT_MEMORY_MODEL && X86_PC && !NUMA
   
   config ARCH_DISCONTIGMEM_ENABLE
        def_bool y
 -      depends on NUMA
 +      depends on NUMA && X86_32
   
   config ARCH_DISCONTIGMEM_DEFAULT
        def_bool y
 -      depends on NUMA
 +      depends on NUMA && X86_32
 + 
 + config ARCH_SPARSEMEM_DEFAULT
 +      def_bool y
 +      depends on X86_64
   
   config ARCH_SPARSEMEM_ENABLE
        def_bool y
 -      depends on NUMA || (EXPERIMENTAL && (X86_PC || X86_64))
 +      depends on X86_64 || NUMA || (EXPERIMENTAL && X86_PC)
        select SPARSEMEM_STATIC if X86_32
        select SPARSEMEM_VMEMMAP_ENABLE if X86_64
   
   config ARCH_SELECT_MEMORY_MODEL
        def_bool y
 -      depends on X86_32 && ARCH_SPARSEMEM_ENABLE
 +      depends on ARCH_SPARSEMEM_ENABLE
   
   config ARCH_MEMORY_PROBE
        def_bool X86_64
@@@@ -1000,32 -988,42 -1003,32 +1006,32 @@@@ config MTR
          See <file:Documentation/mtrr.txt> for more information.
   
   config EFI
 -      bool "Boot from EFI support"
 -      depends on X86_32 && ACPI
 -      default n
 +      def_bool n
 +      prompt "EFI runtime service support"
 +      depends on ACPI
        ---help---
 -      This enables the kernel to boot on EFI platforms using
 -      system configuration information passed to it from the firmware.
 -      This also enables the kernel to use any EFI runtime services that are
 +      This enables the kernel to use EFI runtime services that are
        available (such as the EFI variable services).
   
 -      This option is only useful on systems that have EFI firmware
 -      and will result in a kernel image that is ~8k larger.  In addition,
 -      you must use the latest ELILO loader available at
 -      <http://elilo.sourceforge.net> in order to take advantage of
 -      kernel initialization using EFI information (neither GRUB nor LILO know
 -      anything about EFI).  However, even with this option, the resultant
 -      kernel should continue to boot on existing non-EFI platforms.
 +      This option is only useful on systems that have EFI firmware.
 +      In addition, you should use the latest ELILO loader available
 +      at <http://elilo.sourceforge.net> in order to take advantage
 +      of EFI runtime services. However, even with this option, the
 +      resultant kernel should continue to boot on existing non-EFI
 +      platforms.
   
   config IRQBALANCE
 -      bool "Enable kernel irq balancing"
 +      def_bool y
 +      prompt "Enable kernel irq balancing"
        depends on X86_32 && SMP && X86_IO_APIC
 -      default y
        help
          The default yes will allow the kernel to do irq load balancing.
          Saying no will keep the kernel from doing irq load balancing.
   
 - # turning this on wastes a bunch of space.
 - # Summit needs it only when NUMA is on
 - config BOOT_IOREMAP
 -      bool
 -      depends on X86_32 && (((X86_SUMMIT || X86_GENERICARCH) && NUMA) || (X86 && EFI))
 -      default y
 - 
   config SECCOMP
 -      bool "Enable seccomp to safely compute untrusted bytecode"
 +      def_bool y
 +      prompt "Enable seccomp to safely compute untrusted bytecode"
        depends on PROC_FS
 -      default y
        help
          This kernel feature is useful for number crunching applications
          that may need to compute untrusted bytecode during their
@@@@ -1192,11 -1190,11 -1195,11 +1198,11 @@@@ config HOTPLUG_CP
          suspend.
   
   config COMPAT_VDSO
 -      bool "Compat VDSO support"
 -      default y
 -      depends on X86_32
 +      def_bool y
 +      prompt "Compat VDSO support"
 +      depends on X86_32 || IA32_EMULATION
        help
 -        Map the VDSO to the predictable old-style address too.
 +        Map the 32-bit VDSO to the predictable old-style address too.
        ---help---
          Say N here if you are running a sufficiently recent glibc
          version (2.3.3 or later), to remove the high-mapped
@@@@ -1210,26 -1208,30 -1213,26 +1216,26 @@@@ config ARCH_ENABLE_MEMORY_HOTPLU
        def_bool y
        depends on X86_64 || (X86_32 && HIGHMEM)
   
 - config MEMORY_HOTPLUG_RESERVE
 -      def_bool X86_64
 -      depends on (MEMORY_HOTPLUG && DISCONTIGMEM)
 - 
   config HAVE_ARCH_EARLY_PFN_TO_NID
        def_bool X86_64
        depends on NUMA
   
 - config OUT_OF_LINE_PFN_TO_PAGE
 -      def_bool X86_64
 -      depends on DISCONTIGMEM
 - 
   menu "Power management options"
        depends on !X86_VOYAGER
   
   config ARCH_HIBERNATION_HEADER
 -      bool
 +      def_bool y
        depends on X86_64 && HIBERNATION
 -      default y
   
   source "kernel/power/Kconfig"
   
   source "drivers/acpi/Kconfig"
   
 + config X86_APM_BOOT
 +      bool
 +      default y
 +      depends on APM || APM_MODULE
 + 
   menuconfig APM
        tristate "APM (Advanced Power Management) BIOS support"
        depends on X86_32 && PM_SLEEP && !X86_VISWS
@@@@ -1370,7 -1372,7 -1373,7 +1376,7 @@@@ menu "Bus options (PCI etc.)
   config PCI
        bool "PCI support" if !X86_VISWS
        depends on !X86_VOYAGER
 -      default y if X86_VISWS
 +      default y
        select ARCH_SUPPORTS_MSI if (X86_LOCAL_APIC && X86_IO_APIC)
        help
          Find out whether you have a PCI motherboard. PCI is the name of a
          your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or
          VESA. If you have PCI, say Y, otherwise N.
   
 -        The PCI-HOWTO, available from
 -        <http://www.tldp.org/docs.html#howto>, contains valuable
 -        information about which PCI hardware does work under Linux and which
 -        doesn't.
 - 
   choice
        prompt "PCI access mode"
        depends on X86_32 && PCI && !X86_VISWS
@@@@ -1412,21 -1419,25 -1415,21 +1418,21 @@@@ config PCI_GOAN
   endchoice
   
   config PCI_BIOS
 -      bool
 +      def_bool y
        depends on X86_32 && !X86_VISWS && PCI && (PCI_GOBIOS || PCI_GOANY)
 -      default y
   
   # x86-64 doesn't support PCI BIOS access from long mode so always go direct.
   config PCI_DIRECT
 -      bool
 +      def_bool y
        depends on PCI && (X86_64 || (PCI_GODIRECT || PCI_GOANY) || X86_VISWS)
 -      default y
   
   config PCI_MMCONFIG
 -      bool
 +      def_bool y
        depends on X86_32 && PCI && ACPI && (PCI_GOMMCONFIG || PCI_GOANY)
 -      default y
   
   config PCI_DOMAINS
 -      bool
 +      def_bool y
        depends on PCI
 -      default y
   
   config PCI_MMCONFIG
        bool "Support mmconfig PCI config space access"
@@@@ -1443,9 -1454,9 -1446,9 +1449,9 @@@@ config DMA
          remapping devices.
   
   config DMAR_GFX_WA
 -      bool "Support for Graphics workaround"
 +      def_bool y
 +      prompt "Support for Graphics workaround"
        depends on DMAR
 -      default y
        help
         Current Graphics drivers tend to use physical address
         for DMA and avoid using DMA APIs. Setting this config
         to use physical addresses for DMA.
   
   config DMAR_FLOPPY_WA
 -      bool
 +      def_bool y
        depends on DMAR
 -      default y
        help
         Floppy disk drivers are know to bypass DMA API calls
         thereby failing to work when IOMMU is enabled. This
@@@@ -1468,7 -1480,8 -1471,7 +1474,7 @@@@ source "drivers/pci/Kconfig
   
   # x86_64 have no ISA slots, but do have ISA-style DMA.
   config ISA_DMA_API
 -      bool
 -      default y
 +      def_bool y
   
   if X86_32
   
@@@@ -1534,9 -1547,9 -1537,9 +1540,9 @@@@ config SCx200HR_TIME
          other workaround is idle=poll boot option.
   
   config GEODE_MFGPT_TIMER
 -      bool "Geode Multi-Function General Purpose Timer (MFGPT) events"
 +      def_bool y
 +      prompt "Geode Multi-Function General Purpose Timer (MFGPT) events"
        depends on MGEODE_LX && GENERIC_TIME && GENERIC_CLOCKEVENTS
 -      default y
        help
          This driver provides a clock event source based on the MFGPT
          timer(s) in the CS5535 and CS5536 companion chip for the geode.
@@@@ -1563,7 -1576,6 -1566,7 +1569,7 @@@@ source "fs/Kconfig.binfmt
   config IA32_EMULATION
        bool "IA32 Emulation"
        depends on X86_64
 +      select COMPAT_BINFMT_ELF
        help
          Include code to run 32-bit programs under a 64-bit kernel. You should
          likely turn this on, unless you're 100% sure that you don't have any
@@@@ -1576,16 -1588,18 -1579,16 +1582,16 @@@@ config IA32_AOU
            Support old a.out binaries in the 32bit emulation.
   
   config COMPAT
 -      bool
 +      def_bool y
        depends on IA32_EMULATION
 -      default y
   
   config COMPAT_FOR_U64_ALIGNMENT
        def_bool COMPAT
        depends on X86_64
   
   config SYSVIPC_COMPAT
 -      bool
 +      def_bool y
        depends on X86_64 && COMPAT && SYSVIPC
 -      default y
   
   endmenu
   
@@@@ -1598,12 -1612,12 -1601,12 +1604,12 @@@@ source "drivers/firmware/Kconfig
   
   source "fs/Kconfig"
   
 - source "kernel/Kconfig.instrumentation"
 - 
   source "arch/x86/Kconfig.debug"
   
   source "security/Kconfig"
   
   source "crypto/Kconfig"
   
 + source "arch/x86/kvm/Kconfig"
 + 
   source "lib/Kconfig"
   #include <linux/dmi.h>
   #include <linux/moduleparam.h>
   #include <linux/sched.h>     /* need_resched() */
 - #include <linux/latency.h>
 + #include <linux/pm_qos_params.h>
   #include <linux/clockchips.h>
   #include <linux/cpuidle.h>
   
@@@@ -76,11 -76,7 -76,11 +76,11 @@@@ static void (*pm_idle_save) (void) __re
   #define PM_TIMER_TICKS_TO_US(p)              (((p) * 1000)/(PM_TIMER_FREQUENCY/1000))
   
   static unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER;
 + #ifdef CONFIG_CPU_IDLE
   module_param(max_cstate, uint, 0000);
 + #else
 + module_param(max_cstate, uint, 0644);
 + #endif
   static unsigned int nocst __read_mostly;
   module_param(nocst, uint, 0000);
   
@@@@ -98,6 -94,9 -98,6 +98,9 @@@@ module_param(bm_history, uint, 0644)
   
   static int acpi_processor_set_power_policy(struct acpi_processor *pr);
   
+ +#else        /* CONFIG_CPU_IDLE */
+ +static unsigned int latency_factor __read_mostly = 2;
+ +module_param(latency_factor, uint, 0644);
   #endif
   
   /*
@@@@ -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
@@@@ -256,12 -242,25 -260,12 +263,12 @@@@ acpi_processor_power_activate(struct ac
        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;
 - }
 - 
   static atomic_t c3_cpu_count;
   
   /* Common C-state entry for C2, C3, .. */
   static void acpi_cstate_enter(struct acpi_processor_cx *cstate)
   {
--      if (cstate->space_id == ACPI_CSTATE_FFH) {
++      if (cstate->entry_method == ACPI_CSTATE_FFH) {
                /* Call into architectural FFH based C-state */
                acpi_processor_ffh_cstate_enter(cstate);
        } else {
@@@@ -357,26 -356,6 -361,26 +364,26 @@@@ int acpi_processor_resume(struct acpi_d
        return 0;
   }
   
 + #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86_TSC)
 + static int tsc_halts_in_c(int state)
 + {
 +      switch (boot_cpu_data.x86_vendor) {
 +      case X86_VENDOR_AMD:
 +              /*
 +               * AMD Fam10h TSC will tick in all
 +               * C/P/S0/S1 states when this bit is set.
 +               */
 +              if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC))
 +                      return 0;
 +              /*FALL THROUGH*/
 +      case X86_VENDOR_INTEL:
 +              /* Several cases known where TSC halts in C2 too */
 +      default:
 +              return state > ACPI_STATE_C1;
 +      }
 + }
 + #endif
 + 
   #ifndef CONFIG_CPU_IDLE
   static void acpi_processor_idle(void)
   {
                        pm_idle_save();
                else
                        acpi_safe_halt();
++ 
++              local_irq_enable();
                return;
        }
   
                 *       skew otherwise.
                 */
                sleep_ticks = 0xFFFFFFFF;
++              local_irq_enable();
                break;
   
        case ACPI_STATE_C2:
   
   #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86_TSC)
                /* TSC halts in C2, so notify users */
 -              mark_tsc_unstable("possible TSC halt in C2");
 +              if (tsc_halts_in_c(ACPI_STATE_C2))
 +                      mark_tsc_unstable("possible TSC halt in C2");
   #endif
                /* Compute time (ticks) that we were actually asleep */
                sleep_ticks = ticks_elapsed(t1, t2);
                break;
   
        case ACPI_STATE_C3:
 +              acpi_unlazy_tlb(smp_processor_id());
 +              /*
 +               * Must be done before busmaster disable as we might
 +               * need to access HPET !
 +               */
 +              acpi_state_timer_broadcast(pr, cx, 1);
                /*
                 * disable bus master
                 * bm_check implies we need ARB_DIS
                /* Get start time (ticks) */
                t1 = inl(acpi_gbl_FADT.xpm_timer_block.address);
                /* Invoke C3 */
 -              acpi_state_timer_broadcast(pr, cx, 1);
                /* Tell the scheduler that we are going deep-idle: */
                sched_clock_idle_sleep_event();
                acpi_cstate_enter(cx);
   
   #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86_TSC)
                /* TSC halts in C3, so notify users */
 -              mark_tsc_unstable("TSC halts in C3");
 +              if (tsc_halts_in_c(ACPI_STATE_C3))
 +                      mark_tsc_unstable("TSC halts in C3");
   #endif
                /* Compute time (ticks) that we were actually asleep */
                sleep_ticks = ticks_elapsed(t1, t2);
        if (cx->promotion.state &&
            ((cx->promotion.state - pr->power.states) <= max_cstate)) {
                if (sleep_ticks > cx->promotion.threshold.ticks &&
 -                cx->promotion.state->latency <= system_latency_constraint()) {
 +                cx->promotion.state->latency <=
 +                              pm_qos_requirement(PM_QOS_CPU_DMA_LATENCY)) {
                        cx->promotion.count++;
                        cx->demotion.count = 0;
                        if (cx->promotion.count >=
         * or if the latency of the current state is unacceptable
         */
        if ((pr->power.state - pr->power.states) > max_cstate ||
 -              pr->power.state->latency > system_latency_constraint()) {
 +              pr->power.state->latency >
 +                              pm_qos_requirement(PM_QOS_CPU_DMA_LATENCY)) {
                if (cx->demotion.state)
                        next_state = cx->demotion.state;
        }
@@@@ -922,20 -892,20 -929,20 +932,20 @@@@ static int acpi_processor_get_power_inf
                cx.address = reg->address;
                cx.index = current_count + 1;
   
--              cx.space_id = ACPI_CSTATE_SYSTEMIO;
++              cx.entry_method = ACPI_CSTATE_SYSTEMIO;
                if (reg->space_id == ACPI_ADR_SPACE_FIXED_HARDWARE) {
                        if (acpi_processor_ffh_cstate_probe
                                        (pr->id, &cx, reg) == 0) {
--                              cx.space_id = ACPI_CSTATE_FFH;
--                      } else if (cx.type != ACPI_STATE_C1) {
++                              cx.entry_method = ACPI_CSTATE_FFH;
++                      } else if (cx.type == ACPI_STATE_C1) {
                                /*
                                 * C1 is a special case where FIXED_HARDWARE
                                 * can be handled in non-MWAIT way as well.
                                 * In that case, save this _CST entry info.
--                               * That is, we retain space_id of SYSTEM_IO for
--                               * halt based C1.
                                 * Otherwise, ignore this info and continue.
                                 */
++                              cx.entry_method = ACPI_CSTATE_HALT;
++                      } else {
                                continue;
                        }
                }
@@@@ -1202,7 -1172,7 -1209,7 +1212,7 @@@@ static int acpi_processor_power_seq_sho
                   "maximum allowed latency: %d usec\n",
                   pr->power.state ? pr->power.state - pr->power.states : 0,
                   max_cstate, (unsigned)pr->power.bm_activity,
 -                 system_latency_constraint());
 +                 pm_qos_requirement(PM_QOS_CPU_DMA_LATENCY));
   
        seq_puts(seq, "states:\n");
   
@@@@ -1369,12 -1339,12 -1376,16 +1379,16 @@@@ static inline void acpi_idle_update_bm_
   /**
    * acpi_idle_do_entry - a helper function that does C2 and C3 type entry
    * @cx: cstate data
++  *
++  * Caller disables interrupt before call and enables interrupt after return.
    */
   static inline void acpi_idle_do_entry(struct acpi_processor_cx *cx)
   {
--      if (cx->space_id == ACPI_CSTATE_FFH) {
++      if (cx->entry_method == ACPI_CSTATE_FFH) {
                /* Call into architectural FFH based C-state */
                acpi_processor_ffh_cstate_enter(cx);
++      } else if (cx->entry_method == ACPI_CSTATE_HALT) {
++              acpi_safe_halt();
        } else {
                int unused;
                /* IO port based C-state */
   static int acpi_idle_enter_c1(struct cpuidle_device *dev,
                              struct cpuidle_state *state)
   {
++      u32 t1, t2;
        struct acpi_processor *pr;
        struct acpi_processor_cx *cx = cpuidle_get_statedata(state);
++ 
        pr = processors[smp_processor_id()];
   
        if (unlikely(!pr))
                return 0;
   
++      local_irq_disable();
        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);
   }
   
   /**
@@@@ -1424,8 -1402,6 -1441,8 +1444,8 @@@@ static int acpi_idle_enter_simple(struc
        struct acpi_processor *pr;
        struct acpi_processor_cx *cx = cpuidle_get_statedata(state);
        u32 t1, t2;
 +      int sleep_ticks = 0;
 + 
        pr = processors[smp_processor_id()];
   
        if (unlikely(!pr))
        if (acpi_idle_suspend)
                return(acpi_idle_enter_c1(dev, state));
   
 -      if (pr->flags.bm_check)
 -              acpi_idle_update_bm_rld(pr, cx);
 - 
        local_irq_disable();
        current_thread_info()->status &= ~TS_POLLING;
        /*
                return 0;
        }
   
 +      acpi_unlazy_tlb(smp_processor_id());
 +      /*
 +       * Must be done before busmaster disable as we might need to
 +       * access HPET !
 +       */
 +      acpi_state_timer_broadcast(pr, cx, 1);
 + 
 +      if (pr->flags.bm_check)
 +              acpi_idle_update_bm_rld(pr, cx);
 + 
        if (cx->type == ACPI_STATE_C3)
                ACPI_FLUSH_CPU_CACHE();
   
        t1 = inl(acpi_gbl_FADT.xpm_timer_block.address);
 -      acpi_state_timer_broadcast(pr, cx, 1);
 +      /* Tell the scheduler that we are going deep-idle: */
 +      sched_clock_idle_sleep_event();
        acpi_idle_do_entry(cx);
        t2 = inl(acpi_gbl_FADT.xpm_timer_block.address);
   
   #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86_TSC)
        /* TSC could halt in idle, so notify users */
 -      mark_tsc_unstable("TSC halts in idle");;
 +      if (tsc_halts_in_c(cx->type))
 +              mark_tsc_unstable("TSC halts in idle");;
   #endif
 +      sleep_ticks = ticks_elapsed(t1, t2);
 + 
 +      /* Tell the scheduler how much we idled: */
 +      sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS);
   
        local_irq_enable();
        current_thread_info()->status |= TS_POLLING;
        cx->usage++;
   
        acpi_state_timer_broadcast(pr, cx, 0);
 -      cx->time += ticks_elapsed(t1, t2);
 +      cx->time += sleep_ticks;
        return ticks_elapsed_in_us(t1, t2);
   }
   
@@@@ -1503,8 -1466,6 -1520,8 +1523,8 @@@@ static int acpi_idle_enter_bm(struct cp
        struct acpi_processor *pr;
        struct acpi_processor_cx *cx = cpuidle_get_statedata(state);
        u32 t1, t2;
 +      int sleep_ticks = 0;
 + 
        pr = processors[smp_processor_id()];
   
        if (unlikely(!pr))
        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;
        /*
                return 0;
        }
   
 +      /* Tell the scheduler that we are going deep-idle: */
 +      sched_clock_idle_sleep_event();
        /*
         * Must be done before busmaster disable as we might need to
         * access HPET !
         */
        acpi_state_timer_broadcast(pr, cx, 1);
   
 -      if (acpi_idle_bm_check()) {
 -              cx = pr->power.bm_state;
 - 
 -              acpi_idle_update_bm_rld(pr, cx);
 - 
 -              t1 = inl(acpi_gbl_FADT.xpm_timer_block.address);
 -              acpi_idle_do_entry(cx);
 -              t2 = inl(acpi_gbl_FADT.xpm_timer_block.address);
 -      } else {
 -              acpi_idle_update_bm_rld(pr, cx);
 +      acpi_idle_update_bm_rld(pr, cx);
   
 +      /*
 +       * disable bus master
 +       * bm_check implies we need ARB_DIS
 +       * !bm_check implies we need cache flush
 +       * bm_control implies whether we can do ARB_DIS
 +       *
 +       * That leaves a case where bm_check is set and bm_control is
 +       * not set. In that case we cannot do much, we enter C3
 +       * without doing anything.
 +       */
 +      if (pr->flags.bm_check && pr->flags.bm_control) {
                spin_lock(&c3_lock);
                c3_cpu_count++;
                /* Disable bus master arbitration when all CPUs are in C3 */
                if (c3_cpu_count == num_online_cpus())
                        acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1);
                spin_unlock(&c3_lock);
 +      } else if (!pr->flags.bm_check) {
 +              ACPI_FLUSH_CPU_CACHE();
 +      }
   
 -              t1 = inl(acpi_gbl_FADT.xpm_timer_block.address);
 -              acpi_idle_do_entry(cx);
 -              t2 = inl(acpi_gbl_FADT.xpm_timer_block.address);
 +      t1 = inl(acpi_gbl_FADT.xpm_timer_block.address);
 +      acpi_idle_do_entry(cx);
 +      t2 = inl(acpi_gbl_FADT.xpm_timer_block.address);
   
 +      /* Re-enable bus master arbitration */
 +      if (pr->flags.bm_check && pr->flags.bm_control) {
                spin_lock(&c3_lock);
 -              /* Re-enable bus master arbitration */
 -              if (c3_cpu_count == num_online_cpus())
 -                      acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0);
 +              acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0);
                c3_cpu_count--;
                spin_unlock(&c3_lock);
        }
   
   #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86_TSC)
        /* TSC could halt in idle, so notify users */
 -      mark_tsc_unstable("TSC halts in idle");
 +      if (tsc_halts_in_c(ACPI_STATE_C3))
 +              mark_tsc_unstable("TSC halts in idle");
   #endif
 +      sleep_ticks = ticks_elapsed(t1, t2);
 +      /* Tell the scheduler how much we idled: */
 +      sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS);
   
        local_irq_enable();
        current_thread_info()->status |= TS_POLLING;
        cx->usage++;
   
        acpi_state_timer_broadcast(pr, cx, 0);
 -      cx->time += ticks_elapsed(t1, t2);
 +      cx->time += sleep_ticks;
        return ticks_elapsed_in_us(t1, t2);
   }
   
@@@@ -1609,7 -1550,7 -1628,7 +1631,7 @@@@ struct cpuidle_driver acpi_idle_driver 
    */
   static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
   {
--      int i, count = 0;
++      int i, count = CPUIDLE_DRIVER_STATE_START;
        struct acpi_processor_cx *cx;
        struct cpuidle_state *state;
        struct cpuidle_device *dev = &pr->power.dev;
   
                snprintf(state->name, CPUIDLE_NAME_LEN, "C%d", i);
                state->exit_latency = cx->latency;
- -             state->target_residency = cx->latency * 6;
+ +             state->target_residency = cx->latency * latency_factor;
                state->power_usage = cx->power;
   
                state->flags = 0;
                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:
                        state->flags |= CPUIDLE_FLAG_BALANCED;
                        state->flags |= CPUIDLE_FLAG_TIME_VALID;
                        state->enter = acpi_idle_enter_simple;
 +                      dev->safe_state = state;
                        break;
   
                        case ACPI_STATE_C3:
                }
   
                count++;
++              if (count == CPUIDLE_STATE_MAX)
++                      break;
        }
   
        dev->state_count = count;
        if (!count)
                return -EINVAL;
   
 -      /* find the deepest state that can handle active BM */
 -      if (pr->flags.bm_check) {
 -              for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++)
 -                      if (pr->power.states[i].type == ACPI_STATE_C3)
 -                              break;
 -              pr->power.bm_state = &pr->power.states[i-1];
 -      }
 - 
        return 0;
   }
   
@@@@ -1714,15 -1661,13 -1736,15 +1739,15 @@@@ int __cpuinit acpi_processor_power_init
   
        if (!first_run) {
                dmi_check_system(processor_power_dmi_table);
 +              max_cstate = acpi_processor_cstate_check(max_cstate);
                if (max_cstate < ACPI_C_STATES_MAX)
                        printk(KERN_NOTICE
                               "ACPI: processor limited to max C-state %d\n",
                               max_cstate);
                first_run++;
 - #if !defined (CONFIG_CPU_IDLE) && defined (CONFIG_SMP)
 -              register_latency_notifier(&acpi_processor_latency_notifier);
 + #if !defined(CONFIG_CPU_IDLE) && defined(CONFIG_SMP)
 +              pm_qos_add_notifier(PM_QOS_CPU_DMA_LATENCY,
 +                              &acpi_processor_latency_notifier);
   #endif
        }
   
@@@@ -1809,8 -1754,7 -1831,8 +1834,8 @@@@ int acpi_processor_power_exit(struct ac
                 */
                cpu_idle_wait();
   #ifdef CONFIG_SMP
 -              unregister_latency_notifier(&acpi_processor_latency_notifier);
 +              pm_qos_remove_notifier(PM_QOS_CPU_DMA_LATENCY,
 +                              &acpi_processor_latency_notifier);
   #endif
        }
   #endif
   #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"
   
@@@@ -82,7 -82,7 -83,7 +83,7 @@@@ void cpuidle_uninstall_idle_handler(voi
   {
        if (enabled_devices && (pm_idle != pm_idle_old)) {
                pm_idle = pm_idle_old;
- -             cpu_idle_wait();
+ +             cpuidle_kick_cpus();
        }
   }
   
@@@@ -180,6 -180,6 -181,44 +181,44 @@@@ void cpuidle_disable_device(struct cpui
   
   EXPORT_SYMBOL_GPL(cpuidle_disable_device);
   
++ #ifdef CONFIG_ARCH_HAS_CPU_RELAX
++ static int poll_idle(struct cpuidle_device *dev, struct cpuidle_state *st)
++ {
++      ktime_t t1, t2;
++      s64 diff;
++      int ret;
++ 
++      t1 = ktime_get();
++      local_irq_enable();
++      while (!need_resched())
++              cpu_relax();
++ 
++      t2 = ktime_get();
++      diff = ktime_to_us(ktime_sub(t2, t1));
++      if (diff > INT_MAX)
++              diff = INT_MAX;
++ 
++      ret = (int) diff;
++      return ret;
++ }
++ 
++ static void poll_idle_init(struct cpuidle_device *dev)
++ {
++      struct cpuidle_state *state = &dev->states[0];
++ 
++      cpuidle_set_statedata(state, NULL);
++ 
++      snprintf(state->name, CPUIDLE_NAME_LEN, "C0 (poll idle)");
++      state->exit_latency = 0;
++      state->target_residency = 0;
++      state->power_usage = -1;
++      state->flags = CPUIDLE_FLAG_POLL | CPUIDLE_FLAG_TIME_VALID;
++      state->enter = poll_idle;
++ }
++ #else
++ static void poll_idle_init(struct cpuidle_device *dev) {}
++ #endif /* CONFIG_ARCH_HAS_CPU_RELAX */
++ 
   /**
    * cpuidle_register_device - registers a CPU's idle PM feature
    * @dev: the cpu
@@@@ -198,6 -198,6 -237,8 +237,8 @@@@ int cpuidle_register_device(struct cpui
   
        mutex_lock(&cpuidle_lock);
   
++      poll_idle_init(dev);
++ 
        per_cpu(cpuidle_devices, dev->cpu) = dev;
        list_add(&dev->device_list, &cpuidle_detected_devices);
        if ((ret = cpuidle_add_sysfs(sys_dev))) {
@@@@ -265,10 -265,7 -306,10 +306,10 @@@@ static struct notifier_block cpuidle_la
        .notifier_call = cpuidle_latency_notify,
   };
   
 - #define latency_notifier_init(x) do { register_latency_notifier(x); } while (0)
 + static inline void latency_notifier_init(struct notifier_block *n)
 + {
 +      pm_qos_add_notifier(PM_QOS_CPU_DMA_LATENCY, n);
 + }
   
   #else /* CONFIG_SMP */
   
diff --combined include/linux/cpuidle.h
@@@@ -46,9 -46,9 -46,10 +46,10 @@@@ struct cpuidle_state 
   /* Idle State Flags */
   #define CPUIDLE_FLAG_TIME_VALID      (0x01) /* is residency time measurable? */
   #define CPUIDLE_FLAG_CHECK_BM        (0x02) /* BM activity will exit state */
-- #define CPUIDLE_FLAG_SHALLOW (0x10) /* low latency, minimal savings */
-- #define CPUIDLE_FLAG_BALANCED        (0x20) /* medium latency, moderate savings */
-- #define CPUIDLE_FLAG_DEEP    (0x40) /* high latency, large savings */
++ #define CPUIDLE_FLAG_POLL    (0x10) /* no latency, no savings */
++ #define CPUIDLE_FLAG_SHALLOW (0x20) /* low latency, minimal savings */
++ #define CPUIDLE_FLAG_BALANCED        (0x40) /* medium latency, moderate savings */
++ #define CPUIDLE_FLAG_DEEP    (0x80) /* high latency, large savings */
   
   #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
   
@@@@ -72,6 -72,19 -73,6 +73,19 @@@@ cpuidle_set_statedata(struct cpuidle_st
        state->driver_data = data;
   }
   
+ +#ifdef CONFIG_SMP
+ +#ifdef CONFIG_ARCH_HAS_CPU_IDLE_WAIT
+ +static inline void cpuidle_kick_cpus(void)
+ +{
+ +     cpu_idle_wait();
+ +}
+ +#else /* !CONFIG_ARCH_HAS_CPU_IDLE_WAIT */
+ +#error "Arch needs cpu_idle_wait() equivalent here"
+ +#endif /* !CONFIG_ARCH_HAS_CPU_IDLE_WAIT */
+ +#else /* !CONFIG_SMP */
+ +static inline void cpuidle_kick_cpus(void) {}
+ +#endif /* !CONFIG_SMP */
+ +
   struct cpuidle_state_kobj {
        struct cpuidle_state *state;
        struct completion kobj_unregister;
   };
   
   struct cpuidle_device {
 -      int                     enabled:1;
 +      unsigned int            enabled:1;
        unsigned int            cpu;
   
        int                     last_residency;
        struct kobject          kobj;
        struct completion       kobj_unregister;
        void                    *governor_data;
 +      struct cpuidle_state    *safe_state;
   };
   
   DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices);
@@@@ -178,4 -190,4 -179,10 +192,10 @@@@ static inline void cpuidle_unregister_g
   
   #endif
   
++ #ifdef CONFIG_ARCH_HAS_CPU_RELAX
++ #define CPUIDLE_DRIVER_STATE_START   1
++ #else
++ #define CPUIDLE_DRIVER_STATE_START   0
++ #endif
++ 
   #endif /* _LINUX_CPUIDLE_H */