* [PATCH 2/4] x86 idle APM: delete apm_cpu_idle()
2012-07-27 22:42 ` [PATCH 1/4] Revert "x86 idle APM: deprecate CONFIG_APM_CPU_IDLE" to prepare for actual removal Len Brown
@ 2012-07-27 22:42 ` Len Brown
2012-07-28 10:11 ` Alan Cox
2012-07-27 22:42 ` [PATCH 3/4] x86, idle: make default_idle() static Len Brown
2012-07-27 22:42 ` [PATCH 4/4] PM: cleanup: stop mandating that platforms export (pm_idle)() Len Brown
2 siblings, 1 reply; 8+ messages in thread
From: Len Brown @ 2012-07-27 22:42 UTC (permalink / raw)
To: x86, linux-pm, linux-kernel; +Cc: Len Brown
From: Len Brown <len.brown@intel.com>
The APM idle feature to call into the BIOS
is known to break some machines, and it has dubious benefit
on the (decades old) machines it doesn't break.
After this patch, systems running in APM mode will
simply run default_idle() and HALT, rather than calling
into the BIOS from their idle loop.
This also deletes the last modular use use of (pm_idle)()
and default_idle().
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Len Brown <len.brown@intel.com>
---
arch/x86/Kconfig | 11 ---
arch/x86/kernel/apm_32.c | 232 -----------------------------------------------
2 files changed, 243 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index c70684f..7da1e35 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1847,17 +1847,6 @@ config APM_DO_ENABLE
T400CDT. This is off by default since most machines do fine without
this feature.
-config APM_CPU_IDLE
- bool "Make CPU Idle calls when idle"
- ---help---
- Enable calls to APM CPU Idle/CPU Busy inside the kernel's idle loop.
- On some machines, this can activate improved power savings, such as
- a slowed CPU clock rate, when the machine is idle. These idle calls
- are made after the idle loop has run for some length of time (e.g.,
- 333 mS). On some machines, this will cause a hang at boot time or
- whenever the CPU becomes idle. (On machines with more than one CPU,
- this option does nothing.)
-
config APM_DISPLAY_BLANK
bool "Enable console blanking using APM"
---help---
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index 3a89ca3..31b4196 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -175,8 +175,6 @@
* Ignore first resume after we generate our own resume event
* after a suspend (Thomas Hood)
* Daemonize now gets rid of our controlling terminal (sfr).
- * CONFIG_APM_CPU_IDLE now just affects the default value of
- * idle_threshold (sfr).
* Change name of kernel apm daemon (as it no longer idles) (sfr).
* 1.16ac: Fix up SMP support somewhat. You can now force SMP on and we
* make _all_ APM calls on the CPU#0. Fix unsafe sign bug.
@@ -260,12 +258,6 @@ extern int (*console_blank_hook)(int);
* [no-]smp Use apm even on an SMP box
* bounce[-_]interval=<n> number of ticks to ignore suspend
* bounces
- * idle[-_]threshold=<n> System idle percentage above which to
- * make APM BIOS idle calls. Set it to
- * 100 to disable.
- * idle[-_]period=<n> Period (in 1/100s of a second) over
- * which the idle percentage is
- * calculated.
*/
/* KNOWN PROBLEM MACHINES:
@@ -355,26 +347,12 @@ struct apm_user {
#define APM_BIOS_MAGIC 0x4101
/*
- * idle percentage above which bios idle calls are done
- */
-#ifdef CONFIG_APM_CPU_IDLE
-#define DEFAULT_IDLE_THRESHOLD 95
-#else
-#define DEFAULT_IDLE_THRESHOLD 100
-#endif
-#define DEFAULT_IDLE_PERIOD (100 / 3)
-
-/*
* Local variables
*/
static struct {
unsigned long offset;
unsigned short segment;
} apm_bios_entry;
-static int clock_slowed;
-static int idle_threshold __read_mostly = DEFAULT_IDLE_THRESHOLD;
-static int idle_period __read_mostly = DEFAULT_IDLE_PERIOD;
-static int set_pm_idle;
static int suspends_pending;
static int standbys_pending;
static int ignore_sys_suspend;
@@ -804,165 +782,6 @@ static int set_system_power_state(u_short state)
}
/**
- * apm_do_idle - perform power saving
- *
- * This function notifies the BIOS that the processor is (in the view
- * of the OS) idle. It returns -1 in the event that the BIOS refuses
- * to handle the idle request. On a success the function returns 1
- * if the BIOS did clock slowing or 0 otherwise.
- */
-
-static int apm_do_idle(void)
-{
- u32 eax;
- u8 ret = 0;
- int idled = 0;
- int polling;
- int err = 0;
-
- polling = !!(current_thread_info()->status & TS_POLLING);
- if (polling) {
- current_thread_info()->status &= ~TS_POLLING;
- /*
- * TS_POLLING-cleared state must be visible before we
- * test NEED_RESCHED:
- */
- smp_mb();
- }
- if (!need_resched()) {
- idled = 1;
- ret = apm_bios_call_simple(APM_FUNC_IDLE, 0, 0, &eax, &err);
- }
- if (polling)
- current_thread_info()->status |= TS_POLLING;
-
- if (!idled)
- return 0;
-
- if (ret) {
- static unsigned long t;
-
- /* This always fails on some SMP boards running UP kernels.
- * Only report the failure the first 5 times.
- */
- if (++t < 5) {
- printk(KERN_DEBUG "apm_do_idle failed (%d)\n", err);
- t = jiffies;
- }
- return -1;
- }
- clock_slowed = (apm_info.bios.flags & APM_IDLE_SLOWS_CLOCK) != 0;
- return clock_slowed;
-}
-
-/**
- * apm_do_busy - inform the BIOS the CPU is busy
- *
- * Request that the BIOS brings the CPU back to full performance.
- */
-
-static void apm_do_busy(void)
-{
- u32 dummy;
- int err;
-
- if (clock_slowed || ALWAYS_CALL_BUSY) {
- (void)apm_bios_call_simple(APM_FUNC_BUSY, 0, 0, &dummy, &err);
- clock_slowed = 0;
- }
-}
-
-/*
- * If no process has really been interested in
- * the CPU for some time, we want to call BIOS
- * power management - we probably want
- * to conserve power.
- */
-#define IDLE_CALC_LIMIT (HZ * 100)
-#define IDLE_LEAKY_MAX 16
-
-static void (*original_pm_idle)(void) __read_mostly;
-
-/**
- * apm_cpu_idle - cpu idling for APM capable Linux
- *
- * This is the idling function the kernel executes when APM is available. It
- * tries to do BIOS powermanagement based on the average system idle time.
- * Furthermore it calls the system default idle routine.
- */
-
-static void apm_cpu_idle(void)
-{
- static int use_apm_idle; /* = 0 */
- static unsigned int last_jiffies; /* = 0 */
- static unsigned int last_stime; /* = 0 */
-
- int apm_idle_done = 0;
- unsigned int jiffies_since_last_check = jiffies - last_jiffies;
- unsigned int bucket;
-
-recalc:
- if (jiffies_since_last_check > IDLE_CALC_LIMIT) {
- use_apm_idle = 0;
- last_jiffies = jiffies;
- last_stime = current->stime;
- } else if (jiffies_since_last_check > idle_period) {
- unsigned int idle_percentage;
-
- idle_percentage = current->stime - last_stime;
- idle_percentage *= 100;
- idle_percentage /= jiffies_since_last_check;
- use_apm_idle = (idle_percentage > idle_threshold);
- if (apm_info.forbid_idle)
- use_apm_idle = 0;
- last_jiffies = jiffies;
- last_stime = current->stime;
- }
-
- bucket = IDLE_LEAKY_MAX;
-
- while (!need_resched()) {
- if (use_apm_idle) {
- unsigned int t;
-
- t = jiffies;
- switch (apm_do_idle()) {
- case 0:
- apm_idle_done = 1;
- if (t != jiffies) {
- if (bucket) {
- bucket = IDLE_LEAKY_MAX;
- continue;
- }
- } else if (bucket) {
- bucket--;
- continue;
- }
- break;
- case 1:
- apm_idle_done = 1;
- break;
- default: /* BIOS refused */
- break;
- }
- }
- if (original_pm_idle)
- original_pm_idle();
- else
- default_idle();
- local_irq_disable();
- jiffies_since_last_check = jiffies - last_jiffies;
- if (jiffies_since_last_check > idle_period)
- goto recalc;
- }
-
- if (apm_idle_done)
- apm_do_busy();
-
- local_irq_enable();
-}
-
-/**
* apm_power_off - ask the BIOS to power off
*
* Handle the power off sequence. This is the one piece of code we
@@ -1869,12 +1688,6 @@ static int __init apm_setup(char *str)
if ((strncmp(str, "bounce-interval=", 16) == 0) ||
(strncmp(str, "bounce_interval=", 16) == 0))
bounce_interval = simple_strtol(str + 16, NULL, 0);
- if ((strncmp(str, "idle-threshold=", 15) == 0) ||
- (strncmp(str, "idle_threshold=", 15) == 0))
- idle_threshold = simple_strtol(str + 15, NULL, 0);
- if ((strncmp(str, "idle-period=", 12) == 0) ||
- (strncmp(str, "idle_period=", 12) == 0))
- idle_period = simple_strtol(str + 12, NULL, 0);
invert = (strncmp(str, "no-", 3) == 0) ||
(strncmp(str, "no_", 3) == 0);
if (invert)
@@ -1886,7 +1699,6 @@ static int __init apm_setup(char *str)
power_off = !invert;
if (strncmp(str, "smp", 3) == 0) {
smp = !invert;
- idle_threshold = 100;
}
if ((strncmp(str, "allow-ints", 10) == 0) ||
(strncmp(str, "allow_ints", 10) == 0))
@@ -1987,17 +1799,6 @@ static int __init apm_is_horked_d850md(const struct dmi_system_id *d)
return 0;
}
-/* Some APM bioses hang on APM idle calls */
-static int __init apm_likes_to_melt(const struct dmi_system_id *d)
-{
- if (apm_info.forbid_idle == 0) {
- apm_info.forbid_idle = 1;
- printk(KERN_INFO "%s machine detected. "
- "Disabling APM idle calls.\n", d->ident);
- }
- return 0;
-}
-
/*
* Check for clue free BIOS implementations who use
* the following QA technique
@@ -2138,16 +1939,6 @@ static struct dmi_system_id __initdata apm_dmi_table[] = {
DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
DMI_MATCH(DMI_BIOS_VERSION, "A11"), },
},
- { /* APM idle hangs */
- apm_likes_to_melt, "Jabil AMD",
- { DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
- DMI_MATCH(DMI_BIOS_VERSION, "0AASNP06"), },
- },
- { /* APM idle hangs */
- apm_likes_to_melt, "AMI Bios",
- { DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
- DMI_MATCH(DMI_BIOS_VERSION, "0AASNP05"), },
- },
{ /* Handle problems with APM on Sony Vaio PCG-N505X(DE) */
swab_apm_power_in_minutes, "Sony VAIO",
{ DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
@@ -2377,14 +2168,6 @@ static int __init apm_init(void)
if (misc_register(&apm_device))
printk(KERN_WARNING "apm: Could not register misc device.\n");
- if (HZ != 100)
- idle_period = (idle_period * HZ) / 100;
- if (idle_threshold < 100) {
- original_pm_idle = pm_idle;
- pm_idle = apm_cpu_idle;
- set_pm_idle = 1;
- }
-
return 0;
}
@@ -2392,15 +2175,6 @@ static void __exit apm_exit(void)
{
int error;
- if (set_pm_idle) {
- pm_idle = original_pm_idle;
- /*
- * We are about to unload the current idle thread pm callback
- * (pm_idle), Wait for all processors to update cached/local
- * copies of pm_idle before proceeding.
- */
- kick_all_cpus_sync();
- }
if (((apm_info.bios.flags & APM_BIOS_DISENGAGED) == 0)
&& (apm_info.connection_version > 0x0100)) {
error = apm_engage_power_management(APM_DEVICE_ALL, 0);
@@ -2437,12 +2211,6 @@ MODULE_PARM_DESC(broken_psr, "BIOS has a broken GetPowerStatus call");
module_param(realmode_power_off, bool, 0444);
MODULE_PARM_DESC(realmode_power_off,
"Switch to real mode before powering off");
-module_param(idle_threshold, int, 0444);
-MODULE_PARM_DESC(idle_threshold,
- "System idle percentage above which to make APM BIOS idle calls");
-module_param(idle_period, int, 0444);
-MODULE_PARM_DESC(idle_period,
- "Period (in sec/100) over which to caculate the idle percentage");
module_param(smp, bool, 0444);
MODULE_PARM_DESC(smp,
"Set this to enable APM use on an SMP platform. Use with caution on older systems");
--
1.7.12.rc0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/4] PM: cleanup: stop mandating that platforms export (pm_idle)()
2012-07-27 22:42 ` [PATCH 1/4] Revert "x86 idle APM: deprecate CONFIG_APM_CPU_IDLE" to prepare for actual removal Len Brown
2012-07-27 22:42 ` [PATCH 2/4] x86 idle APM: delete apm_cpu_idle() Len Brown
2012-07-27 22:42 ` [PATCH 3/4] x86, idle: make default_idle() static Len Brown
@ 2012-07-27 22:42 ` Len Brown
2012-08-07 23:26 ` [linux-pm] " Kevin Hilman
2 siblings, 1 reply; 8+ messages in thread
From: Len Brown @ 2012-07-27 22:42 UTC (permalink / raw)
To: x86, linux-pm, linux-kernel
Cc: Jonas Bonn, Len Brown, #, Tony Luck, Mike Frysinger, Michal Simek,
David Howells, Mikael Starvik, Russell King, David S. Miller
From: Len Brown <len.brown@intel.com>
(pm_idle)() was originally used on x86 to vector bewteen
ACPI and APM. With the advent of CPU_IDLE, that reason
for pm_idle to exist vanished.
But x86 APM still scribbled on pm_idle from a module,
so pm_idle didn't go away. Worse, it was declared in pm.h,
and so it spread to other architectures as dead code.
But today, APM no longer scribbles on pm_idle, so
x86 no longer requires pm_idle to be visible to modules,
or global at all.
Here we remove pm_idle from pm.h, to stop the mandate
that all architectures define it.
This deletes dead code from most architectures,
while some continue using their own internal pm_idle.
At the end of the day, pm_idle...
becomes static in sh, was global
becomes static in x86, was EXPORT_SYMBOL
becomes as global in sparc, was EXPORT_SYMBOL
continues as static in m32r (no pm.h use there)
and is deleted from all other places in the kernel.
Signed-off-by: Len Brown <len.brown@intel.com>
Cc: x86@kernel.org # x86
Cc: Mike Frysinger <vapier@gentoo.org> # blackfin
Cc: Jonas Bonn <jonas@southpole.se> # openrisc
Cc: Tony Luck <tony.luck@intel.com> # ia64
Cc: David Howells <dhowells@redhat.com> # mn10300
Cc: Mikael Starvik <starvik@axis.com> # cris
Cc: Michal Simek <monstr@monstr.eu> # microblaze
Cc: Paul Mundt <lethal@linux-sh.org> # sh
Cc: David S. Miller <davem@davemloft.net> # sparc
Cc: Russell King <linux@arm.linux.org.uk> # ARM
Cc: Rafael J. Wysocki <rjw@sisk.pl> # PM
---
arch/arm/kernel/process.c | 12 +++---------
arch/blackfin/kernel/process.c | 9 +--------
arch/cris/kernel/process.c | 17 ++---------------
arch/ia64/include/asm/processor.h | 2 --
arch/ia64/kernel/process.c | 10 ++--------
arch/ia64/kernel/setup.c | 1 -
arch/microblaze/kernel/process.c | 8 +-------
arch/mn10300/kernel/process.c | 16 ++--------------
arch/openrisc/kernel/idle.c | 5 -----
arch/sh/kernel/idle.c | 2 +-
arch/sparc/include/asm/setup.h | 1 +
arch/sparc/kernel/process_32.c | 1 -
arch/unicore32/kernel/process.c | 5 -----
arch/x86/kernel/process.c | 5 +----
include/linux/pm.h | 1 -
kernel/smp.c | 4 ++--
16 files changed, 16 insertions(+), 83 deletions(-)
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 19c95ea..6af852e 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -172,14 +172,8 @@ 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.
+ * Respect 'hlt_counter' to prevent low power idle.
*/
void cpu_idle(void)
{
@@ -210,10 +204,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
+ * idle functions must always
* return with IRQs enabled.
*/
WARN_ON(irqs_disabled());
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c
index 62bcea7..892402a 100644
--- a/arch/blackfin/kernel/process.c
+++ b/arch/blackfin/kernel/process.c
@@ -42,9 +42,6 @@ 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);
@@ -81,18 +78,14 @@ 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()))
cpu_die();
#endif
- if (!idle)
- idle = default_idle;
tick_nohz_idle_enter();
rcu_idle_enter();
while (!need_resched())
- idle();
+ default_idle();
rcu_idle_exit();
tick_nohz_idle_exit();
preempt_enable_no_resched();
diff --git a/arch/cris/kernel/process.c b/arch/cris/kernel/process.c
index 66fd017..ff20d39 100644
--- a/arch/cris/kernel/process.c
+++ b/arch/cris/kernel/process.c
@@ -54,12 +54,8 @@ void enable_hlt(void)
EXPORT_SYMBOL(enable_hlt);
/*
- * The following aren't currently used.
+ * The following is currently used.
*/
-void (*pm_idle)(void);
-
-extern void default_idle(void);
-
void (*pm_power_off)(void);
EXPORT_SYMBOL(pm_power_off);
@@ -75,16 +71,7 @@ void cpu_idle (void)
/* endless idle loop with no priority at all */
while (1) {
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();
}
schedule_preempt_disabled();
}
diff --git a/arch/ia64/include/asm/processor.h b/arch/ia64/include/asm/processor.h
index 832dd37..dea1ed3 100644
--- a/arch/ia64/include/asm/processor.h
+++ b/arch/ia64/include/asm/processor.h
@@ -717,8 +717,6 @@ extern unsigned long boot_option_idle_override;
enum idle_boot_override {IDLE_NO_OVERRIDE=0, IDLE_HALT, IDLE_FORCE_MWAIT,
IDLE_NOMWAIT, IDLE_POLL};
-void default_idle(void);
-
#define ia64_platform_is(x) (strcmp(x, platform_name) == 0)
#endif /* !__ASSEMBLY__ */
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index dd6fc14..e7c651c 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -56,8 +56,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);
@@ -229,7 +227,7 @@ update_pal_halt_status(int status)
/*
* We use this if we don't have any better idle routine..
*/
-void
+static void
default_idle (void)
{
local_irq_enable();
@@ -291,7 +289,6 @@ cpu_idle (void)
}
if (!need_resched()) {
- void (*idle)(void);
#ifdef CONFIG_SMP
min_xtp();
#endif
@@ -299,10 +296,7 @@ cpu_idle (void)
if (mark_idle)
(*mark_idle)(1);
- idle = pm_idle;
- if (!idle)
- idle = default_idle;
- (*idle)();
+ default_idle();
if (mark_idle)
(*mark_idle)(0);
#ifdef CONFIG_SMP
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index aaefd9b..2029cc0 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -1051,7 +1051,6 @@ cpu_init (void)
max_num_phys_stacked = num_phys_stacked;
}
platform_cpu_init();
- pm_idle = default_idle;
}
void __init
diff --git a/arch/microblaze/kernel/process.c b/arch/microblaze/kernel/process.c
index 1944e00..508d225 100644
--- a/arch/microblaze/kernel/process.c
+++ b/arch/microblaze/kernel/process.c
@@ -40,7 +40,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);
@@ -97,15 +96,10 @@ void cpu_idle(void)
/* endless idle loop with no priority at all */
while (1) {
- void (*idle)(void) = pm_idle;
-
- if (!idle)
- idle = default_idle;
-
tick_nohz_idle_enter();
rcu_idle_enter();
while (!need_resched())
- idle();
+ default_idle();
rcu_idle_exit();
tick_nohz_idle_exit();
diff --git a/arch/mn10300/kernel/process.c b/arch/mn10300/kernel/process.c
index 7dab0cd..6312a31 100644
--- a/arch/mn10300/kernel/process.c
+++ b/arch/mn10300/kernel/process.c
@@ -36,12 +36,6 @@
#include "internal.h"
/*
- * power management idle function, if any..
- */
-void (*pm_idle)(void);
-EXPORT_SYMBOL(pm_idle);
-
-/*
* return saved PC of a blocked thread.
*/
unsigned long thread_saved_pc(struct task_struct *tsk)
@@ -108,18 +102,12 @@ void cpu_idle(void)
/* endless idle loop with no priority at all */
for (;;) {
while (!need_resched()) {
- void (*idle)(void);
-
smp_rmb();
- idle = pm_idle;
- if (!idle) {
#if defined(CONFIG_SMP) && !defined(CONFIG_HOTPLUG_CPU)
- idle = poll_idle;
+ poll_idle();
#else /* CONFIG_SMP && !CONFIG_HOTPLUG_CPU */
- idle = default_idle;
+ default_idle();
#endif /* CONFIG_SMP && !CONFIG_HOTPLUG_CPU */
- }
- idle();
}
schedule_preempt_disabled();
diff --git a/arch/openrisc/kernel/idle.c b/arch/openrisc/kernel/idle.c
index 7d618fe..5e8a3b6 100644
--- a/arch/openrisc/kernel/idle.c
+++ b/arch/openrisc/kernel/idle.c
@@ -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);
diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c
index 0c91016..f063b92 100644
--- a/arch/sh/kernel/idle.c
+++ b/arch/sh/kernel/idle.c
@@ -22,7 +22,7 @@
#include <asm/smp.h>
#include <asm/bl_bit.h>
-void (*pm_idle)(void);
+static void (*pm_idle)(void);
static int hlt_counter;
diff --git a/arch/sparc/include/asm/setup.h b/arch/sparc/include/asm/setup.h
index 8a83699..33bef87 100644
--- a/arch/sparc/include/asm/setup.h
+++ b/arch/sparc/include/asm/setup.h
@@ -34,6 +34,7 @@ extern void sun_do_break(void);
extern int stop_a_enabled;
extern int scons_pwroff;
+extern void (*pm_idle)(void);
#endif /* __KERNEL__ */
#endif /* _SPARC_SETUP_H */
diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c
index cb36e82..1c702bd 100644
--- a/arch/sparc/kernel/process_32.c
+++ b/arch/sparc/kernel/process_32.c
@@ -44,7 +44,6 @@
* Set in pm platform drivers (apc.c and pmc.c)
*/
void (*pm_idle)(void);
-EXPORT_SYMBOL(pm_idle);
/*
* Power-off handler instantiation for pm.h compliance
diff --git a/arch/unicore32/kernel/process.c b/arch/unicore32/kernel/process.c
index b6f0458..3841ef97 100644
--- a/arch/unicore32/kernel/process.c
+++ b/arch/unicore32/kernel/process.c
@@ -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 */
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 165f870..c385cfa 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -372,10 +372,7 @@ EXPORT_SYMBOL(boot_option_idle_override);
/*
* Powermanagement idle function, if any..
*/
-void (*pm_idle)(void);
-#ifdef CONFIG_APM_MODULE
-EXPORT_SYMBOL(pm_idle);
-#endif
+static void (*pm_idle)(void);
static inline int hlt_use_halt(void)
{
diff --git a/include/linux/pm.h b/include/linux/pm.h
index f067e60..6b92c37 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -31,7 +31,6 @@
/*
* Callbacks for platform drivers to implement.
*/
-extern void (*pm_idle)(void);
extern void (*pm_power_off)(void);
extern void (*pm_power_off_prepare)(void);
diff --git a/kernel/smp.c b/kernel/smp.c
index d0ae5b2..ede77e4 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -803,11 +803,11 @@ static void do_nothing(void *unused)
/**
* kick_all_cpus_sync - Force all cpus out of idle
*
- * Used to synchronize the update of pm_idle function pointer. It's
+ * Used to synchronize the update of idle function pointer. It's
* called after the pointer is updated and returns after the dummy
* callback function has been executed on all cpus. The execution of
* the function can only happen on the remote cpus after they have
- * left the idle function which had been called via pm_idle function
+ * left the idle function which had been called via idle function
* pointer. So it's guaranteed that nothing uses the previous pointer
* anymore.
*/
--
1.7.12.rc0
^ permalink raw reply related [flat|nested] 8+ messages in thread