projects/linux·commit a335750b

Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux

a335750b · Linus Torvalds <[email protected]> · 2012-03-30 16:45:38 -07:00

Pull ACPI & Power Management changes from Len Brown:
 - ACPI 5.0 after-ripples, ACPICA/Linux divergence cleanup
 - cpuidle evolving, more ARM use
 - thermal sub-system evolving, ditto
 - assorted other PM bits

Fix up conflicts in various cpuidle implementations due to ARM cpuidle
cleanups (ARM at91 self-refresh and cpu idle code rewritten into
"standby" in asm conflicting with the consolidation of cpuidle time
keeping), trivial SH include file context conflict and RCU tracing fixes
in generic code.

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: (77 commits)
  ACPI throttling: fix endian bug in acpi_read_throttling_status()
  Disable MCP limit exceeded messages from Intel IPS driver
  ACPI video: Don't start video device until its associated input device has been allocated
  ACPI video: Harden video bus adding.
  ACPI: Add support for exposing BGRT data
  ACPI: export acpi_kobj
  ACPI: Fix logic for removing mappings in 'acpi_unmap'
  CPER failed to handle generic error records with multiple sections
  ACPI: Clean redundant codes in scan.c
  ACPI: Fix unprotected smp_processor_id() in acpi_processor_cst_has_changed()
  ACPI: consistently use should_use_kmap()
  PNPACPI: Fix device ref leaking in acpi_pnp_match
  ACPI: Fix use-after-free in acpi_map_lsapic
  ACPI: processor_driver: add missing kfree
  ACPI, APEI: Fix incorrect APEI register bit width check and usage
  Update documentation for parameter *notrigger* in einj.txt
  ACPI, APEI, EINJ, new parameter to control trigger action
  ACPI, APEI, EINJ, limit the range of einj_param
  ACPI, APEI, Fix ERST header length check
  cpuidle: power_usage should be declared signed integer
  ...
Commit
a335750b9a039a9d4cd727cdccacfb90fd63c4e8
Parents
10f3cb41 · d326f44e

Merge commit. Changes below are compared with the first parent: 10f3cb41.

Changes

103 files changed · +3192 −1555

