Skip to content

Commit a335750

Browse files
committed
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux
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 ...
2 parents 10f3cb4 + d326f44 commit a335750

103 files changed

Lines changed: 3192 additions & 1555 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/ABI/testing/sysfs-firmware-acpi

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
What: /sys/firmware/acpi/bgrt/
2+
Date: January 2012
3+
Contact: Matthew Garrett <mjg@redhat.com>
4+
Description:
5+
The BGRT is an ACPI 5.0 feature that allows the OS
6+
to obtain a copy of the firmware boot splash and
7+
some associated metadata. This is intended to be used
8+
by boot splash applications in order to interact with
9+
the firmware boot splash in order to avoid jarring
10+
transitions.
11+
12+
image: The image bitmap. Currently a 32-bit BMP.
13+
status: 1 if the image is valid, 0 if firmware invalidated it.
14+
type: 0 indicates image is in BMP format.
15+
version: The version of the BGRT. Currently 1.
16+
xoffset: The number of pixels between the left of the screen
17+
and the left edge of the image.
18+
yoffset: The number of pixels between the top of the screen
19+
and the top edge of the image.
20+
121
What: /sys/firmware/acpi/interrupts/
222
Date: February 2008
323
Contact: Len Brown <lenb@kernel.org>

Documentation/acpi/apei/einj.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ directory apei/einj. The following files are provided.
5353
This file is used to set the second error parameter value. Effect of
5454
parameter depends on error_type specified.
5555

56+
- notrigger
57+
The EINJ mechanism is a two step process. First inject the error, then
58+
perform some actions to trigger it. Setting "notrigger" to 1 skips the
59+
trigger phase, which *may* allow the user to cause the error in some other
60+
context by a simple access to the cpu, memory location, or device that is
61+
the target of the error injection. Whether this actually works depends
62+
on what operations the BIOS actually includes in the trigger phase.
63+
5664
BIOS versions based in the ACPI 4.0 specification have limited options
5765
to control where the errors are injected. Your BIOS may support an
5866
extension (enabled with the param_extension=1 module parameter, or

Documentation/cpuidle/sysfs.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ drwxr-xr-x 2 root root 0 Feb 8 10:42 state3
3636
/sys/devices/system/cpu/cpu0/cpuidle/state0:
3737
total 0
3838
-r--r--r-- 1 root root 4096 Feb 8 10:42 desc
39+
-rw-r--r-- 1 root root 4096 Feb 8 10:42 disable
3940
-r--r--r-- 1 root root 4096 Feb 8 10:42 latency
4041
-r--r--r-- 1 root root 4096 Feb 8 10:42 name
4142
-r--r--r-- 1 root root 4096 Feb 8 10:42 power
@@ -45,6 +46,7 @@ total 0
4546
/sys/devices/system/cpu/cpu0/cpuidle/state1:
4647
total 0
4748
-r--r--r-- 1 root root 4096 Feb 8 10:42 desc
49+
-rw-r--r-- 1 root root 4096 Feb 8 10:42 disable
4850
-r--r--r-- 1 root root 4096 Feb 8 10:42 latency
4951
-r--r--r-- 1 root root 4096 Feb 8 10:42 name
5052
-r--r--r-- 1 root root 4096 Feb 8 10:42 power
@@ -54,6 +56,7 @@ total 0
5456
/sys/devices/system/cpu/cpu0/cpuidle/state2:
5557
total 0
5658
-r--r--r-- 1 root root 4096 Feb 8 10:42 desc
59+
-rw-r--r-- 1 root root 4096 Feb 8 10:42 disable
5760
-r--r--r-- 1 root root 4096 Feb 8 10:42 latency
5861
-r--r--r-- 1 root root 4096 Feb 8 10:42 name
5962
-r--r--r-- 1 root root 4096 Feb 8 10:42 power
@@ -63,6 +66,7 @@ total 0
6366
/sys/devices/system/cpu/cpu0/cpuidle/state3:
6467
total 0
6568
-r--r--r-- 1 root root 4096 Feb 8 10:42 desc
69+
-rw-r--r-- 1 root root 4096 Feb 8 10:42 disable
6670
-r--r--r-- 1 root root 4096 Feb 8 10:42 latency
6771
-r--r--r-- 1 root root 4096 Feb 8 10:42 name
6872
-r--r--r-- 1 root root 4096 Feb 8 10:42 power
@@ -72,6 +76,7 @@ total 0
7276

7377

7478
* desc : Small description about the idle state (string)
79+
* disable : Option to disable this idle state (bool)
7580
* latency : Latency to exit out of this idle state (in microseconds)
7681
* name : Name of the idle state (string)
7782
* power : Power consumed while in this idle state (in milliwatts)

arch/arm/include/asm/cpuidle.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#ifndef __ASM_ARM_CPUIDLE_H
2+
#define __ASM_ARM_CPUIDLE_H
3+
4+
#ifdef CONFIG_CPU_IDLE
5+
extern int arm_cpuidle_simple_enter(struct cpuidle_device *dev,
6+
struct cpuidle_driver *drv, int index);
7+
#else
8+
static inline int arm_cpuidle_simple_enter(struct cpuidle_device *dev,
9+
struct cpuidle_driver *drv, int index) { return -ENODEV; }
10+
#endif
11+
12+
/* Common ARM WFI state */
13+
#define ARM_CPUIDLE_WFI_STATE_PWR(p) {\
14+
.enter = arm_cpuidle_simple_enter,\
15+
.exit_latency = 1,\
16+
.target_residency = 1,\
17+
.power_usage = p,\
18+
.flags = CPUIDLE_FLAG_TIME_VALID,\
19+
.name = "WFI",\
20+
.desc = "ARM WFI",\
21+
}
22+
23+
/*
24+
* in case power_specified == 1, give a default WFI power value needed
25+
* by some governors
26+
*/
27+
#define ARM_CPUIDLE_WFI_STATE ARM_CPUIDLE_WFI_STATE_PWR(UINT_MAX)
28+
29+
#endif

