RE: [linux-pm] [PATCH] CPUidle: compile fix for non-x86

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 

>-----Original Message-----
>From: Kevin Hilman [mailto:khilman@xxxxxxxxxx] 
>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@xxxxxxxxx> writes:
>
>>> Wrap cpu_idle_wait() in an x86 #ifdef since it's x86 only.
>>> Signed-off-by: Kevin Hilman <khilman@xxxxxxxxxx>
>>> 
>>> 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
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux