Skip to content

Commit 10baf04

Browse files
committed
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: (35 commits) PM idle: remove global declaration of pm_idle unicore32 idle: delete stray pm_idle comment openrisc idle: delete pm_idle mn10300 idle: delete pm_idle microblaze idle: delete pm_idle m32r idle: delete pm_idle, and other dead idle code ia64 idle: delete pm_idle cris idle: delete idle and pm_idle ARM64 idle: delete pm_idle ARM idle: delete pm_idle blackfin idle: delete pm_idle sparc idle: rename pm_idle to sparc_idle sh idle: rename global pm_idle to static sh_idle x86 idle: rename global pm_idle to static x86_idle APM idle: register apm_cpu_idle via cpuidle tools/power turbostat: display SMI count by default intel_idle: export both C1 and C1E cpuidle: remove vestage definition of cpuidle_state_usage.driver_data x86 idle: remove 32-bit-only "no-hlt" parameter, hlt_works_ok flag x86 idle: remove mwait_idle() and "idle=mwait" cmdline param ... Conflicts: arch/x86/kernel/process.c (with PM / tracing commit 43720bd) drivers/acpi/processor_idle.c (with ACPICA commit 4f84291)
2 parents fdbe094 + ca62cf5 commit 10baf04

35 files changed

Lines changed: 360 additions & 553 deletions

File tree

‎Documentation/kernel-parameters.txt‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,16 +1039,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
10391039
Claim all unknown PCI IDE storage controllers.
10401040

10411041
idle= [X86]
1042-
Format: idle=poll, idle=mwait, idle=halt, idle=nomwait
1042+
Format: idle=poll, idle=halt, idle=nomwait
10431043
Poll forces a polling idle loop that can slightly
10441044
improve the performance of waking up a idle CPU, but
10451045
will use a lot of power and make the system run hot.
10461046
Not recommended.
1047-
idle=mwait: On systems which support MONITOR/MWAIT but
1048-
the kernel chose to not use it because it doesn't save
1049-
as much power as a normal idle loop, use the
1050-
MONITOR/MWAIT idle loop anyways. Performance should be
1051-
the same as idle=poll.
10521047
idle=halt: Halt is forced to be used for CPU idle.
10531048
In such case C2/C3 won't be used again.
10541049
idle=nomwait: Disable mwait for CPU C-states
@@ -1891,10 +1886,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
18911886
wfi(ARM) instruction doesn't work correctly and not to
18921887
use it. This is also useful when using JTAG debugger.
18931888

1894-
no-hlt [BUGS=X86-32] Tells the kernel that the hlt
1895-
instruction doesn't work correctly and not to
1896-
use it.
1897-
18981889
no_file_caps Tells the kernel not to honor file capabilities. The
18991890
only way then for a file to be executed with privilege
19001891
is to be setuid root or executed by root.

‎arch/arm/kernel/process.c‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,9 @@ static void default_idle(void)
172172
local_irq_enable();
173173
}
174174

175-
void (*pm_idle)(void) = default_idle;
176-
EXPORT_SYMBOL(pm_idle);
177-
178175
/*
179-
* The idle thread, has rather strange semantics for calling pm_idle,
180-
* but this is what x86 does and we need to do the same, so that
181-
* things like cpuidle get called in the same way. The only difference
182-
* is that we always respect 'hlt_counter' to prevent low power idle.
176+
* The idle thread.
177+
* We always respect 'hlt_counter' to prevent low power idle.
183178
*/
184179
void cpu_idle(void)
185180
{
@@ -210,10 +205,10 @@ void cpu_idle(void)
210205
} else if (!need_resched()) {
211206
stop_critical_timings();
212207
if (cpuidle_idle_call())
213-
pm_idle();
208+
default_idle();
214209
start_critical_timings();
215210
/*
216-
* pm_idle functions must always
211+
* default_idle functions must always
217212
* return with IRQs enabled.
218213
*/
219214
WARN_ON(irqs_disabled());

‎arch/arm/mach-davinci/cpuidle.c‎

Lines changed: 25 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,44 @@
2525

2626
#define DAVINCI_CPUIDLE_MAX_STATES 2
2727

28-
struct davinci_ops {
29-
void (*enter) (u32 flags);
30-
void (*exit) (u32 flags);
31-
u32 flags;
32-
};
28+
static DEFINE_PER_CPU(struct cpuidle_device, davinci_cpuidle_device);
29+
static void __iomem *ddr2_reg_base;
30+
static bool ddr2_pdown;
31+
32+
static void davinci_save_ddr_power(int enter, bool pdown)
33+
{
34+
u32 val;
35+
36+
val = __raw_readl(ddr2_reg_base + DDR2_SDRCR_OFFSET);
37+
38+
if (enter) {
39+
if (pdown)
40+
val |= DDR2_SRPD_BIT;
41+
else
42+
val &= ~DDR2_SRPD_BIT;
43+
val |= DDR2_LPMODEN_BIT;
44+
} else {
45+
val &= ~(DDR2_SRPD_BIT | DDR2_LPMODEN_BIT);
46+
}
47+
48+
__raw_writel(val, ddr2_reg_base + DDR2_SDRCR_OFFSET);
49+
}
3350

3451
/* Actual code that puts the SoC in different idle states */
3552
static int davinci_enter_idle(struct cpuidle_device *dev,
3653
struct cpuidle_driver *drv,
3754
int index)
3855
{
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);
56+
davinci_save_ddr_power(1, ddr2_pdown);
4457

4558
index = cpuidle_wrap_enter(dev, drv, index,
4659
arm_cpuidle_simple_enter);
4760

48-
if (ops && ops->exit)
49-
ops->exit(ops->flags);
61+
davinci_save_ddr_power(0, ddr2_pdown);
5062

5163
return index;
5264
}
5365

