Skip to content

Commit

Permalink
Merge branches 'idle-remove-statedata', 'pm_idle' and 'idle-hsw-turbo…
Browse files Browse the repository at this point in the history
…stat' into release
  • Loading branch information
lenb committed Feb 18, 2013
3 parents 57fa827 + 558bd3e + 1ed5101 commit 2e7d0f6
Show file tree
Hide file tree
Showing 26 changed files with 281 additions and 252 deletions.
13 changes: 4 additions & 9 deletions arch/arm/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,9 @@ static void default_idle(void)
local_irq_enable();
}

void (*pm_idle)(void) = default_idle;
EXPORT_SYMBOL(pm_idle);

/*
* The idle thread, has rather strange semantics for calling pm_idle,
* but this is what x86 does and we need to do the same, so that
* things like cpuidle get called in the same way. The only difference
* is that we always respect 'hlt_counter' to prevent low power idle.
* The idle thread.
* We always respect 'hlt_counter' to prevent low power idle.
*/
void cpu_idle(void)
{
Expand Down Expand Up @@ -210,10 +205,10 @@ void cpu_idle(void)
} else if (!need_resched()) {
stop_critical_timings();
if (cpuidle_idle_call())
pm_idle();
default_idle();
start_critical_timings();
/*
* pm_idle functions must always
* default_idle functions must always
* return with IRQs enabled.
*/
WARN_ON(irqs_disabled());
Expand Down
13 changes: 4 additions & 9 deletions arch/arm64/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,9 @@ static void default_idle(void)
local_irq_enable();
}

void (*pm_idle)(void) = default_idle;
EXPORT_SYMBOL_GPL(pm_idle);

/*
* The idle thread, has rather strange semantics for calling pm_idle,
* but this is what x86 does and we need to do the same, so that
* things like cpuidle get called in the same way. The only difference
* is that we always respect 'hlt_counter' to prevent low power idle.
* The idle thread.
* We always respect 'hlt_counter' to prevent low power idle.
*/
void cpu_idle(void)
{
Expand All @@ -122,10 +117,10 @@ void cpu_idle(void)
local_irq_disable();
if (!need_resched()) {
stop_critical_timings();
pm_idle();
default_idle();
start_critical_timings();
/*
* pm_idle functions should always return
* default_idle functions should always return
* with IRQs enabled.
*/
WARN_ON(irqs_disabled());
Expand Down
7 changes: 0 additions & 7 deletions arch/blackfin/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ int nr_l1stack_tasks;
void *l1_stack_base;
unsigned long l1_stack_len;

/*
* Powermanagement idle function, if any..
*/
void (*pm_idle)(void) = NULL;
EXPORT_SYMBOL(pm_idle);

void (*pm_power_off)(void) = NULL;
EXPORT_SYMBOL(pm_power_off);

Expand Down Expand Up @@ -81,7 +75,6 @@ void cpu_idle(void)
{
/* endless idle loop with no priority at all */
while (1) {
void (*idle)(void) = pm_idle;

#ifdef CONFIG_HOTPLUG_CPU
if (cpu_is_offline(smp_processor_id()))
Expand Down
11 changes: 1 addition & 10 deletions arch/cris/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ void enable_hlt(void)

EXPORT_SYMBOL(enable_hlt);

/*
* The following aren't currently used.
*/
void (*pm_idle)(void);

extern void default_idle(void);

void (*pm_power_off)(void);
Expand All @@ -77,16 +72,12 @@ void cpu_idle (void)
while (1) {
rcu_idle_enter();
while (!need_resched()) {
void (*idle)(void);
/*
* Mark this as an RCU critical section so that
* synchronize_kernel() in the unload path waits
* for our completion.
*/
idle = pm_idle;
if (!idle)
idle = default_idle;
idle();
default_idle();
}
rcu_idle_exit();
schedule_preempt_disabled();
Expand Down
3 changes: 0 additions & 3 deletions arch/ia64/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ void (*ia64_mark_idle)(int);

unsigned long boot_option_idle_override = IDLE_NO_OVERRIDE;
EXPORT_SYMBOL(boot_option_idle_override);
void (*pm_idle) (void);
EXPORT_SYMBOL(pm_idle);
void (*pm_power_off) (void);
EXPORT_SYMBOL(pm_power_off);

Expand Down Expand Up @@ -301,7 +299,6 @@ cpu_idle (void)
if (mark_idle)
(*mark_idle)(1);

idle = pm_idle;
if (!idle)
idle = default_idle;
(*idle)();
Expand Down
1 change: 0 additions & 1 deletion arch/ia64/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,6 @@ cpu_init (void)
max_num_phys_stacked = num_phys_stacked;
}
platform_cpu_init();
pm_idle = default_idle;
}

void __init
Expand Down
51 changes: 2 additions & 49 deletions arch/m32r/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,35 +44,9 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
return tsk->thread.lr;
}

/*
* Powermanagement idle function, if any..
*/
static void (*pm_idle)(void) = NULL;

void (*pm_power_off)(void) = NULL;
EXPORT_SYMBOL(pm_power_off);

/*
* We use this is we don't have any better
* idle routine..
*/
static void default_idle(void)
{
/* M32R_FIXME: Please use "cpu_sleep" mode. */
cpu_relax();
}

/*
* On SMP it's slightly faster (but much more power-consuming!)
* to poll the ->work.need_resched flag instead of waiting for the
* cross-CPU IPI to arrive. Use this option with caution.
*/
static void poll_idle (void)
{
/* M32R_FIXME */
cpu_relax();
}

/*
* The idle thread. There's no useful work to be
* done, so just try to conserve power and have a
Expand All @@ -84,14 +58,8 @@ void cpu_idle (void)
/* endless idle loop with no priority at all */
while (1) {
rcu_idle_enter();
while (!need_resched()) {
void (*idle)(void) = pm_idle;

if (!idle)
idle = default_idle;

idle();
}
while (!need_resched())
cpu_relax();
rcu_idle_exit();
schedule_preempt_disabled();
}
Expand Down Expand Up @@ -120,21 +88,6 @@ void machine_power_off(void)
/* M32R_FIXME */
}

static int __init idle_setup (char *str)
{
if (!strncmp(str, "poll", 4)) {
printk("using poll in idle threads.\n");
pm_idle = poll_idle;
} else if (!strncmp(str, "sleep", 4)) {
printk("using sleep in idle threads.\n");
pm_idle = default_idle;
}

return 1;
}

__setup("idle=", idle_setup);

void show_regs(struct pt_regs * regs)
{
printk("\n");
Expand Down
3 changes: 0 additions & 3 deletions arch/microblaze/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ void show_regs(struct pt_regs *regs)
regs->msr, regs->ear, regs->esr, regs->fsr);
}

