[git pull] Consolidate cpuidle functionality

Rob Lee rob.lee at linaro.org
Fri Mar 9 01:58:23 UTC 2012

Hello Stephen,

The following changes since commit 192cfd58774b4d17b2fe8bdc77d89c2ef4e0591d:

  Linux 3.3-rc6 (2012-03-03 17:08:09 -0800)

are available in the git repository at:
  git://git.linaro.org/people/rob_lee/linux.git cpuidle_consol_pull

Robert Lee (8):
      cpuidle: Add common time keeping and irq enabling
      ARM: at91: Consolidate time keeping and irq enable
      ARM: kirkwood: Consolidate time keeping and irq enable
      ARM: davinci: Consolidate time keeping and irq enable
      ARM: omap: Consolidate OMAP3 time keeping and irq enable
      ARM: omap: Consolidate OMAP4 time keeping and irq enable
      ARM: shmobile: Consolidate time keeping and irq enable
      SH: shmobile: Consolidate time keeping and irq enable

 arch/arm/include/asm/cpuidle.h        |   22 +++++++++
 arch/arm/kernel/Makefile              |    2 +-
 arch/arm/kernel/cpuidle.c             |   21 ++++++++
 arch/arm/mach-at91/cpuidle.c          |   67 ++++++++++-----------------
 arch/arm/mach-davinci/cpuidle.c       |   82 +++++++++++++-------------------
 arch/arm/mach-kirkwood/cpuidle.c      |   72 ++++++++--------------------
 arch/arm/mach-omap2/cpuidle34xx.c     |   42 +++++++----------
 arch/arm/mach-omap2/cpuidle44xx.c     |   21 +-------
 arch/arm/mach-shmobile/cpuidle.c      |   31 +++----------
 arch/sh/kernel/cpu/shmobile/cpuidle.c |   10 +---
 drivers/cpuidle/cpuidle.c             |   79 +++++++++++++++++++++++++------
 include/linux/cpuidle.h               |   13 +++++-
 12 files changed, 227 insertions(+), 235 deletions(-)
 create mode 100644 arch/arm/include/asm/cpuidle.h
 create mode 100644 arch/arm/kernel/cpuidle.c

The top-commit id is


Acked-by: Jean Pihet<j-pihet at ti.com>  (v6)
Tested-by: Jean Pihet<j-pihet at ti.com>  (v6, omap3)
Tested-by: Amit Daniel<amit.kachhap at linaro.org>  (v6, Exynos4)
Tested-by: Robert Lee<rob.lee at linaro.org>  (imx51, imx6q)
Reviewed-by: Kevin Hilman <khilman at ti.com>
Reviewed-by: Daniel Lezcano <daniel.lezcano at linaro.org>
Reviewed-by: Deepthi Dharwar<deepthi at linux.vnet.ibm.com> (core cpuidle only)

These changes move various functionality duplicated in platform
cpuidle drivers to the core cpuidle driver and common arch arm code. Also,
the irq disabling in the platform code was removed as all calls into
cpuidle_call_idle() will have already called local_irq_disable().

This patchset is bisect safe.  Also, the core cpuidle and arch changes of the
first commit do not require any changes to the arch and platform cpuidle
drivers, though those arch and platform change should be made to take
advantage of the new consolidation function.

Stephen, this patch has been reviewed, tested, and ACK'd per the list above but
cpuidle maintainer Len Brown has been out on vacation for a couple of weeks so
I am sending you this pull request as time is running out to get this into
v3.4.  I've had a brief communication with Andrew Morton about
this as well so he is aware of this situation.  I am fairly new to the
community so please let me know if you see anything that needs my attention or
anything I should be doing differently.

I've checked these changes against the recent linux-next tags and there is
currently one small conflict due to a small change in
arch/arm/mach-at91/cpuidle.c.  I'd be happy to assist in resolving this issue
if needed.  Also, in my patchset submissions I include changes for a
Samsung Exynos cpuidle platform driver patch that was accepted a couple of
weeks ago but it hasn't yet made it to an rc so I am not including it in this


patchset submission history:

v7 submission can be found here:

v7 changes:
* Made some  struct whitespace alignment changes.
* Fixed a coding style violation (thanks Jean Pihet)
* Fixed a bug in davinci cpuidle (thanks Jean Pihet)
* Corrected the common ARM cpuidle WFI state description to be ARM platform
 agnostic (thanks Kevin Hilman)
* Fixed the problem causing x86 and PPC builds to fail (thanks Deepthi)
* Re-added a line of code that was mistakenly removed (thanks Deepthi)

v6 submission can be found here:

v6 changes:
* Fixed mindless bug in CONFIG_ARCH_HAS_RELAX code in drivers/cpuidle/cpuidle.c
* Removed inline from wrapper function (thanks Mike Turquette and Rob Herring)
* Add zeroing out of last_residency if error value is returned (thanks Mike)
* Made drivers/cpuidle/cpuidle.c more intelligently handle en_core_tk_irqen
flag allowing removal of the if (en_core_tk_irqen) in cpuidle_idle_call (thanks
Daniel Lezcano)
* Moved CPUIDLE_ARM_WFI_STATE macro to arch/arm/include/asm/cpuidle.h (thanks
Jean Pihet)
* Cleaned up some comments and a stray change (thanks Jean)

v5 submission can be found here:

v5 changes:
* Added common cpu_do_idle function to core cpuidle
* Added time keep irq en wrapper to core cpuidle
* Removed pre/post enter
* Re-added platforms that can use new common code.

v4 submission can be found here:

v4 changes:
* Removed drivers/cpuidle/common.c
** Removed the initialization helper functions
** Removed the wrapper used to consolidate time keeping and irq enable/disable
* Add time keeping and local_irq_disable handling in cpuidle_call_idle().
* Made necessary modifications to a few platforms that required the most changes
** Note on omap3: changed structure of omap3_idle_drvdata and added
  per_next_state and per_saved_state vars to accomodate new framework.

v3 submission can be found here:

v3 changes:
* Made various code organization and style changes as suggested in v2 review.
 (thanks Mark Brown, Rob Herring, Mike Turquette, Kevin Hillman, Daniel Lezcano)
* Removed at91 use of common code.  A separate effort is underway to clean
at91 code and the author has offered to convert to common interface as part
of those changes (if this common interface is accepted in time).
* Made platform cpuidle_driver objects __initdata and dynamically added one
persistent instance of this object in common code.
* Removed imx5 pm usage of gpc_dvfs clock as it is no longer needed after
being enabled during clock initialization.
* Re-organized patches.

v2 submission can be found here:

v2 changes:
* Common interface moved to drivers/cpuidle and made non arch-specific.
* Made various fixes and suggested additions to the common cpuidle
code from v1 review. (Thanks Rob Herring and Mark Brown)
* Added callback for filling in driver_data field as needed.
* Modified the various platforms with these changes.

v1 submission can be found here:


More information about the linaro-dev mailing list