Re: [PATCH 01/16] APM idle: register apm_cpu_idle via cpuidle

From: Len Brown
Date: Mon Feb 11 2013 - 17:50:47 EST


On 02/11/2013 04:18 AM, Daniel Lezcano wrote:
> On 02/10/2013 06:58 AM, Len Brown wrote:
>> From: Len Brown <len.brown@xxxxxxxxx>
>>
>> Update APM to register its local idle routine with cpuidle.
>>
>> This allows us to stop exporting pm_idle to modules on x86.
>>
>> The Kconfig sub-option, APM_CPU_IDLE, now depends on on CPU_IDLE.
>>
>> Compile-tested only.
>>
>> Signed-off-by: Len Brown <len.brown@xxxxxxxxx>
>> Cc: Jiri Kosina <jkosina@xxxxxxx>
>> ---
>

>> +static struct cpuidle_device apm_cpuidle_device = {
>> + .state_count = 2,
>> +};
>
> This will make the cpuidle_register_driver to fail because the
> state_count field of the cpuidle_driver is zero, no ?
>
> static struct cpuidle_driver apm_idle_driver = {
> .name = "apm_idle",
> ...
> .states = {
> ...
> },
> .state_count = 2,
> }

yup, good catch.

>> -static void apm_cpu_idle(void)
>> +static int apm_cpu_idle(struct cpuidle_device *dev,
>> + struct cpuidle_driver *drv, int index)
>> {
>> static int use_apm_idle; /* = 0 */
>> static unsigned int last_jiffies; /* = 0 */
...
>> @@ -964,6 +983,7 @@ recalc:
>> apm_do_busy();
>>
>> local_irq_enable();
>
> ^^^^^^^^
>
> As the 'en_core_tk_irqen' flag has been enabled in the driver, the
> caller of this function will call 'local_irq_enable'. We can remove the
> this line no ?

yup, this line is no longer necessary.

v2 on the way -- hoping somebody with an APM box can test it.

thanks,
-Len Brown, Intel Open Source Technology Center

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/