void (*pm_idle)(void);
void (*pm_power_off)(void) = NULL;
EXPORT_SYMBOL(pm_power_off);

Expand Down Expand Up @@ -98,8 +97,6 @@ void cpu_idle(void)

/* endless idle loop with no priority at all */
while (1) {
void (*idle)(void) = pm_idle;

if (!idle)
idle = default_idle;

Expand Down
7 changes: 0 additions & 7 deletions arch/mn10300/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@
#include <asm/gdb-stub.h>
#include "internal.h"

/*
* power management idle function, if any..
*/
void (*pm_idle)(void);
EXPORT_SYMBOL(pm_idle);

/*
* return saved PC of a blocked thread.
*/
Expand Down Expand Up @@ -113,7 +107,6 @@ void cpu_idle(void)
void (*idle)(void);

smp_rmb();
idle = pm_idle;
if (!idle) {
#if defined(CONFIG_SMP) && !defined(CONFIG_HOTPLUG_CPU)
idle = poll_idle;
Expand Down
5 changes: 0 additions & 5 deletions arch/openrisc/kernel/idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@

void (*powersave) (void) = NULL;

static inline void pm_idle(void)
{
barrier();
}

void cpu_idle(void)
{
set_thread_flag(TIF_POLLING_NRFLAG);
Expand Down
12 changes: 6 additions & 6 deletions arch/sh/kernel/idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <asm/smp.h>
#include <asm/bl_bit.h>

void (*pm_idle)(void);
static void (*sh_idle)(void);

static int hlt_counter;

Expand Down Expand Up @@ -103,9 +103,9 @@ void cpu_idle(void)
/* Don't trace irqs off for idle */
stop_critical_timings();
if (cpuidle_idle_call())
pm_idle();
sh_idle();
/*
* Sanity check to ensure that pm_idle() returns
* Sanity check to ensure that sh_idle() returns
* with IRQs enabled
*/
WARN_ON(irqs_disabled());
Expand All @@ -123,13 +123,13 @@ void __init select_idle_routine(void)
/*
* If a platform has set its own idle routine, leave it alone.
*/
if (pm_idle)
if (sh_idle)
return;

if (hlt_works())
pm_idle = default_idle;
sh_idle = default_idle;
else
pm_idle = poll_idle;
sh_idle = poll_idle;
}

void stop_this_cpu(void *unused)
Expand Down
1 change: 1 addition & 0 deletions arch/sparc/include/asm/processor_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ extern unsigned long get_wchan(struct task_struct *);
extern struct task_struct *last_task_used_math;

#define cpu_relax() barrier()
extern void (*sparc_idle)(void);

#endif

Expand Down
3 changes: 2 additions & 1 deletion arch/sparc/kernel/apc.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <asm/uaccess.h>
#include <asm/auxio.h>
#include <asm/apc.h>
#include <asm/processor.h>

/* Debugging
*
Expand Down Expand Up @@ -158,7 +159,7 @@ static int apc_probe(struct platform_device *op)

/* Assign power management IDLE handler */
if (!apc_no_idle)
pm_idle = apc_swift_idle;
sparc_idle = apc_swift_idle;

printk(KERN_INFO "%s: power management initialized%s\n",
APC_DEVNAME, apc_no_idle ? " (CPU idle disabled)" : "");
Expand Down
5 changes: 3 additions & 2 deletions arch/sparc/kernel/leon_pmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <asm/leon_amba.h>
#include <asm/cpu_type.h>
#include <asm/leon.h>
#include <asm/processor.h>

/* List of Systems that need fixup instructions around power-down instruction */
unsigned int pmc_leon_fixup_ids[] = {
Expand Down Expand Up @@ -69,9 +70,9 @@ static int __init leon_pmc_install(void)
if (sparc_cpu_model == sparc_leon) {
/* Assign power management IDLE handler */
if (pmc_leon_need_fixup())
pm_idle = pmc_leon_idle_fixup;
sparc_idle = pmc_leon_idle_fixup;
else
pm_idle = pmc_leon_idle;
sparc_idle = pmc_leon_idle;

printk(KERN_INFO "leon: power management initialized\n");
}
Expand Down
3 changes: 2 additions & 1 deletion arch/sparc/kernel/pmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <asm/oplib.h>
#include <asm/uaccess.h>
#include <asm/auxio.h>
#include <asm/processor.h>

/* Debug
*
Expand Down Expand Up @@ -63,7 +64,7 @@ static int pmc_probe(struct platform_device *op)

#ifndef PMC_NO_IDLE
/* Assign power management IDLE handler */
pm_idle = pmc_swift_idle;
sparc_idle = pmc_swift_idle;
#endif

printk(KERN_INFO "%s: power management initialized\n", PMC_DEVNAME);
Expand Down
7 changes: 3 additions & 4 deletions arch/sparc/kernel/process_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@
* Power management idle function
* Set in pm platform drivers (apc.c and pmc.c)
*/
void (*pm_idle)(void);
EXPORT_SYMBOL(pm_idle);
void (*sparc_idle)(void);

/*
* Power-off handler instantiation for pm.h compliance
Expand Down Expand Up @@ -75,8 +74,8 @@ void cpu_idle(void)
/* endless idle loop with no priority at all */
for (;;) {
while (!need_resched()) {
if (pm_idle)
(*pm_idle)();
if (sparc_idle)
(*sparc_idle)();
else
cpu_relax();
}
Expand Down
5 changes: 0 additions & 5 deletions arch/unicore32/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ static const char * const processor_modes[] = {
"UK18", "UK19", "UK1A", "EXTN", "UK1C", "UK1D", "UK1E", "SUSR"
};

/*
* The idle thread, has rather strange semantics for calling pm_idle,
* but this is what x86 does and we need to do the same, so that
* things like cpuidle get called in the same way.
*/
void cpu_idle(void)
{
/* endless idle loop with no priority at all */
Expand Down
Loading

0 comments on commit 2e7d0f6

Please sign in to comment.