arch/arm/kernel/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += compat.o
2323

2424
obj-$(CONFIG_LEDS) += leds.o
2525
obj-$(CONFIG_OC_ETM) += etm.o
26-
26+
obj-$(CONFIG_CPU_IDLE) += cpuidle.o
2727
obj-$(CONFIG_ISA_DMA_API) += dma.o
2828
obj-$(CONFIG_FIQ) += fiq.o fiqasm.o
2929
obj-$(CONFIG_MODULES) += armksyms.o module.o

arch/arm/kernel/cpuidle.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright 2012 Linaro Ltd.
3+
*
4+
* The code contained herein is licensed under the GNU General Public
5+
* License. You may obtain a copy of the GNU General Public License
6+
* Version 2 or later at the following locations:
7+
*
8+
* http://www.opensource.org/licenses/gpl-license.html
9+
* http://www.gnu.org/copyleft/gpl.html
10+
*/
11+
12+
#include <linux/cpuidle.h>
13+
#include <asm/proc-fns.h>
14+
15+
int arm_cpuidle_simple_enter(struct cpuidle_device *dev,
16+
struct cpuidle_driver *drv, int index)
17+
{
18+
cpu_do_idle();
19+
20+
return index;
21+
}

arch/arm/mach-at91/cpuidle.c

Lines changed: 19 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -17,71 +17,50 @@
1717
#include <linux/init.h>
1818
#include <linux/platform_device.h>
1919
#include <linux/cpuidle.h>
20-
#include <asm/proc-fns.h>
2120
#include <linux/io.h>
2221
#include <linux/export.h>
22+
#include <asm/proc-fns.h>
23+
#include <asm/cpuidle.h>
2324

2425
#include "pm.h"
2526

2627
#define AT91_MAX_STATES 2
2728

2829
static DEFINE_PER_CPU(struct cpuidle_device, at91_cpuidle_device);
2930

30-
static struct cpuidle_driver at91_idle_driver = {
31-
.name = "at91_idle",
32-
.owner = THIS_MODULE,
33-
};
34-
3531
/* Actual code that puts the SoC in different idle states */
3632
static int at91_enter_idle(struct cpuidle_device *dev,
3733
struct cpuidle_driver *drv,
3834
int index)
3935
{
40-
struct timeval before, after;
41-
int idle_time;
42-
43-
local_irq_disable();
44-
do_gettimeofday(&before);
45-
if (index == 0)
46-
/* Wait for interrupt state */
47-
cpu_do_idle();
48-
else if (index == 1)
49-
at91_standby();
36+
at91_standby();
5037

51-
do_gettimeofday(&after);
52-
local_irq_enable();
53-
idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
54-
(after.tv_usec - before.tv_usec);
55-
56-
dev->last_residency = idle_time;
5738
return index;
5839
}
5940

41+
static struct cpuidle_driver at91_idle_driver = {
42+
.name = "at91_idle",
43+
.owner = THIS_MODULE,
44+
.en_core_tk_irqen = 1,
45+
.states[0] = ARM_CPUIDLE_WFI_STATE,
46+
.states[1] = {
47+
.enter = at91_enter_idle,
48+
.exit_latency = 10,
49+
.target_residency = 100000,
50+
.flags = CPUIDLE_FLAG_TIME_VALID,
51+
.name = "RAM_SR",
52+
.desc = "WFI and DDR Self Refresh",
53+
},
54+
.state_count = AT91_MAX_STATES,
55+
};
56+
6057
/* Initialize CPU idle by registering the idle states */
6158
static int at91_init_cpuidle(void)
6259
{
6360
struct cpuidle_device *device;
64-
struct cpuidle_driver *driver = &at91_idle_driver;
6561

6662
device = &per_cpu(at91_cpuidle_device, smp_processor_id());
6763
device->state_count = AT91_MAX_STATES;
68-
driver->state_count = AT91_MAX_STATES;
69-
70-
/* Wait for interrupt state */
71-
driver->states[0].enter = at91_enter_idle;
72-
driver->states[0].exit_latency = 1;
73-
driver->states[0].target_residency = 10000;
74-
driver->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
75-
strcpy(driver->states[0].name, "WFI");
76-
strcpy(driver->states[0].desc, "Wait for interrupt");
77-
78-
/* Wait for interrupt and RAM self refresh state */
79-
driver->states[1].enter = at91_enter_idle;
80-
driver->states[1].exit_latency = 10;
81-
driver->states[1].target_residency = 10000;
82-
driver->states[1].flags = CPUIDLE_FLAG_TIME_VALID;
83-
strcpy(driver->states[1].name, "RAM_SR");
84-
strcpy(driver->states[1].desc, "WFI and RAM Self Refresh");
8564

8665
cpuidle_register_driver(&at91_idle_driver);
8766

arch/arm/mach-davinci/cpuidle.c

Lines changed: 34 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/io.h>
1919
#include <linux/export.h>
2020
#include <asm/proc-fns.h>
21+
#include <asm/cpuidle.h>
2122

2223
#include <mach/cpuidle.h>
2324
#include <mach/ddr2.h>
@@ -30,12 +31,43 @@ struct davinci_ops {
3031
u32 flags;
3132
};
3233

34+
/* Actual code that puts the SoC in different idle states */
35+
static int davinci_enter_idle(struct cpuidle_device *dev,
36+
struct cpuidle_driver *drv,
37+
int index)
38+
{
39+
struct cpuidle_state_usage *state_usage = &dev->states_usage[index];
40+
struct davinci_ops *ops = cpuidle_get_statedata(state_usage);
41+
42+
if (ops && ops->enter)
43+
ops->enter(ops->flags);
44+
45+
index = cpuidle_wrap_enter(dev, drv, index,
46+
arm_cpuidle_simple_enter);
47+
48+
if (ops && ops->exit)
49+
ops->exit(ops->flags);
50+
51+
return index;
52+
}
53+
3354
/* fields in davinci_ops.flags */
3455
#define DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN BIT(0)
3556

3657
static struct cpuidle_driver davinci_idle_driver = {
37-
.name = "cpuidle-davinci",
38-
.owner = THIS_MODULE,
58+
.name = "cpuidle-davinci",
59+
.owner = THIS_MODULE,
60+
.en_core_tk_irqen = 1,
61+
.states[0] = ARM_CPUIDLE_WFI_STATE,
62+
.states[1] = {
63+
.enter = davinci_enter_idle,
64+
.exit_latency = 10,
65+
.target_residency = 100000,
66+
.flags = CPUIDLE_FLAG_TIME_VALID,
67+
.name = "DDR SR",
68+
.desc = "WFI and DDR Self Refresh",
69+
},
70+
.state_count = DAVINCI_CPUIDLE_MAX_STATES,
3971
};
4072

4173
static DEFINE_PER_CPU(struct cpuidle_device, davinci_cpuidle_device);
@@ -77,41 +109,10 @@ static struct davinci_ops davinci_states[DAVINCI_CPUIDLE_MAX_STATES] = {
77109
},
78110
};
79111

