CPUidle: compile fix for non-x86
Subsystems (3)
PATCH 1/1 CPUidle: compile fix for non-x86
Hi,
Please have a look at this.
Rafael
Wrap cpu_idle_wait() in an x86 #ifdef since it's x86 only.
drivers/cpuidle/cpuidle.c +2 -0
@@ -82,7 +82,9 @@ void cpuidle_uninstall_idle_handler(void) {if (enabled_devices && (pm_idle != pm_idle_old)) { pm_idle = pm_idle_old; +#ifdef CONFIG_X86 cpu_idle_wait (); +#endif } }
_______________________________________________
linux-pm mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/linux-pm
Quoted 24 lines
-----Original Message-----
From: Rafael J. Wysocki [mailto:[email protected]]
Sent: Wednesday, January 30, 2008 2:17 AM
To: Len Brown
Cc: ACPI Devel Maling List; Pallipadi, Venkatesh; Kevin Hilman
Subject: Fwd: [linux-pm] [PATCH] CPUidle: compile fix for non-x86Hi,
Please have a look at this.
Rafael
Wrap
cpu_idle_wait()in an x86 #ifdef since it's x86 only.Signed-off-by Kevin Hilman <[email protected]>drivers/cpuidle/cpuidle.c +0
-0
drivers/cpuidle/cpuidle.c void cpuidle_uninstall_idle_handler(void) · line 88
Quoted 7 lines
drivers/cpuidle/cpuidle.c +2
-0@@ -82,7 +82,9 @@ void cpuidle_uninstall_idle_handler(void) {if (enabled_devices && (pm_idle != pm_idle_old)) { pm_idle = pm_idle_old; +#ifdef CONFIG_X86 cpu_idle_wait (); +#endif
The archs that do not have cpu_idle_wait() and has more than one CPU will need something equivalent to cpu_idle_wait() to kick all other CPUs out of idle loop.
The reason being we do not want another CPU to be in idle loop that is being uninstalled here.
Do you have more than one logical CPU on your platform?
Thanks,
Venki
Quoted 22 lines · Venkatesh
Quoted 8 lines
Wrap
cpu_idle_wait()in an x86 #ifdef since it's x86 only.Signed-off-by Kevin Hilman <[email protected]>drivers/cpuidle/cpuidle.c +0
-0drivers/cpuidle/cpuidle.c void cpuidle_uninstall_idle_handler(void) · line 88
Quoted 7 lines
drivers/cpuidle/cpuidle.c +2
-0@@ -82,7 +82,9 @@ void cpuidle_uninstall_idle_handler(void) {if (enabled_devices && (pm_idle != pm_idle_old)) { pm_idle = pm_idle_old; +#ifdef CONFIG_X86 cpu_idle_wait (); +#endif The archs that do not have
cpu_idle_wait()and has more than one CPU will need something equivalent tocpu_idle_wait()to kick all other CPUs out of idle loop.
The reason being we do not want another CPU to be in idle loop that is being uninstalled here.
Quoted 1 line
Do you have more than one logical CPU on your platform?
No, I'm testing on a UP ARM-based platform (TI OMAP.)
Maybe #ifdef CONFIG_SMP is the right thing instead of #ifdef CONFIG_X86?
Kevin
Quoted 33 lines
-----Original Message-----
From: Kevin Hilman [mailto:[email protected]]
Sent: Thursday, January 31, 2008 10:51 AM
To: Pallipadi, Venkatesh
Cc: Len Brown; ACPI Devel Maling List
Subject: Re: [linux-pm] [PATCH] CPUidle: compile fix for non-x86Quoted 18 lines · Venkatesh
Quoted 8 lines
Wrap
cpu_idle_wait()in an x86 #ifdef since it's x86 only.Signed-off-by Kevin Hilman <[email protected]>drivers/cpuidle/cpuidle.c +0
-0drivers/cpuidle/cpuidle.c void cpuidle_uninstall_idle_handler(void) · line 88
Quoted 7 lines
drivers/cpuidle/cpuidle.c +2
-0@@ -82,7 +82,9 @@ void cpuidle_uninstall_idle_handler(void) {if (enabled_devices && (pm_idle != pm_idle_old)) { pm_idle = pm_idle_old; +#ifdef CONFIG_X86 cpu_idle_wait (); +#endif The archs that do not have
cpu_idle_wait()and has more than one CPU will need something equivalent tocpu_idle_wait()to kickall other CPUs
Quoted 2 lines
out of idle loop.
The reason being we do not want another CPU to be in idleloop that is
Quoted 9 lines
Quoted 3 lines
being uninstalled here.
Do you have more than one logical CPU on your platform?
No, I'm testing on a UP ARM-based platform (TI OMAP.)
Maybe #ifdef
CONFIG_SMPis the right thing instead of #ifdefCONFIG_X86?
Yes. Something like below seems better.
#if !defined(CONFIG_SMP)
#define cpuidle_kick_cpus() do{}while (0)
#elif defined(CONFIG_X86)
#define cpuidle_kick_cpus() cpu_idle_wait()
#else
# error "Arch needs cpu_idle_wait() equivalent here" #endif
Thanks,
Venki
[Updated patch pased on suggestions from Venkatesh.]
Convert cpu_idle_wait() to cpuidle_kick_cpus() macro which is SMP-only, and gives error on non supported CPU.
drivers/cpuidle/cpuidle.c +9 -1
@@ -18,6 +18,14 @@#include "cpuidle.h" +#if !defined(CONFIG_SMP ) +#define cpuidle_kick_cpus () do { } while (0) +#elif defined(CONFIG_X86 ) +#define cpuidle_kick_cpus () cpu_idle_wait() +#else +#error "Arch needs cpu_idle_wait() equivalent here" +#endif + DEFINE_PER_CPU(struct cpuidle_device *, cpuidle_devices);DEFINE_MUTEX (cpuidle_lock);
@@ -82,7 +90,7 @@ void cpuidle_uninstall_idle_handler(void) {if (enabled_devices && (pm_idle != pm_idle_old)) { pm_idle = pm_idle_old; -cpu_idle_wait (); +cpuidle_kick_cpus (); } }
Pallipadi, Venkatesh
Acked-byLen,
Please include this along with your other cpuidle patches for 2.6.25.
Thanks,
Venki
Quoted 43 lines
-----Original Message-----
From: Kevin Hilman [mailto:[email protected]]
Sent: Thursday, January 31, 2008 12:06 PM
To: Pallipadi, Venkatesh
Cc: Len Brown; ACPI Devel Maling List
Subject: Re: [linux-pm] [PATCH] CPUidle: compile fix for non-x86[Updated patch pased on suggestions from Venkatesh.]
Convert
cpu_idle_wait()tocpuidle_kick_cpus()macro which is SMP-only, and gives error on non supported CPU.Signed-off-by Kevin Hilman <[email protected]>drivers/cpuidle/cpuidle.c +9
-1@@ -18,6 +18,14 @@#include "cpuidle.h" +#if !defined(CONFIG_SMP ) +#define cpuidle_kick_cpus () do { } while (0) +#elif defined(CONFIG_X86 ) +#define cpuidle_kick_cpus () cpu_idle_wait() +#else +#error "Arch needs cpu_idle_wait() equivalent here" +#endif + DEFINE_PER_CPU(struct cpuidle_device *, cpuidle_devices);DEFINE_MUTEX (cpuidle_lock);@@ -82,7 +90,7 @@ void cpuidle_uninstall_idle_handler(void) {if (enabled_devices && (pm_idle != pm_idle_old)) { pm_idle = pm_idle_old; -cpu_idle_wait (); +cpuidle_kick_cpus (); } }
Quoted 12 lines · Kevin Hilman
[Updated patch pased on suggestions from Venkatesh.]
Convert
cpu_idle_wait()tocpuidle_kick_cpus()macro which is SMP-only, and gives error on non supported CPU.Signed-off-by Kevin Hilman <[email protected]>drivers/cpuidle/cpuidle.c +0
-0
drivers/cpuidle/cpuidle.c line 27
Quoted 10 lines
drivers/cpuidle/cpuidle.c +7
-0@@ -18,6 +18,14 @@#include "cpuidle.h" +#if !defined(CONFIG_SMP ) +#define cpuidle_kick_cpus () do { } while (0) +#elif defined(CONFIG_X86 ) +#define cpuidle_kick_cpus () cpu_idle_wait() +#else +#error "Arch needs cpu_idle_wait() equivalent here" +#endif
Perhaps it would be better to define cpuidle_kick_cpus() as a static inline function in cpuidle.h . Pretty please?
Quoted 14 lines
drivers/cpuidle/cpuidle.c +2
-2+ DEFINE_PER_CPU(struct cpuidle_device *, cpuidle_devices);DEFINE_MUTEX (cpuidle_lock);@@ -82,7 +90,7 @@ void cpuidle_uninstall_idle_handler(void) {if (enabled_devices && (pm_idle != pm_idle_old)) { pm_idle = pm_idle_old; -cpu_idle_wait (); +cpuidle_kick_cpus (); } } -
[ Updated with suggestions from Rafael ]
Convert cpu_idle_wait() to cpuidle_kick_cpus() macro which is SMP-only, and gives error on non supported CPU.
drivers/cpuidle/cpuidle.c +1 -1
@@ -82,7 +82,7 @@ void cpuidle_uninstall_idle_handler(void) {if (enabled_devices && (pm_idle != pm_idle_old)) { pm_idle = pm_idle_old; -cpu_idle_wait (); +cpuidle_kick_cpus (); } }
include/linux/cpuidle.h +11 -0
@@ -72,6 +72,17 @@ cpuidle_set_statedata(struct cpuidle_state *state, void *data) state->driver_data = data; } +#if !defined(CONFIG_SMP ) +static inline void cpuidle_kick_cpus (void ) {} +#elif defined(CONFIG_X86 ) +static inline void cpuidle_kick_cpus (void ) +{ + cpu_idle_wait() +} +#else +#error "Arch needs cpu_idle_wait() equivalent here" +#endif +struct cpuidle_state_kobj {struct cpuidle_state *state;struct completion kobj_unregister;
Quoted 25 lines · Kevin Hilman
[ Updated with suggestions from Rafael ]
Convert
cpu_idle_wait()tocpuidle_kick_cpus()macro which is SMP-only, and gives error on non supported CPU.Signed-off-by Kevin Hilman <[email protected]>drivers/cpuidle/cpuidle.c +1
-1@@ -82,7 +82,7 @@ void cpuidle_uninstall_idle_handler(void) {if (enabled_devices && (pm_idle != pm_idle_old)) { pm_idle = pm_idle_old; -cpu_idle_wait (); +cpuidle_kick_cpus (); } }include/linux/cpuidle.h +0
-0
include/linux/cpuidle.h cpuidle_set_statedata(struct cpuidle_state *state, void *data) · line 75
Quoted 4 lines
include/linux/cpuidle.h +1
-0@@ -72,6 +72,17 @@ cpuidle_set_statedata(struct cpuidle_state *state, void *data) state->driver_data = data; } +#if !defined(CONFIG_SMP )
#ifndef surely?
include/linux/cpuidle.h cpuidle_set_statedata(struct cpuidle_state *state, void *data) · line 77
Quoted 2 lines
include/linux/cpuidle.h +2
-0+static inline void cpuidle_kick_cpus (void ) {} +#elif defined(CONFIG_X86 )
I'd do that instead:
#ifdef CONFIG_SMP
#ifdef ARCH_HAS_CPU_IDLE_WAIT
include/linux/cpuidle.h cpuidle_set_statedata(struct cpuidle_state *state, void *data) · line 81
Quoted 4 lines
include/linux/cpuidle.h +4
-0+static inline void cpuidle_kick_cpus (void ) +{ + cpu_idle_wait() +}
#else /* !ARCH_HAS_CPU_IDLE_WAIT */
include/linux/cpuidle.h cpuidle_set_statedata(struct cpuidle_state *state, void *data) · line 83
Quoted 1 line
include/linux/cpuidle.h +1
-0+#error "Arch needs cpu_idle_wait() equivalent here"
#endif /* !ARCH_HAS_CPU_IDLE_WAIT */
#else /* !CONFIG_SMP */
static inline void cpuidle_kick_cpus(void) {}
#endif /* !CONFIG_SMP */
include/linux/cpuidle.h cpuidle_set_statedata(struct cpuidle_state *state, void *data) · line 88
Quoted 4 lines
include/linux/cpuidle.h +1
-0+struct cpuidle_state_kobj {struct cpuidle_state *state;struct completion kobj_unregister;
and define ARCH_HAS_CPU_IDLE_WAIT in the x86 Kconfig.
[ Another update based on Rafael's suggestions. ]
Convert cpu_idle_wait() to cpuidle_kick_cpus() macro which is SMP-only, and gives error on non supported CPU.
arch/x86/Kconfig +3 -0
@@ -105,6 +105,9 @@ config ARCH_HAS_ILOG2_U32 config ARCH_HAS_ILOG2_U64 def_bool n +config ARCH_HAS_CPU_IDLE_WAIT + def_bool y + config GENERIC_CALIBRATE_DELAY def_bool y
drivers/cpuidle/cpuidle.c +1 -1
@@ -82,7 +82,7 @@ void cpuidle_uninstall_idle_handler(void) {if (enabled_devices && (pm_idle != pm_idle_old)) { pm_idle = pm_idle_old; -cpu_idle_wait (); +cpuidle_kick_cpus (); } }
include/linux/cpuidle.h +13 -0
@@ -72,6 +72,19 @@ cpuidle_set_statedata(struct cpuidle_state *state, void *data) state->driver_data = data; } +#ifdef CONFIG_SMP +#ifdef ARCH_HAS_CPU_IDLE_WAIT +static inline void cpuidle_kick_cpus (void ) +{ + cpu_idle_wait() +} +#else /* !ARCH_HAS_CPU_IDLE_WAIT */ +#error "Arch needs cpu_idle_wait() equivalent here" +#endif /* !ARCH_HAS_CPU_IDLE_WAIT */ +#else /* !CONFIG_SMP */ +static inline void cpuidle_kick_cpus (void ) {} +#endif /* !CONFIG_SMP */ +struct cpuidle_state_kobj {struct cpuidle_state *state;struct completion kobj_unregister;
Quoted 48 lines
-----Original Message-----
From: Kevin Hilman [mailto:[email protected]]
Sent: Thursday, January 31, 2008 1:34 PM
To: Rafael J. Wysocki
Cc: Pallipadi, Venkatesh; Len Brown; ACPI Devel Maling List
Subject: Re: [linux-pm] [PATCH] CPUidle: compile fix for non-x86[ Another update based on Rafael's suggestions. ]
Convert
cpu_idle_wait()tocpuidle_kick_cpus()macro which is SMP-only, and gives error on non supported CPU.Signed-off-by Kevin Hilman <[email protected]>arch/x86/Kconfig +0
-0@@ -105,6 +105,9 @@ config ARCH_HAS_ILOG2_U32config
ARCH_HAS_ILOG2_U64
def_boolnarch/x86/Kconfig +3
-0+config ARCH_HAS_CPU_IDLE_WAIT + def_bool y +config
GENERIC_CALIBRATE_DELAY
def_boolydrivers/cpuidle/cpuidle.c +1
-1@@ -82,7 +82,7 @@ void cpuidle_uninstall_idle_handler(void) {if (enabled_devices && (pm_idle != pm_idle_old)) { pm_idle = pm_idle_old; -cpu_idle_wait (); +cpuidle_kick_cpus (); } }include/linux/cpuidle.h +0
-0
include/linux/cpuidle.h cpuidle_set_statedata(struct cpuidle_state · line 77
Quoted 6 lines
include/linux/cpuidle.h +2
-0@@ -72,6 +72,19 @@ cpuidle_set_statedata(struct cpuidle_state *state, void *data) state->driver_data = data; } +#ifdef CONFIG_SMP +#ifdef ARCH_HAS_CPU_IDLE_WAIT
You will have to do this one more time :-(. This has to be CONFIG_ARCH_HAS_CPU_IDLE_WAIT instead of ARCH_HAS_CPU_IDLE_WAIT here.
Thanks,
Venki
Quoted 51 lines · Venkatesh
Quoted 51 lines
-----Original Message-----
From: Kevin Hilman [mailto:[email protected]]
Sent: Thursday, January 31, 2008 1:34 PM
To: Rafael J. Wysocki
Cc: Pallipadi, Venkatesh; Len Brown; ACPI Devel Maling List
Subject: Re: [linux-pm] [PATCH] CPUidle: compile fix for non-x86[ Another update based on Rafael's suggestions. ]
Convert
cpu_idle_wait()tocpuidle_kick_cpus()macro which is SMP-only, and gives error on non supported CPU.Signed-off-by Kevin Hilman <[email protected]>arch/x86/Kconfig +0
-0@@ -105,6 +105,9 @@ config ARCH_HAS_ILOG2_U32config
ARCH_HAS_ILOG2_U64
def_boolnarch/x86/Kconfig +3
-0+config ARCH_HAS_CPU_IDLE_WAIT + def_bool y +config
GENERIC_CALIBRATE_DELAY
def_boolydrivers/cpuidle/cpuidle.c +1
-1@@ -82,7 +82,7 @@ void cpuidle_uninstall_idle_handler(void) {if (enabled_devices && (pm_idle != pm_idle_old)) { pm_idle = pm_idle_old; -cpu_idle_wait (); +cpuidle_kick_cpus (); } }include/linux/cpuidle.h +0
-0@@ -72,6 +72,19 @@ cpuidle_set_statedata(struct cpuidle_state *state, void *data) state->driver_data = data; }
Quoted 6 lines
include/linux/cpuidle.h cpuidle_set_statedata(struct cpuidle_state *state, void *data) · line 76
Quoted 2 lines
include/linux/cpuidle.h +2
-0+#ifdef CONFIG_SMP +#ifdef ARCH_HAS_CPU_IDLE_WAIT You will have to do this one more time :-(. This has to be
CONFIG_ARCH_HAS_CPU_IDLE_WAITinstead ofARCH_HAS_CPU_IDLE_WAIThere.
That's correct. My fault actually, sorry.
Thanks,
Rafael
OK, one more (last?) time. :)
Convert cpu_idle_wait() to cpuidle_kick_cpus() macro which is SMP-only, and gives error on non supported CPU.
arch/x86/Kconfig +3 -0
@@ -105,6 +105,9 @@ config ARCH_HAS_ILOG2_U32 config ARCH_HAS_ILOG2_U64 def_bool n +config ARCH_HAS_CPU_IDLE_WAIT + def_bool y + config GENERIC_CALIBRATE_DELAY def_bool y
drivers/cpuidle/cpuidle.c +1 -1
@@ -82,7 +82,7 @@ void cpuidle_uninstall_idle_handler(void) {if (enabled_devices && (pm_idle != pm_idle_old)) { pm_idle = pm_idle_old; -cpu_idle_wait (); +cpuidle_kick_cpus (); } }
include/linux/cpuidle.h +13 -0
@@ -72,6 +72,19 @@ cpuidle_set_statedata(struct cpuidle_state *state, void *data) state->driver_data = data; } +#ifdef CONFIG_SMP +#ifdef CONFIG_ARCH_HAS_CPU_IDLE_WAIT +static inline void cpuidle_kick_cpus (void ) +{ + cpu_idle_wait() +} +#else /* !ARCH_HAS_CPU_IDLE_WAIT */ +#error "Arch needs cpu_idle_wait() equivalent here" +#endif /* !ARCH_HAS_CPU_IDLE_WAIT */ +#else /* !CONFIG_SMP */ +static inline void cpuidle_kick_cpus (void ) {} +#endif /* !CONFIG_SMP */ +struct cpuidle_state_kobj {struct cpuidle_state *state;struct completion kobj_unregister;
Quoted 1 line · Kevin Hilman
OK, one more (last?) time. :)
Er, no.
Quoted 37 lines
Convert
cpu_idle_wait()tocpuidle_kick_cpus()macro which is SMP-only, and gives error on non supported CPU.Signed-off-by Kevin Hilman <[email protected]>arch/x86/Kconfig +3
-0@@ -105,6 +105,9 @@ config ARCH_HAS_ILOG2_U32 config ARCH_HAS_ILOG2_U64 def_bool n +config ARCH_HAS_CPU_IDLE_WAIT + def_bool y + config GENERIC_CALIBRATE_DELAY def_bool ydrivers/cpuidle/cpuidle.c +1
-1@@ -82,7 +82,7 @@ void cpuidle_uninstall_idle_handler(void) {if (enabled_devices && (pm_idle != pm_idle_old)) { pm_idle = pm_idle_old; -cpu_idle_wait (); +cpuidle_kick_cpus (); } }include/linux/cpuidle.h +0
-0
include/linux/cpuidle.h cpuidle_set_statedata(struct cpuidle_state *state, void *data) · line 81
Quoted 10 lines
include/linux/cpuidle.h +7
-0@@ -72,6 +72,19 @@ cpuidle_set_statedata(struct cpuidle_state *state, void *data) state->driver_data = data; } +#ifdef CONFIG_SMP +#ifdef CONFIG_ARCH_HAS_CPU_IDLE_WAIT +static inline void cpuidle_kick_cpus (void ) +{ + cpu_idle_wait() +} +#else /* !ARCH_HAS_CPU_IDLE_WAIT */
Please add the CONFIG_ here too.
include/linux/cpuidle.h cpuidle_set_statedata(struct cpuidle_state *state, void *data) · line 83
Quoted 2 lines
include/linux/cpuidle.h +2
-0+#error "Arch needs cpu_idle_wait() equivalent here" +#endif /* !ARCH_HAS_CPU_IDLE_WAIT */
And here.
include/linux/cpuidle.h cpuidle_set_statedata(struct cpuidle_state *state, void *data) · line 90
Quoted 8 lines
include/linux/cpuidle.h +4
-0+#else /* !CONFIG_SMP */ +static inline void cpuidle_kick_cpus (void ) {} +#endif /* !CONFIG_SMP */ +struct cpuidle_state_kobj {struct cpuidle_state *state;struct completion kobj_unregister;
Thanks,
Rafael
Len Brown
reviewerApplied w/ Rafael's comment fixes included.
thanks,
-Len
Quoted 76 lines · Rafael J. Wysocki
Quoted 1 line · Kevin Hilman
OK, one more (last?) time. :)
Er, no.
Quoted 37 lines
Convert
cpu_idle_wait()tocpuidle_kick_cpus()macro which is SMP-only, and gives error on non supported CPU.Signed-off-by Kevin Hilman <[email protected]>arch/x86/Kconfig +3
-0@@ -105,6 +105,9 @@ config ARCH_HAS_ILOG2_U32 config ARCH_HAS_ILOG2_U64 def_bool n +config ARCH_HAS_CPU_IDLE_WAIT + def_bool y + config GENERIC_CALIBRATE_DELAY def_bool ydrivers/cpuidle/cpuidle.c +1
-1@@ -82,7 +82,7 @@ void cpuidle_uninstall_idle_handler(void) {if (enabled_devices && (pm_idle != pm_idle_old)) { pm_idle = pm_idle_old; -cpu_idle_wait (); +cpuidle_kick_cpus (); } }include/linux/cpuidle.h +0
-0include/linux/cpuidle.h cpuidle_set_statedata(struct cpuidle_state *state, void *data) · line 81
Quoted 10 lines
include/linux/cpuidle.h +7
-0@@ -72,6 +72,19 @@ cpuidle_set_statedata(struct cpuidle_state *state, void *data) state->driver_data = data; } +#ifdef CONFIG_SMP +#ifdef CONFIG_ARCH_HAS_CPU_IDLE_WAIT +static inline void cpuidle_kick_cpus (void ) +{ + cpu_idle_wait() +} +#else /* !ARCH_HAS_CPU_IDLE_WAIT */ Please add the
CONFIG_here too.include/linux/cpuidle.h cpuidle_set_statedata(struct cpuidle_state *state, void *data) · line 83
Quoted 2 lines
include/linux/cpuidle.h +2
-0+#error "Arch needs cpu_idle_wait() equivalent here" +#endif /* !ARCH_HAS_CPU_IDLE_WAIT */ And here.
include/linux/cpuidle.h cpuidle_set_statedata(struct cpuidle_state *state, void *data) · line 90
Quoted 8 lines
include/linux/cpuidle.h +4
-0+#else /* !CONFIG_SMP */ +static inline void cpuidle_kick_cpus (void ) {} +#endif /* !CONFIG_SMP */ +struct cpuidle_state_kobj {struct cpuidle_state *state;struct completion kobj_unregister;Thanks,
Rafael
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines · Len Brown
Applied w/ Rafael's comment fixes included.
thanks,
-Len
Len pointed out that the last posted version of this patch gave compile error on IA64. So, here goes yet another rewrite of the patch.
[PATCH] CPU_IDLE: Compile fix for non x86 arch
From: Venkatesh Pallipadi <[email protected]>
Convert cpu_idle_wait() to cpuidle_kick_cpus() which is SMP-only, and gives error on non supported CPU.
Changes from last patch sent by Kevin:
Moved the definition of kick_cpus back to cpuidle.c from cpuidle.h:
* Having it in .h gives #error on archs which includes the header file without actually having CPU_IDLE configured. To make it work in .h, we need one more #ifdef around that code which makes it messy.
* Also, the function is only called from one file. So, it can be in declared statically in .c rather than making it available to everyone who includes the .h file.
arch/x86/Kconfig +0 -0
arch/x86/Kconfig +3 -0
@@ -105,6 +105,9 @@ config ARCH_HAS_ILOG2_U32 config ARCH_HAS_ILOG2_U64 def_bool n +config ARCH_HAS_CPU_IDLE_WAIT + def_bool y + config GENERIC_CALIBRATE_DELAY def_bool y
drivers/cpuidle/cpuidle.c +12 -1
@@ -27,6 +27,17 @@ static void (*pm_idle_old)(void);static int enabled_devices; +#if defined(CONFIG_ARCH_HAS_CPU_IDLE_WAIT ) +static void cpuidle_kick_cpus (void ) +{ +cpu_idle_wait (); +} +#elif defined(CONFIG_SMP ) +# error "Arch needs cpu_idle_wait() equivalent here" +#else /* !CONFIG_ARCH_HAS_CPU_IDLE_WAIT && !CONFIG_SMP */ +static void cpuidle_kick_cpus (void ) {} +#endif +/** * cpuidle_idle_call - the main idle loop *
@@ -83,7 +94,7 @@ void cpuidle_uninstall_idle_handler(void {if (enabled_devices && (pm_idle != pm_idle_old)) { pm_idle = pm_idle_old; -cpu_idle_wait (); +cpuidle_kick_cpus (); } }