FileStatusAddDelContent
Documentation/ABI/testing/sysfs-firmware-acpimodified+20−0View file
Documentation/acpi/apei/einj.txtmodified+8−0View file
Documentation/cpuidle/sysfs.txtmodified+5−0View file
arch/arm/include/asm/cpuidle.hadded+29−0View file
arch/arm/kernel/Makefilemodified+1−1View file
arch/arm/kernel/cpuidle.cadded+21−0View file
arch/arm/mach-at91/cpuidle.cmodified+19−40View file
arch/arm/mach-davinci/cpuidle.cmodified+34−49View file
arch/arm/mach-kirkwood/cpuidle.cmodified+21−51View file
arch/arm/mach-omap2/cpuidle34xx.cmodified+17−25View file
arch/arm/mach-omap2/cpuidle44xx.cmodified+3−18View file
arch/arm/mach-shmobile/cpuidle.cmodified+7−24View file
arch/sh/kernel/cpu/shmobile/cpuidle.cmodified+3−7View file
arch/x86/kernel/acpi/boot.cmodified+2−1View file
arch/x86/kernel/smpboot.cmodified+3−1View file
arch/x86/kernel/tboot.cmodified+6−3View file
drivers/acpi/Kconfigmodified+9−0View file
drivers/acpi/Makefilemodified+1−0View file
drivers/acpi/acpica/Makefilemodified+3−1View file
drivers/acpi/acpica/accommon.hmodified+0−1View file
drivers/acpi/acpica/acdebug.hmodified+5−3View file
drivers/acpi/acpica/acevents.hmodified+11−10View file
drivers/acpi/acpica/acglobal.hmodified+10−1View file
drivers/acpi/acpica/achware.hmodified+20−12View file
drivers/acpi/acpica/aclocal.hmodified+1−0View file
drivers/acpi/acpica/acmacros.hmodified+6−0View file
drivers/acpi/acpica/acnamesp.hmodified+3−2View file
drivers/acpi/acpica/actables.hmodified+5−0View file
drivers/acpi/acpica/evevent.cmodified+3−1View file
drivers/acpi/acpica/evglock.cmodified+3−1View file
drivers/acpi/acpica/evgpe.cmodified+3−1View file
drivers/acpi/acpica/evgpeblk.cmodified+3−1View file
drivers/acpi/acpica/evgpeinit.cmodified+3−1View file
drivers/acpi/acpica/evgpeutil.cmodified+3−0View file
drivers/acpi/acpica/evmisc.cmodified+16−10View file
drivers/acpi/acpica/evsci.cmodified+3−1View file
drivers/acpi/acpica/evxface.cmodified+220−216View file
drivers/acpi/acpica/evxfevnt.cmodified+2−0View file
drivers/acpi/acpica/evxfgpe.cmodified+2−0View file
drivers/acpi/acpica/hwacpi.cmodified+3−0View file
drivers/acpi/acpica/hwesleep.cadded+247−0View file
drivers/acpi/acpica/hwgpe.cmodified+3−1View file
drivers/acpi/acpica/hwregs.cmodified+13−3View file
drivers/acpi/acpica/hwsleep.cmodified+73−328View file
drivers/acpi/acpica/hwtimer.cmodified+2−0View file
drivers/acpi/acpica/hwxface.cmodified+14−36View file
drivers/acpi/acpica/hwxfsleep.cadded+431−0View file
drivers/acpi/acpica/nsdump.cmodified+14−1View file
drivers/acpi/acpica/nsdumpdv.cmodified+1−1View file
drivers/acpi/acpica/nspredef.cmodified+2−2View file
drivers/acpi/acpica/nsrepair.cmodified+58−101View file
drivers/acpi/acpica/nsutils.cmodified+1−1View file
drivers/acpi/acpica/tbfadt.cmodified+4−4View file
drivers/acpi/acpica/tbinstal.cmodified+97−20View file
drivers/acpi/acpica/tbutils.cmodified+52−43View file
drivers/acpi/acpica/utdecode.cmodified+18−16View file
drivers/acpi/acpica/utglobal.cmodified+8−1View file
drivers/acpi/acpica/utinit.cmodified+32−5View file
drivers/acpi/acpica/utxface.cmodified+5−1View file
drivers/acpi/apei/apei-base.cmodified+40−21View file
drivers/acpi/apei/cper.cmodified+2−0View file
drivers/acpi/apei/einj.cmodified+13−4View file
drivers/acpi/apei/erst.cmodified+1−1View file
drivers/acpi/bgrt.cadded+175−0View file
drivers/acpi/bus.cmodified+1−0View file
drivers/acpi/ec.cmodified+4−4View file
drivers/acpi/nvs.cmodified+2−2View file
drivers/acpi/osl.cmodified+38−86View file
drivers/acpi/power.cmodified+164−2View file
drivers/acpi/processor_driver.cmodified+48−14View file
drivers/acpi/processor_idle.cmodified+32−2View file
drivers/acpi/processor_thermal.cmodified+37−8View file
drivers/acpi/processor_throttling.cmodified+2−3View file
drivers/acpi/reboot.cmodified+1−2View file
drivers/acpi/scan.cmodified+8−4View file
drivers/acpi/sleep.cmodified+68−8View file
drivers/acpi/thermal.cmodified+4−4View file
drivers/acpi/video.cmodified+31−19View file
drivers/cpuidle/cpuidle.cmodified+89−8View file
drivers/cpuidle/driver.cmodified+1−1View file
drivers/cpuidle/governors/menu.cmodified+5−2View file
drivers/cpuidle/sysfs.cmodified+40−0View file
drivers/pci/pci-acpi.cmodified+3−37View file
drivers/platform/x86/intel_ips.cmodified+2−11View file
drivers/pnp/pnpacpi/core.cmodified+6−1View file
drivers/thermal/Kconfigmodified+8−0View file
drivers/thermal/Makefilemodified+1−0View file
drivers/thermal/spear_thermal.cadded+206−0View file
drivers/thermal/thermal_sys.cmodified+39−55View file
drivers/acpi/acpica/acconfig.h → include/acpi/acconfig.hrenamed+18−1View file
include/acpi/acexcep.hmodified+5−2View file
include/acpi/acnames.hmodified+6−6View file
include/acpi/acpi_bus.hmodified+7−0View file
include/acpi/acpiosxf.hmodified+7−6View file
include/acpi/acpixf.hmodified+160−69View file
include/acpi/actbl.hmodified+7−0View file
include/acpi/actypes.hmodified+20−2View file
include/linux/acpi.hmodified+10−0View file
include/linux/cpuidle.hmodified+19−3View file
include/linux/platform_data/spear_thermal.hadded+26−0View file
include/linux/tboot.hmodified+0−1View file
tools/power/x86/turbostat/turbostat.8modified+58−41View file
tools/power/x86/turbostat/turbostat.cmodified+166−79View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/ABI/testing/sysfs-firmware-acpi

View file
diff --git a/Documentation/ABI/testing/sysfs-firmware-acpi b/Documentation/ABI/testing/sysfs-firmware-acpi
index 4f9ba3c..dd930c8 100644
--- a/Documentation/ABI/testing/sysfs-firmware-acpi
+++ b/Documentation/ABI/testing/sysfs-firmware-acpi
@@ -1,3 +1,23 @@
+What: /sys/firmware/acpi/bgrt/
+Date: January 2012
+Contact: Matthew Garrett <[email protected]>
+Description:
+ The BGRT is an ACPI 5.0 feature that allows the OS
+ to obtain a copy of the firmware boot splash and
+ some associated metadata. This is intended to be used
+ by boot splash applications in order to interact with
+ the firmware boot splash in order to avoid jarring
+ transitions.
+
+ image: The image bitmap. Currently a 32-bit BMP.
+ status: 1 if the image is valid, 0 if firmware invalidated it.
+ type: 0 indicates image is in BMP format.
+ version: The version of the BGRT. Currently 1.
+ xoffset: The number of pixels between the left of the screen
+ and the left edge of the image.
+ yoffset: The number of pixels between the top of the screen
+ and the top edge of the image.
+
What: /sys/firmware/acpi/interrupts/
Date: February 2008
Contact: Len Brown <[email protected]>

Documentation/acpi/apei/einj.txt

View file
diff --git a/Documentation/acpi/apei/einj.txt b/Documentation/acpi/apei/einj.txt
index e7cc363..e20b6da 100644
--- a/Documentation/acpi/apei/einj.txt
+++ b/Documentation/acpi/apei/einj.txt
@@ -53,6 +53,14 @@ directory apei/einj. The following files are provided.
This file is used to set the second error parameter value. Effect of
parameter depends on error_type specified.
+- notrigger
+ The EINJ mechanism is a two step process. First inject the error, then
+ perform some actions to trigger it. Setting "notrigger" to 1 skips the
+ trigger phase, which *may* allow the user to cause the error in some other
+ context by a simple access to the cpu, memory location, or device that is
+ the target of the error injection. Whether this actually works depends
+ on what operations the BIOS actually includes in the trigger phase.
+
BIOS versions based in the ACPI 4.0 specification have limited options
to control where the errors are injected. Your BIOS may support an
extension (enabled with the param_extension=1 module parameter, or

Documentation/cpuidle/sysfs.txt

View file
diff --git a/Documentation/cpuidle/sysfs.txt b/Documentation/cpuidle/sysfs.txt
index 50d7b16..9d28a34 100644
--- a/Documentation/cpuidle/sysfs.txt
+++ b/Documentation/cpuidle/sysfs.txt
@@ -36,6 +36,7 @@ drwxr-xr-x 2 root root 0 Feb 8 10:42 state3
/sys/devices/system/cpu/cpu0/cpuidle/state0:
total 0
-r--r--r-- 1 root root 4096 Feb 8 10:42 desc
+-rw-r--r-- 1 root root 4096 Feb 8 10:42 disable
-r--r--r-- 1 root root 4096 Feb 8 10:42 latency
-r--r--r-- 1 root root 4096 Feb 8 10:42 name
-r--r--r-- 1 root root 4096 Feb 8 10:42 power
@@ -45,6 +46,7 @@ total 0
/sys/devices/system/cpu/cpu0/cpuidle/state1:
total 0
-r--r--r-- 1 root root 4096 Feb 8 10:42 desc
+-rw-r--r-- 1 root root 4096 Feb 8 10:42 disable
-r--r--r-- 1 root root 4096 Feb 8 10:42 latency
-r--r--r-- 1 root root 4096 Feb 8 10:42 name
-r--r--r-- 1 root root 4096 Feb 8 10:42 power
@@ -54,6 +56,7 @@ total 0
/sys/devices/system/cpu/cpu0/cpuidle/state2:
total 0
-r--r--r-- 1 root root 4096 Feb 8 10:42 desc
+-rw-r--r-- 1 root root 4096 Feb 8 10:42 disable
-r--r--r-- 1 root root 4096 Feb 8 10:42 latency
-r--r--r-- 1 root root 4096 Feb 8 10:42 name
-r--r--r-- 1 root root 4096 Feb 8 10:42 power
@@ -63,6 +66,7 @@ total 0
/sys/devices/system/cpu/cpu0/cpuidle/state3:
total 0
-r--r--r-- 1 root root 4096 Feb 8 10:42 desc
+-rw-r--r-- 1 root root 4096 Feb 8 10:42 disable
-r--r--r-- 1 root root 4096 Feb 8 10:42 latency
-r--r--r-- 1 root root 4096 Feb 8 10:42 name
-r--r--r-- 1 root root 4096 Feb 8 10:42 power
@@ -72,6 +76,7 @@ total 0
* desc : Small description about the idle state (string)
+* disable : Option to disable this idle state (bool)
* latency : Latency to exit out of this idle state (in microseconds)
* name : Name of the idle state (string)
* power : Power consumed while in this idle state (in milliwatts)

arch/arm/include/asm/cpuidle.h

View file
diff --git a/arch/arm/include/asm/cpuidle.h b/arch/arm/include/asm/cpuidle.h
new file mode 100644
index 0000000..2fca60a
--- /dev/null
+++ b/arch/arm/include/asm/cpuidle.h
@@ -0,0 +1,29 @@
+#ifndef __ASM_ARM_CPUIDLE_H
+#define __ASM_ARM_CPUIDLE_H
+
+#ifdef CONFIG_CPU_IDLE
+extern int arm_cpuidle_simple_enter(struct cpuidle_device *dev,
+ struct cpuidle_driver *drv, int index);
+#else
+static inline int arm_cpuidle_simple_enter(struct cpuidle_device *dev,
+ struct cpuidle_driver *drv, int index) { return -ENODEV; }
+#endif
+
+/* Common ARM WFI state */
+#define ARM_CPUIDLE_WFI_STATE_PWR(p) {\
+ .enter = arm_cpuidle_simple_enter,\
+ .exit_latency = 1,\
+ .target_residency = 1,\
+ .power_usage = p,\
+ .flags = CPUIDLE_FLAG_TIME_VALID,\
+ .name = "WFI",\
+ .desc = "ARM WFI",\
+}
+
+/*
+ * in case power_specified == 1, give a default WFI power value needed
+ * by some governors
+ */
+#define ARM_CPUIDLE_WFI_STATE ARM_CPUIDLE_WFI_STATE_PWR(UINT_MAX)
+
+#endif