80-
/* Actual code that puts the SoC in different idle states */
81-
static int davinci_enter_idle(struct cpuidle_device *dev,
82-
struct cpuidle_driver *drv,
83-
int index)
84-
{
85-
struct cpuidle_state_usage *state_usage = &dev->states_usage[index];
86-
struct davinci_ops *ops = cpuidle_get_statedata(state_usage);
87-
struct timeval before, after;
88-
int idle_time;
89-
90-
local_irq_disable();
91-
do_gettimeofday(&before);
92-
93-
if (ops && ops->enter)
94-
ops->enter(ops->flags);
95-
/* Wait for interrupt state */
96-
cpu_do_idle();
97-
if (ops && ops->exit)
98-
ops->exit(ops->flags);
99-
100-
do_gettimeofday(&after);
101-
local_irq_enable();
102-
idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
103-
(after.tv_usec - before.tv_usec);
104-
105-
dev->last_residency = idle_time;
106-
107-
return index;
108-
}
109-
110112
static int __init davinci_cpuidle_probe(struct platform_device *pdev)
111113
{
112114
int ret;
113115
struct cpuidle_device *device;
114-
struct cpuidle_driver *driver = &davinci_idle_driver;
115116
struct davinci_cpuidle_config *pdata = pdev->dev.platform_data;
116117

117118
device = &per_cpu(davinci_cpuidle_device, smp_processor_id());
@@ -123,27 +124,11 @@ static int __init davinci_cpuidle_probe(struct platform_device *pdev)
123124

124125
ddr2_reg_base = pdata->ddr2_ctlr_base;
125126

126-
/* Wait for interrupt state */
127-
driver->states[0].enter = davinci_enter_idle;
128-
driver->states[0].exit_latency = 1;
129-
driver->states[0].target_residency = 10000;
130-
driver->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
131-
strcpy(driver->states[0].name, "WFI");
132-
strcpy(driver->states[0].desc, "Wait for interrupt");
133-
134-
/* Wait for interrupt and DDR self refresh state */
135-
driver->states[1].enter = davinci_enter_idle;
136-
driver->states[1].exit_latency = 10;
137-
driver->states[1].target_residency = 10000;
138-
driver->states[1].flags = CPUIDLE_FLAG_TIME_VALID;
139-
strcpy(driver->states[1].name, "DDR SR");
140-
strcpy(driver->states[1].desc, "WFI and DDR Self Refresh");
141127
if (pdata->ddr2_pdown)
142128
davinci_states[1].flags |= DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN;
143129
cpuidle_set_statedata(&device->states_usage[1], &davinci_states[1]);
144130

145131
device->state_count = DAVINCI_CPUIDLE_MAX_STATES;
146-
driver->state_count = DAVINCI_CPUIDLE_MAX_STATES;
147132

148133
ret = cpuidle_register_driver(&davinci_idle_driver);
149134
if (ret) {

0 commit comments

Comments
 (0)