54-
/* fields in davinci_ops.flags */
55-
#define DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN BIT(0)
56-
5766
static struct cpuidle_driver davinci_idle_driver = {
5867
.name = "cpuidle-davinci",
5968
.owner = THIS_MODULE,
@@ -70,45 +79,6 @@ static struct cpuidle_driver davinci_idle_driver = {
7079
.state_count = DAVINCI_CPUIDLE_MAX_STATES,
7180
};
7281

73-
static DEFINE_PER_CPU(struct cpuidle_device, davinci_cpuidle_device);
74-
static void __iomem *ddr2_reg_base;
75-
76-
static void davinci_save_ddr_power(int enter, bool pdown)
77-
{
78-
u32 val;
79-
80-
val = __raw_readl(ddr2_reg_base + DDR2_SDRCR_OFFSET);
81-
82-
if (enter) {
83-
if (pdown)
84-
val |= DDR2_SRPD_BIT;
85-
else
86-
val &= ~DDR2_SRPD_BIT;
87-
val |= DDR2_LPMODEN_BIT;
88-
} else {
89-
val &= ~(DDR2_SRPD_BIT | DDR2_LPMODEN_BIT);
90-
}
91-
92-
__raw_writel(val, ddr2_reg_base + DDR2_SDRCR_OFFSET);
93-
}
94-
95-
static void davinci_c2state_enter(u32 flags)
96-
{
97-
davinci_save_ddr_power(1, !!(flags & DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN));
98-
}
99-
100-
static void davinci_c2state_exit(u32 flags)
101-
{
102-
davinci_save_ddr_power(0, !!(flags & DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN));
103-
}
104-
105-
static struct davinci_ops davinci_states[DAVINCI_CPUIDLE_MAX_STATES] = {
106-
[1] = {
107-
.enter = davinci_c2state_enter,
108-
.exit = davinci_c2state_exit,
109-
},
110-
};
111-
11282
static int __init davinci_cpuidle_probe(struct platform_device *pdev)
11383
{
11484
int ret;
@@ -124,11 +94,7 @@ static int __init davinci_cpuidle_probe(struct platform_device *pdev)
12494

12595
ddr2_reg_base = pdata->ddr2_ctlr_base;
12696

127-
if (pdata->ddr2_pdown)
128-
davinci_states[1].flags |= DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN;
129-
cpuidle_set_statedata(&device->states_usage[1], &davinci_states[1]);
130-
131-
device->state_count = DAVINCI_CPUIDLE_MAX_STATES;
97+
ddr2_pdown = pdata->ddr2_pdown;
13298

13399
ret = cpuidle_register_driver(&davinci_idle_driver);
134100
if (ret) {

‎arch/arm64/kernel/process.c‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,9 @@ static void default_idle(void)
9797
local_irq_enable();
9898
}
9999

100-
void (*pm_idle)(void) = default_idle;
101-
EXPORT_SYMBOL_GPL(pm_idle);
102-
103100
/*
104-
* The idle thread, has rather strange semantics for calling pm_idle,
105-
* but this is what x86 does and we need to do the same, so that
106-
* things like cpuidle get called in the same way. The only difference
107-
* is that we always respect 'hlt_counter' to prevent low power idle.
101+
* The idle thread.
102+
* We always respect 'hlt_counter' to prevent low power idle.
108103
*/
109104
void cpu_idle(void)
110105
{
@@ -122,10 +117,10 @@ void cpu_idle(void)
122117
local_irq_disable();
123118
if (!need_resched()) {
124119
stop_critical_timings();
125-
pm_idle();
120+
default_idle();
126121
start_critical_timings();
127122
/*
128-
* pm_idle functions should always return
123+
* default_idle functions should always return
129124
* with IRQs enabled.
130125
*/
131126
WARN_ON(irqs_disabled());

‎arch/blackfin/kernel/process.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@ int nr_l1stack_tasks;
3939
void *l1_stack_base;
4040
unsigned long l1_stack_len;
4141

42-
/*
43-
* Powermanagement idle function, if any..
44-
*/
45-
void (*pm_idle)(void) = NULL;
46-
EXPORT_SYMBOL(pm_idle);
47-
4842
void (*pm_power_off)(void) = NULL;
4943
EXPORT_SYMBOL(pm_power_off);
5044

@@ -81,7 +75,6 @@ void cpu_idle(void)
8175
{
8276
/* endless idle loop with no priority at all */
8377
while (1) {
84-
void (*idle)(void) = pm_idle;
8578

8679
#ifdef CONFIG_HOTPLUG_CPU
8780
if (cpu_is_offline(smp_processor_id()))

‎arch/cris/kernel/process.c‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ void enable_hlt(void)
5454

5555
EXPORT_SYMBOL(enable_hlt);
5656

57-
/*
58-
* The following aren't currently used.
59-
*/
60-
void (*pm_idle)(void);
61-
6257
extern void default_idle(void);
6358

6459
void (*pm_power_off)(void);
@@ -77,16 +72,12 @@ void cpu_idle (void)
7772
while (1) {
7873
rcu_idle_enter();
7974
while (!need_resched()) {
80-
void (*idle)(void);
8175
/*
8276
* Mark this as an RCU critical section so that
8377
* synchronize_kernel() in the unload path waits
8478
* for our completion.
8579
*/
86-
idle = pm_idle;
87-
if (!idle)
88-
idle = default_idle;
89-
idle();
80+
default_idle();
9081
}
9182
rcu_idle_exit();
9283
schedule_preempt_disabled();

‎arch/ia64/kernel/process.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ void (*ia64_mark_idle)(int);
5757

5858
unsigned long boot_option_idle_override = IDLE_NO_OVERRIDE;
5959
EXPORT_SYMBOL(boot_option_idle_override);
60-
void (*pm_idle) (void);
61-
EXPORT_SYMBOL(pm_idle);
6260
void (*pm_power_off) (void);
6361
EXPORT_SYMBOL(pm_power_off);
6462

@@ -301,7 +299,6 @@ cpu_idle (void)
301299
if (mark_idle)
302300
(*mark_idle)(1);
303301

304-
idle = pm_idle;
305302
if (!idle)
306303
idle = default_idle;
307304
(*idle)();

‎arch/ia64/kernel/setup.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,6 @@ cpu_init (void)
10511051
max_num_phys_stacked = num_phys_stacked;
10521052
}
10531053
platform_cpu_init();
1054-
pm_idle = default_idle;
10551054
}
10561055

10571056
void __init

‎arch/m32r/kernel/process.c‎

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -44,35 +44,9 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
4444
return tsk->thread.lr;
4545
}
4646

47-
/*
48-
* Powermanagement idle function, if any..
49-
*/
50-
static void (*pm_idle)(void) = NULL;
51-
5247
void (*pm_power_off)(void) = NULL;
5348
EXPORT_SYMBOL(pm_power_off);
5449

55-
/*
56-
* We use this is we don't have any better
57-
* idle routine..
58-
*/
59-
static void default_idle(void)
60-
{
61-
/* M32R_FIXME: Please use "cpu_sleep" mode. */
62-
cpu_relax();
63-
}
64-
65-
/*
66-
* On SMP it's slightly faster (but much more power-consuming!)
67-
* to poll the ->work.need_resched flag instead of waiting for the
68-
* cross-CPU IPI to arrive. Use this option with caution.
69-
*/
70-
static void poll_idle (void)
71-
{
72-
/* M32R_FIXME */
73-
cpu_relax();
74-
}
75-
7650
/*
7751
* The idle thread. There's no useful work to be
7852
* done, so just try to conserve power and have a
@@ -84,14 +58,8 @@ void cpu_idle (void)
8458
/* endless idle loop with no priority at all */
8559
while (1) {
8660
rcu_idle_enter();
87-
while (!need_resched()) {
88-
void (*idle)(void) = pm_idle;
89-
90-
if (!idle)
91-
idle = default_idle;
92-
93-
idle();
94-
}
61+
while (!need_resched())
62+
cpu_relax();
9563
rcu_idle_exit();
9664
schedule_preempt_disabled();
9765
}
@@ -120,21 +88,6 @@ void machine_power_off(void)
12088
/* M32R_FIXME */
12189
}
12290

123-
static int __init idle_setup (char *str)
124-
{
125-
if (!strncmp(str, "poll", 4)) {
126-
printk("using poll in idle threads.\n");
127-
pm_idle = poll_idle;
128-
} else if (!strncmp(str, "sleep", 4)) {
129-
printk("using sleep in idle threads.\n");
130-
pm_idle = default_idle;
131-
}
132-
133-
return 1;
134-
}
135-
136-
__setup("idle=", idle_setup);
137-
13891
void show_regs(struct pt_regs * regs)
13992
{
14093
printk("\n");

‎arch/microblaze/kernel/process.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ void show_regs(struct pt_regs *regs)
4141
regs->msr, regs->ear, regs->esr, regs->fsr);
4242
}
4343

44-
void (*pm_idle)(void);
4544
void (*pm_power_off)(void) = NULL;
4645
EXPORT_SYMBOL(pm_power_off);
4746

@@ -98,8 +97,6 @@ void cpu_idle(void)
9897

9998
/* endless idle loop with no priority at all */
10099
while (1) {
101-
void (*idle)(void) = pm_idle;
102-
103100
if (!idle)
104101
idle = default_idle;
105102

0 commit comments

Comments
 (0)