arch/arm/kernel/Makefile

View file
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 8269d89..7b787d6 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -23,7 +23,7 @@ obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += compat.o
obj-$(CONFIG_LEDS) += leds.o
obj-$(CONFIG_OC_ETM) += etm.o
-
+obj-$(CONFIG_CPU_IDLE) += cpuidle.o
obj-$(CONFIG_ISA_DMA_API) += dma.o
obj-$(CONFIG_FIQ) += fiq.o fiqasm.o
obj-$(CONFIG_MODULES) += armksyms.o module.o

arch/arm/kernel/cpuidle.c

View file
diff --git a/arch/arm/kernel/cpuidle.c b/arch/arm/kernel/cpuidle.c
new file mode 100644
index 0000000..89545f6
--- /dev/null
+++ b/arch/arm/kernel/cpuidle.c
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2012 Linaro Ltd.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <linux/cpuidle.h>
+#include <asm/proc-fns.h>
+
+int arm_cpuidle_simple_enter(struct cpuidle_device *dev,
+ struct cpuidle_driver *drv, int index)
+{
+ cpu_do_idle();
+
+ return index;
+}

arch/arm/mach-at91/cpuidle.c

View file
diff --git a/arch/arm/mach-at91/cpuidle.c b/arch/arm/mach-at91/cpuidle.c
index 555d956..ece1f9a 100644
--- a/arch/arm/mach-at91/cpuidle.c
+++ b/arch/arm/mach-at91/cpuidle.c
@@ -17,9 +17,10 @@
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/cpuidle.h>
-#include <asm/proc-fns.h>
#include <linux/io.h>
#include <linux/export.h>
+#include <asm/proc-fns.h>
+#include <asm/cpuidle.h>
#include "pm.h"
@@ -27,61 +28,39 @@
static DEFINE_PER_CPU(struct cpuidle_device, at91_cpuidle_device);
-static struct cpuidle_driver at91_idle_driver = {
- .name = "at91_idle",
- .owner = THIS_MODULE,
-};
-
/* Actual code that puts the SoC in different idle states */
static int at91_enter_idle(struct cpuidle_device *dev,
struct cpuidle_driver *drv,
int index)
{
- struct timeval before, after;
- int idle_time;
-
- local_irq_disable();
- do_gettimeofday(&before);
- if (index == 0)
- /* Wait for interrupt state */
- cpu_do_idle();
- else if (index == 1)
- at91_standby();
+ at91_standby();
- do_gettimeofday(&after);
- local_irq_enable();
- idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
- (after.tv_usec - before.tv_usec);
-
- dev->last_residency = idle_time;
return index;
}
+static struct cpuidle_driver at91_idle_driver = {
+ .name = "at91_idle",
+ .owner = THIS_MODULE,
+ .en_core_tk_irqen = 1,
+ .states[0] = ARM_CPUIDLE_WFI_STATE,
+ .states[1] = {
+ .enter = at91_enter_idle,
+ .exit_latency = 10,
+ .target_residency = 100000,
+ .flags = CPUIDLE_FLAG_TIME_VALID,
+ .name = "RAM_SR",
+ .desc = "WFI and DDR Self Refresh",
+ },
+ .state_count = AT91_MAX_STATES,
+};
+
/* Initialize CPU idle by registering the idle states */
static int at91_init_cpuidle(void)
{
struct cpuidle_device *device;
- struct cpuidle_driver *driver = &at91_idle_driver;
device = &per_cpu(at91_cpuidle_device, smp_processor_id());
device->state_count = AT91_MAX_STATES;
- driver->state_count = AT91_MAX_STATES;
-
- /* Wait for interrupt state */
- driver->states[0].enter = at91_enter_idle;
- driver->states[0].exit_latency = 1;
- driver->states[0].target_residency = 10000;
- driver->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
- strcpy(driver->states[0].name, "WFI");
- strcpy(driver->states[0].desc, "Wait for interrupt");
-
- /* Wait for interrupt and RAM self refresh state */
- driver->states[1].enter = at91_enter_idle;
- driver->states[1].exit_latency = 10;
- driver->states[1].target_residency = 10000;
- driver->states[1].flags = CPUIDLE_FLAG_TIME_VALID;
- strcpy(driver->states[1].name, "RAM_SR");
- strcpy(driver->states[1].desc, "WFI and RAM Self Refresh");
cpuidle_register_driver(&at91_idle_driver);

arch/arm/mach-davinci/cpuidle.c

View file
diff --git a/arch/arm/mach-davinci/cpuidle.c b/arch/arm/mach-davinci/cpuidle.c
index a30c7c5..9107691 100644
--- a/arch/arm/mach-davinci/cpuidle.c
+++ b/arch/arm/mach-davinci/cpuidle.c
@@ -18,6 +18,7 @@
#include <linux/io.h>
#include <linux/export.h>
#include <asm/proc-fns.h>
+#include <asm/cpuidle.h>
#include <mach/cpuidle.h>
#include <mach/ddr2.h>
@@ -30,12 +31,43 @@ struct davinci_ops {
u32 flags;
};
+/* Actual code that puts the SoC in different idle states */
+static int davinci_enter_idle(struct cpuidle_device *dev,
+ struct cpuidle_driver *drv,
+ int index)
+{
+ struct cpuidle_state_usage *state_usage = &dev->states_usage[index];
+ struct davinci_ops *ops = cpuidle_get_statedata(state_usage);
+
+ if (ops && ops->enter)
+ ops->enter(ops->flags);
+
+ index = cpuidle_wrap_enter(dev, drv, index,
+ arm_cpuidle_simple_enter);
+
+ if (ops && ops->exit)
+ ops->exit(ops->flags);
+
+ return index;
+}
+
/* fields in davinci_ops.flags */
#define DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN BIT(0)
static struct cpuidle_driver davinci_idle_driver = {
- .name = "cpuidle-davinci",
- .owner = THIS_MODULE,
+ .name = "cpuidle-davinci",
+ .owner = THIS_MODULE,
+ .en_core_tk_irqen = 1,
+ .states[0] = ARM_CPUIDLE_WFI_STATE,
+ .states[1] = {
+ .enter = davinci_enter_idle,
+ .exit_latency = 10,
+ .target_residency = 100000,
+ .flags = CPUIDLE_FLAG_TIME_VALID,
+ .name = "DDR SR",
+ .desc = "WFI and DDR Self Refresh",
+ },
+ .state_count = DAVINCI_CPUIDLE_MAX_STATES,
};
static DEFINE_PER_CPU(struct cpuidle_device, davinci_cpuidle_device);
@@ -77,41 +109,10 @@ static struct davinci_ops davinci_states[DAVINCI_CPUIDLE_MAX_STATES] = {
},
};
-/* Actual code that puts the SoC in different idle states */
-static int davinci_enter_idle(struct cpuidle_device *dev,
- struct cpuidle_driver *drv,
- int index)
-{
- struct cpuidle_state_usage *state_usage = &dev->states_usage[index];
- struct davinci_ops *ops = cpuidle_get_statedata(state_usage);
- struct timeval before, after;
- int idle_time;
-
- local_irq_disable();
- do_gettimeofday(&before);
-
- if (ops && ops->enter)
- ops->enter(ops->flags);
- /* Wait for interrupt state */
- cpu_do_idle();
- if (ops && ops->exit)
- ops->exit(ops->flags);
-
- do_gettimeofday(&after);
- local_irq_enable();
- idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
- (after.tv_usec - before.tv_usec);
-
- dev->last_residency = idle_time;
-
- return index;
-}
-
static int __init davinci_cpuidle_probe(struct platform_device *pdev)
{
int ret;
struct cpuidle_device *device;
- struct cpuidle_driver *driver = &davinci_idle_driver;
struct davinci_cpuidle_config *pdata = pdev->dev.platform_data;
device = &per_cpu(davinci_cpuidle_device, smp_processor_id());
@@ -123,27 +124,11 @@ static int __init davinci_cpuidle_probe(struct platform_device *pdev)
ddr2_reg_base = pdata->ddr2_ctlr_base;
- /* Wait for interrupt state */
- driver->states[0].enter = davinci_enter_idle;
- driver->states[0].exit_latency = 1;
- driver->states[0].target_residency = 10000;
- driver->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
- strcpy(driver->states[0].name, "WFI");
- strcpy(driver->states[0].desc, "Wait for interrupt");
-
- /* Wait for interrupt and DDR self refresh state */
- driver->states[1].enter = davinci_enter_idle;
- driver->states[1].exit_latency = 10;
- driver->states[1].target_residency = 10000;
- driver->states[1].flags = CPUIDLE_FLAG_TIME_VALID;
- strcpy(driver->states[1].name, "DDR SR");
- strcpy(driver->states[1].desc, "WFI and DDR Self Refresh");
if (pdata->ddr2_pdown)
davinci_states[1].flags |= DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN;
cpuidle_set_statedata(&device->states_usage[1], &davinci_states[1]);
device->state_count = DAVINCI_CPUIDLE_MAX_STATES;
- driver->state_count = DAVINCI_CPUIDLE_MAX_STATES;
ret = cpuidle_register_driver(&davinci_idle_driver);
if (ret) {

arch/arm/mach-kirkwood/cpuidle.c

View file
diff --git a/arch/arm/mach-kirkwood/cpuidle.c b/arch/arm/mach-kirkwood/cpuidle.c
index 7088180..0f17109 100644
--- a/arch/arm/mach-kirkwood/cpuidle.c
+++ b/arch/arm/mach-kirkwood/cpuidle.c
@@ -20,77 +20,47 @@
#include <linux/io.h>
#include <linux/export.h>
#include <asm/proc-fns.h>
+#include <asm/cpuidle.h>
#include <mach/kirkwood.h>
#define KIRKWOOD_MAX_STATES 2
-static struct cpuidle_driver kirkwood_idle_driver = {
- .name = "kirkwood_idle",
- .owner = THIS_MODULE,
-};
-
-static DEFINE_PER_CPU(struct cpuidle_device, kirkwood_cpuidle_device);
-
/* Actual code that puts the SoC in different idle states */
static int kirkwood_enter_idle(struct cpuidle_device *dev,
struct cpuidle_driver *drv,
int index)
{
- struct timeval before, after;
- int idle_time;
-
- local_irq_disable();
- do_gettimeofday(&before);
- if (index == 0)
- /* Wait for interrupt state */
- cpu_do_idle();
- else if (index == 1) {
- /*
- * Following write will put DDR in self refresh.
- * Note that we have 256 cycles before DDR puts it
- * self in self-refresh, so the wait-for-interrupt
- * call afterwards won't get the DDR from self refresh
- * mode.
- */
- writel(0x7, DDR_OPERATION_BASE);
- cpu_do_idle();
- }
- do_gettimeofday(&after);
- local_irq_enable();
- idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
- (after.tv_usec - before.tv_usec);
-
- /* Update last residency */
- dev->last_residency = idle_time;
+ writel(0x7, DDR_OPERATION_BASE);
+ cpu_do_idle();
return index;
}
+static struct cpuidle_driver kirkwood_idle_driver = {
+ .name = "kirkwood_idle",
+ .owner = THIS_MODULE,
+ .en_core_tk_irqen = 1,
+ .states[0] = ARM_CPUIDLE_WFI_STATE,
+ .states[1] = {
+ .enter = kirkwood_enter_idle,
+ .exit_latency = 10,
+ .target_residency = 100000,
+ .flags = CPUIDLE_FLAG_TIME_VALID,
+ .name = "DDR SR",
+ .desc = "WFI and DDR Self Refresh",
+ },
+ .state_count = KIRKWOOD_MAX_STATES,
+};
+
+static DEFINE_PER_CPU(struct cpuidle_device, kirkwood_cpuidle_device);
+
/* Initialize CPU idle by registering the idle states */
static int kirkwood_init_cpuidle(void)
{
struct cpuidle_device *device;
- struct cpuidle_driver *driver = &kirkwood_idle_driver;
device = &per_cpu(kirkwood_cpuidle_device, smp_processor_id());
device->state_count = KIRKWOOD_MAX_STATES;
- driver->state_count = KIRKWOOD_MAX_STATES;
-
- /* Wait for interrupt state */
- driver->states[0].enter = kirkwood_enter_idle;
- driver->states[0].exit_latency = 1;
- driver->states[0].target_residency = 10000;
- driver->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
- strcpy(driver->states[0].name, "WFI");
- strcpy(driver->states[0].desc, "Wait for interrupt");
-
- /* Wait for interrupt and DDR self refresh state */
- driver->states[1].enter = kirkwood_enter_idle;
- driver->states[1].exit_latency = 10;
- driver->states[1].target_residency = 10000;
- driver->states[1].flags = CPUIDLE_FLAG_TIME_VALID;
- strcpy(driver->states[1].name, "DDR SR");
- strcpy(driver->states[1].desc, "WFI and DDR Self Refresh");
cpuidle_register_driver(&kirkwood_idle_driver);
if (cpuidle_register_device(device)) {

arch/arm/mach-omap2/cpuidle34xx.c

View file
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index 464cffd..5358664 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -87,29 +87,14 @@ static int _cpuidle_deny_idle(struct powerdomain *pwrdm,
return 0;
}
-/**
- * omap3_enter_idle - Programs OMAP3 to enter the specified state
- * @dev: cpuidle device
- * @drv: cpuidle driver
- * @index: the index of state to be entered
- *
- * Called from the CPUidle framework to program the device to the
- * specified target state selected by the governor.
- */
-static int omap3_enter_idle(struct cpuidle_device *dev,
+static int __omap3_enter_idle(struct cpuidle_device *dev,
struct cpuidle_driver *drv,
int index)
{
struct omap3_idle_statedata *cx =
cpuidle_get_statedata(&dev->states_usage[index]);
- struct timespec ts_preidle, ts_postidle, ts_idle;
u32 mpu_state = cx->mpu_state, core_state = cx->core_state;
- int idle_time;
-
- /* Used to keep track of the total time in idle */
- getnstimeofday(&ts_preidle);
- local_irq_disable();
local_fiq_disable();
pwrdm_set_next_pwrst(mpu_pd, mpu_state);
@@ -148,22 +133,29 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
}
return_sleep_time:
- getnstimeofday(&ts_postidle);
- ts_idle = timespec_sub(ts_postidle, ts_preidle);
- local_irq_enable();
local_fiq_enable();
- idle_time = ts_idle.tv_nsec / NSEC_PER_USEC + ts_idle.tv_sec * \
- USEC_PER_SEC;
-
- /* Update cpuidle counters */
- dev->last_residency = idle_time;
-
return index;
}
/**
+ * omap3_enter_idle - Programs OMAP3 to enter the specified state
+ * @dev: cpuidle device
+ * @drv: cpuidle driver
+ * @index: the index of state to be entered
+ *
+ * Called from the CPUidle framework to program the device to the
+ * specified target state selected by the governor.
+ */
+static inline int omap3_enter_idle(struct cpuidle_device *dev,
+ struct cpuidle_driver *drv,
+ int index)
+{
+ return cpuidle_wrap_enter(dev, drv, index, __omap3_enter_idle);
+}
+
+/**
* next_valid_state - Find next valid C-state
* @dev: cpuidle device
* @drv: cpuidle driver

arch/arm/mach-omap2/cpuidle44xx.c

View file
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
index 72e018b..f386cbe 100644
--- a/arch/arm/mach-omap2/cpuidle44xx.c
+++ b/arch/arm/mach-omap2/cpuidle44xx.c
@@ -62,15 +62,9 @@ static int omap4_enter_idle(struct cpuidle_device *dev,
{
struct omap4_idle_statedata *cx =
cpuidle_get_statedata(&dev->states_usage[index]);
- struct timespec ts_preidle, ts_postidle, ts_idle;
u32 cpu1_state;
- int idle_time;
int cpu_id = smp_processor_id();
- /* Used to keep track of the total time in idle */
- getnstimeofday(&ts_preidle);
-
- local_irq_disable();
local_fiq_disable();
/*
@@ -128,26 +122,17 @@ static int omap4_enter_idle(struct cpuidle_device *dev,
if (index > 0)
clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu_id);
- getnstimeofday(&ts_postidle);
- ts_idle = timespec_sub(ts_postidle, ts_preidle);
-
- local_irq_enable();
local_fiq_enable();
- idle_time = ts_idle.tv_nsec / NSEC_PER_USEC + ts_idle.tv_sec * \
- USEC_PER_SEC;
-
- /* Update cpuidle counters */

This diff is incomplete. Download the complete patch.

arch/arm/mach-shmobile/cpuidle.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/kernel/cpu/shmobile/cpuidle.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/acpi/boot.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/smpboot.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/tboot.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/accommon.h

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/acdebug.h

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/acevents.h

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/acglobal.h

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/achware.h

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/aclocal.h

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/acmacros.h

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/acnamesp.h

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/actables.h

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/evevent.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/evglock.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/evgpe.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/evgpeblk.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/evgpeinit.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/evgpeutil.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/evmisc.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/evsci.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/evxface.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/evxfevnt.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/evxfgpe.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/hwacpi.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/hwesleep.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/hwgpe.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/hwregs.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/hwsleep.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/hwtimer.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/hwxface.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/hwxfsleep.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/nsdump.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/nsdumpdv.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/nspredef.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/nsrepair.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/nsutils.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/tbfadt.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/tbinstal.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/tbutils.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/utdecode.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/utglobal.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/utinit.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/acpica/utxface.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/apei/apei-base.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/apei/cper.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/apei/einj.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/apei/erst.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/bgrt.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/bus.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/ec.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/nvs.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/osl.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/power.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/processor_driver.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/processor_idle.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/processor_thermal.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/processor_throttling.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/reboot.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/scan.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/sleep.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/thermal.c

View file

This diff is incomplete. Download the complete patch.

drivers/acpi/video.c

View file

This diff is incomplete. Download the complete patch.

drivers/cpuidle/cpuidle.c

View file

This diff is incomplete. Download the complete patch.

drivers/cpuidle/driver.c

View file

This diff is incomplete. Download the complete patch.

drivers/cpuidle/governors/menu.c

View file

This diff is incomplete. Download the complete patch.

drivers/cpuidle/sysfs.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/pci-acpi.c

View file

This diff is incomplete. Download the complete patch.

drivers/platform/x86/intel_ips.c

View file

This diff is incomplete. Download the complete patch.

drivers/pnp/pnpacpi/core.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/spear_thermal.c

View file

This diff is incomplete. Download the complete patch.

drivers/thermal/thermal_sys.c

View file

This diff is incomplete. Download the complete patch.

include/acpi/acconfig.h

View file

This diff is incomplete. Download the complete patch.

include/acpi/acexcep.h

View file

This diff is incomplete. Download the complete patch.

include/acpi/acnames.h

View file

This diff is incomplete. Download the complete patch.

include/acpi/acpi_bus.h

View file

This diff is incomplete. Download the complete patch.

include/acpi/acpiosxf.h

View file

This diff is incomplete. Download the complete patch.

include/acpi/acpixf.h

View file

This diff is incomplete. Download the complete patch.

include/acpi/actbl.h

View file

This diff is incomplete. Download the complete patch.

include/acpi/actypes.h

View file

This diff is incomplete. Download the complete patch.

include/linux/acpi.h

View file

This diff is incomplete. Download the complete patch.

include/linux/cpuidle.h

View file

This diff is incomplete. Download the complete patch.

include/linux/platform_data/spear_thermal.h

View file

This diff is incomplete. Download the complete patch.

include/linux/tboot.h

View file

This diff is incomplete. Download the complete patch.

tools/power/x86/turbostat/turbostat.8

View file

This diff is incomplete. Download the complete patch.

tools/power/x86/turbostat/turbostat.c

View file

This diff is incomplete. Download the complete patch.