* Fwd: [linux-pm] [PATCH] CPUidle: compile fix for non-x86
@ 2008-01-30 10:16 Rafael J. Wysocki
2008-01-31 18:44 ` Pallipadi, Venkatesh
0 siblings, 1 reply; 16+ messages in thread
From: Rafael J. Wysocki @ 2008-01-30 10:16 UTC (permalink / raw)
To: Len Brown; +Cc: ACPI Devel Maling List, Pallipadi, Venkatesh, Kevin Hilman
[-- Attachment #1: Type: text/plain, Size: 41 bytes --]
Hi,
Please have a look at this.
Rafael
[-- Attachment #2: Kevin Hilman <khilman@mvista.com>: [linux-pm] [PATCH] CPUidle: compile fix for non-x86 --]
[-- Type: message/rfc822, Size: 3581 bytes --]
From: Kevin Hilman <khilman@mvista.com>
To: linux-pm@lists.linux-foundation.org
Subject: [linux-pm] [PATCH] CPUidle: compile fix for non-x86
Date: Tue, 29 Jan 2008 21:52:12 -0800
Message-ID: <871w7zn9mb.fsf@paris.hilman.org>
Wrap cpu_idle_wait() in an x86 #ifdef since it's x86 only.
Signed-off-by: Kevin Hilman <khilman@mvista.com>
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index d2fabe7..4d0f9b0 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -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
linux-pm@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/linux-pm
^ permalink raw reply related [flat|nested] 16+ messages in thread* RE: [linux-pm] [PATCH] CPUidle: compile fix for non-x86
2008-01-30 10:16 Fwd: [linux-pm] [PATCH] CPUidle: compile fix for non-x86 Rafael J. Wysocki
@ 2008-01-31 18:44 ` Pallipadi, Venkatesh
2008-01-31 18:51 ` Kevin Hilman
0 siblings, 1 reply; 16+ messages in thread
From: Pallipadi, Venkatesh @ 2008-01-31 18:44 UTC (permalink / raw)
To: Rafael J. Wysocki, Len Brown; +Cc: ACPI Devel Maling List, Kevin Hilman
>-----Original Message-----
>From: Rafael J. Wysocki [mailto:rjw@sisk.pl]
>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-x86
>
>Hi,
>
>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 <khilman@mvista.com>
>
> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> index d2fabe7..4d0f9b0 100644
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -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
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [linux-pm] [PATCH] CPUidle: compile fix for non-x86
2008-01-31 18:44 ` Pallipadi, Venkatesh
@ 2008-01-31 18:51 ` Kevin Hilman
2008-01-31 19:15 ` Pallipadi, Venkatesh
0 siblings, 1 reply; 16+ messages in thread
From: Kevin Hilman @ 2008-01-31 18:51 UTC (permalink / raw)
To: Pallipadi, Venkatesh; +Cc: Len Brown, ACPI Devel Maling List
"Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com> writes:
>> Wrap cpu_idle_wait() in an x86 #ifdef since it's x86 only.
>> Signed-off-by: Kevin Hilman <khilman@mvista.com>
>>
>> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
>> index d2fabe7..4d0f9b0 100644
>> --- a/drivers/cpuidle/cpuidle.c
>> +++ b/drivers/cpuidle/cpuidle.c
>> @@ -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?
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
^ permalink raw reply [flat|nested] 16+ messages in thread* RE: [linux-pm] [PATCH] CPUidle: compile fix for non-x86
2008-01-31 18:51 ` Kevin Hilman
@ 2008-01-31 19:15 ` Pallipadi, Venkatesh
2008-01-31 20:05 ` Kevin Hilman
0 siblings, 1 reply; 16+ messages in thread
From: Pallipadi, Venkatesh @ 2008-01-31 19:15 UTC (permalink / raw)
To: Kevin Hilman; +Cc: Len Brown, ACPI Devel Maling List
>-----Original Message-----
>From: Kevin Hilman [mailto:khilman@mvista.com]
>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-x86
>
>"Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com> writes:
>
>>> Wrap cpu_idle_wait() in an x86 #ifdef since it's x86 only.
>>> Signed-off-by: Kevin Hilman <khilman@mvista.com>
>>>
>>> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
>>> index d2fabe7..4d0f9b0 100644
>>> --- a/drivers/cpuidle/cpuidle.c
>>> +++ b/drivers/cpuidle/cpuidle.c
>>> @@ -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?
>
>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?
>
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
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [linux-pm] [PATCH] CPUidle: compile fix for non-x86
2008-01-31 19:15 ` Pallipadi, Venkatesh
@ 2008-01-31 20:05 ` Kevin Hilman
2008-01-31 20:11 ` Pallipadi, Venkatesh
2008-01-31 20:26 ` Rafael J. Wysocki
0 siblings, 2 replies; 16+ messages in thread
From: Kevin Hilman @ 2008-01-31 20:05 UTC (permalink / raw)
To: Pallipadi, Venkatesh; +Cc: Len Brown, ACPI Devel Maling List
[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.
Signed-off-by: Kevin Hilman <khilman@mvista.com>
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index d2fabe7..762d878 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -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();
}
}
^ permalink raw reply related [flat|nested] 16+ messages in thread* RE: [linux-pm] [PATCH] CPUidle: compile fix for non-x86
2008-01-31 20:05 ` Kevin Hilman
@ 2008-01-31 20:11 ` Pallipadi, Venkatesh
2008-01-31 20:26 ` Rafael J. Wysocki
1 sibling, 0 replies; 16+ messages in thread
From: Pallipadi, Venkatesh @ 2008-01-31 20:11 UTC (permalink / raw)
To: Kevin Hilman; +Cc: Len Brown, ACPI Devel Maling List
Len,
Please include this along with your other cpuidle patches for 2.6.25.
Thanks,
Venki
Acked-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
>-----Original Message-----
>From: Kevin Hilman [mailto:khilman@mvista.com]
>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() to cpuidle_kick_cpus() macro which is
>SMP-only, and gives error on non supported CPU.
>
>Signed-off-by: Kevin Hilman <khilman@mvista.com>
>
>diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
>index d2fabe7..762d878 100644
>--- a/drivers/cpuidle/cpuidle.c
>+++ b/drivers/cpuidle/cpuidle.c
>@@ -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();
> }
> }
>
>
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [linux-pm] [PATCH] CPUidle: compile fix for non-x86
2008-01-31 20:05 ` Kevin Hilman
2008-01-31 20:11 ` Pallipadi, Venkatesh
@ 2008-01-31 20:26 ` Rafael J. Wysocki
2008-01-31 20:45 ` Kevin Hilman
1 sibling, 1 reply; 16+ messages in thread
From: Rafael J. Wysocki @ 2008-01-31 20:26 UTC (permalink / raw)
To: Kevin Hilman; +Cc: Pallipadi, Venkatesh, Len Brown, ACPI Devel Maling List
On Thursday, 31 of January 2008, Kevin Hilman wrote:
> [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.
>
> Signed-off-by: Kevin Hilman <khilman@mvista.com>
>
> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> index d2fabe7..762d878 100644
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -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?
> +
> 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();
> }
> }
>
> -
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [linux-pm] [PATCH] CPUidle: compile fix for non-x86
2008-01-31 20:26 ` Rafael J. Wysocki
@ 2008-01-31 20:45 ` Kevin Hilman
2008-01-31 21:03 ` Rafael J. Wysocki
0 siblings, 1 reply; 16+ messages in thread
From: Kevin Hilman @ 2008-01-31 20:45 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Pallipadi, Venkatesh, Len Brown, ACPI Devel Maling List
[ 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.
Signed-off-by: Kevin Hilman <khilman@mvista.com>
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index d2fabe7..794962d 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -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();
}
}
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index c4e0016..12466ec 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -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;
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [linux-pm] [PATCH] CPUidle: compile fix for non-x86
2008-01-31 20:45 ` Kevin Hilman
@ 2008-01-31 21:03 ` Rafael J. Wysocki
2008-01-31 21:33 ` Kevin Hilman
0 siblings, 1 reply; 16+ messages in thread
From: Rafael J. Wysocki @ 2008-01-31 21:03 UTC (permalink / raw)
To: Kevin Hilman; +Cc: Pallipadi, Venkatesh, Len Brown, ACPI Devel Maling List
On Thursday, 31 of January 2008, Kevin Hilman wrote:
> [ 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.
>
> Signed-off-by: Kevin Hilman <khilman@mvista.com>
>
> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> index d2fabe7..794962d 100644
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -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();
> }
> }
>
> diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
> index c4e0016..12466ec 100644
> --- a/include/linux/cpuidle.h
> +++ b/include/linux/cpuidle.h
> @@ -72,6 +72,17 @@ cpuidle_set_statedata(struct cpuidle_state *state, void *data)
> state->driver_data = data;
> }
>
> +#if !defined(CONFIG_SMP)
#ifndef surely?
> +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
> +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;
and define ARCH_HAS_CPU_IDLE_WAIT in the x86 Kconfig.
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [linux-pm] [PATCH] CPUidle: compile fix for non-x86
2008-01-31 21:03 ` Rafael J. Wysocki
@ 2008-01-31 21:33 ` Kevin Hilman
2008-02-01 0:25 ` Pallipadi, Venkatesh
0 siblings, 1 reply; 16+ messages in thread
From: Kevin Hilman @ 2008-01-31 21:33 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Pallipadi, Venkatesh, Len Brown, ACPI Devel Maling List
[ 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.
Signed-off-by: Kevin Hilman <khilman@mvista.com>
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 80b7ba4..a3e8ef4 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -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
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index d2fabe7..794962d 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -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();
}
}
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index c4e0016..23f063a 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -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;
^ permalink raw reply related [flat|nested] 16+ messages in thread* RE: [linux-pm] [PATCH] CPUidle: compile fix for non-x86
2008-01-31 21:33 ` Kevin Hilman
@ 2008-02-01 0:25 ` Pallipadi, Venkatesh
2008-02-01 1:17 ` Rafael J. Wysocki
2008-02-01 1:28 ` Kevin Hilman
0 siblings, 2 replies; 16+ messages in thread
From: Pallipadi, Venkatesh @ 2008-02-01 0:25 UTC (permalink / raw)
To: Kevin Hilman, Rafael J. Wysocki; +Cc: Len Brown, ACPI Devel Maling List
>-----Original Message-----
>From: Kevin Hilman [mailto:khilman@mvista.com]
>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() to cpuidle_kick_cpus() macro which is
>SMP-only, and gives error on non supported CPU.
>
>Signed-off-by: Kevin Hilman <khilman@mvista.com>
>
>diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
>index 80b7ba4..a3e8ef4 100644
>--- a/arch/x86/Kconfig
>+++ b/arch/x86/Kconfig
>@@ -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
>
>diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
>index d2fabe7..794962d 100644
>--- a/drivers/cpuidle/cpuidle.c
>+++ b/drivers/cpuidle/cpuidle.c
>@@ -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();
> }
> }
>
>diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
>index c4e0016..23f063a 100644
>--- a/include/linux/cpuidle.h
>+++ b/include/linux/cpuidle.h
>@@ -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
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [linux-pm] [PATCH] CPUidle: compile fix for non-x86
2008-02-01 0:25 ` Pallipadi, Venkatesh
@ 2008-02-01 1:17 ` Rafael J. Wysocki
2008-02-01 1:28 ` Kevin Hilman
1 sibling, 0 replies; 16+ messages in thread
From: Rafael J. Wysocki @ 2008-02-01 1:17 UTC (permalink / raw)
To: Pallipadi, Venkatesh; +Cc: Kevin Hilman, Len Brown, ACPI Devel Maling List
On Friday, 1 of February 2008, Pallipadi, Venkatesh wrote:
>
> >-----Original Message-----
> >From: Kevin Hilman [mailto:khilman@mvista.com]
> >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() to cpuidle_kick_cpus() macro which is
> >SMP-only, and gives error on non supported CPU.
> >
> >Signed-off-by: Kevin Hilman <khilman@mvista.com>
> >
> >diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> >index 80b7ba4..a3e8ef4 100644
> >--- a/arch/x86/Kconfig
> >+++ b/arch/x86/Kconfig
> >@@ -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
> >
> >diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> >index d2fabe7..794962d 100644
> >--- a/drivers/cpuidle/cpuidle.c
> >+++ b/drivers/cpuidle/cpuidle.c
> >@@ -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();
> > }
> > }
> >
> >diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
> >index c4e0016..23f063a 100644
> >--- a/include/linux/cpuidle.h
> >+++ b/include/linux/cpuidle.h
> >@@ -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.
That's correct. My fault actually, sorry.
Thanks,
Rafael
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [linux-pm] [PATCH] CPUidle: compile fix for non-x86
2008-02-01 0:25 ` Pallipadi, Venkatesh
2008-02-01 1:17 ` Rafael J. Wysocki
@ 2008-02-01 1:28 ` Kevin Hilman
2008-02-01 1:40 ` Rafael J. Wysocki
1 sibling, 1 reply; 16+ messages in thread
From: Kevin Hilman @ 2008-02-01 1:28 UTC (permalink / raw)
To: Pallipadi, Venkatesh; +Cc: Rafael J. Wysocki, Len Brown, ACPI Devel Maling List
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.
Signed-off-by: Kevin Hilman <khilman@mvista.com>
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 80b7ba4..a3e8ef4 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -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
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index d2fabe7..794962d 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -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();
}
}
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index c4e0016..b1c7355 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -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;
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [linux-pm] [PATCH] CPUidle: compile fix for non-x86
2008-02-01 1:28 ` Kevin Hilman
@ 2008-02-01 1:40 ` Rafael J. Wysocki
2008-02-01 3:40 ` Len Brown
0 siblings, 1 reply; 16+ messages in thread
From: Rafael J. Wysocki @ 2008-02-01 1:40 UTC (permalink / raw)
To: Kevin Hilman; +Cc: Pallipadi, Venkatesh, Len Brown, ACPI Devel Maling List
On Friday, 1 of February 2008, Kevin Hilman wrote:
> OK, one more (last?) time. :)
Er, no.
> Convert cpu_idle_wait() to cpuidle_kick_cpus() macro which is
> SMP-only, and gives error on non supported CPU.
>
> Signed-off-by: Kevin Hilman <khilman@mvista.com>
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 80b7ba4..a3e8ef4 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -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
>
> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> index d2fabe7..794962d 100644
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -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();
> }
> }
>
> diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
> index c4e0016..b1c7355 100644
> --- a/include/linux/cpuidle.h
> +++ b/include/linux/cpuidle.h
> @@ -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.
> +#error "Arch needs cpu_idle_wait() equivalent here"
> +#endif /* !ARCH_HAS_CPU_IDLE_WAIT */
And here.
> +#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
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [linux-pm] [PATCH] CPUidle: compile fix for non-x86
2008-02-01 1:40 ` Rafael J. Wysocki
@ 2008-02-01 3:40 ` Len Brown
2008-02-09 1:05 ` Venki Pallipadi
0 siblings, 1 reply; 16+ messages in thread
From: Len Brown @ 2008-02-01 3:40 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Kevin Hilman, Pallipadi, Venkatesh, ACPI Devel Maling List
Applied w/ Rafael's comment fixes included.
thanks,
-Len
On Thursday 31 January 2008 20:40, Rafael J. Wysocki wrote:
> On Friday, 1 of February 2008, Kevin Hilman wrote:
> > OK, one more (last?) time. :)
>
> Er, no.
>
> > Convert cpu_idle_wait() to cpuidle_kick_cpus() macro which is
> > SMP-only, and gives error on non supported CPU.
> >
> > Signed-off-by: Kevin Hilman <khilman@mvista.com>
> >
> > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> > index 80b7ba4..a3e8ef4 100644
> > --- a/arch/x86/Kconfig
> > +++ b/arch/x86/Kconfig
> > @@ -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
> >
> > diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> > index d2fabe7..794962d 100644
> > --- a/drivers/cpuidle/cpuidle.c
> > +++ b/drivers/cpuidle/cpuidle.c
> > @@ -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();
> > }
> > }
> >
> > diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
> > index c4e0016..b1c7355 100644
> > --- a/include/linux/cpuidle.h
> > +++ b/include/linux/cpuidle.h
> > @@ -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.
>
> > +#error "Arch needs cpu_idle_wait() equivalent here"
> > +#endif /* !ARCH_HAS_CPU_IDLE_WAIT */
>
> And here.
>
> > +#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 majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [linux-pm] [PATCH] CPUidle: compile fix for non-x86
2008-02-01 3:40 ` Len Brown
@ 2008-02-09 1:05 ` Venki Pallipadi
0 siblings, 0 replies; 16+ messages in thread
From: Venki Pallipadi @ 2008-02-09 1:05 UTC (permalink / raw)
To: Len Brown
Cc: Rafael J. Wysocki, Kevin Hilman, Pallipadi, Venkatesh,
ACPI Devel Maling List
On Thu, Jan 31, 2008 at 10:40:46PM -0500, Len Brown wrote:
> 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 <venkatesh.pallipadi@intel.com>
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.
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Kevin Hilman <khilman@mvista.com>
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
Index: linux-2.6.25-rc/arch/x86/Kconfig
===================================================================
--- linux-2.6.25-rc.orig/arch/x86/Kconfig
+++ linux-2.6.25-rc/arch/x86/Kconfig
@@ -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
Index: linux-2.6.25-rc/drivers/cpuidle/cpuidle.c
===================================================================
--- linux-2.6.25-rc.orig/drivers/cpuidle/cpuidle.c
+++ linux-2.6.25-rc/drivers/cpuidle/cpuidle.c
@@ -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();
}
}
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2008-02-09 1:07 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-30 10:16 Fwd: [linux-pm] [PATCH] CPUidle: compile fix for non-x86 Rafael J. Wysocki
2008-01-31 18:44 ` Pallipadi, Venkatesh
2008-01-31 18:51 ` Kevin Hilman
2008-01-31 19:15 ` Pallipadi, Venkatesh
2008-01-31 20:05 ` Kevin Hilman
2008-01-31 20:11 ` Pallipadi, Venkatesh
2008-01-31 20:26 ` Rafael J. Wysocki
2008-01-31 20:45 ` Kevin Hilman
2008-01-31 21:03 ` Rafael J. Wysocki
2008-01-31 21:33 ` Kevin Hilman
2008-02-01 0:25 ` Pallipadi, Venkatesh
2008-02-01 1:17 ` Rafael J. Wysocki
2008-02-01 1:28 ` Kevin Hilman
2008-02-01 1:40 ` Rafael J. Wysocki
2008-02-01 3:40 ` Len Brown
2008-02-09 1:05 ` Venki Pallipadi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox