lkml.org 
[lkml]   [2012]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v1 3/3] ARM: tegra: cpuidle driver for tegra
From
On Thu, Jan 26, 2012 at 10:59 PM, Bedia, Vaibhav <vaibhav.bedia@ti.com> wrote:
> On Thu, Jan 26, 2012 at 21:52:03, Peter De Schrijver wrote:
> [...]
>> +static int tegra_idle_enter_lp3(struct cpuidle_device *dev,
>> +     struct cpuidle_driver *drv, int index)
>> +{
>> +     ktime_t enter, exit;
>> +     s64 us;
>> +
>> +     local_irq_disable();
>> +     local_fiq_disable();
>> +
>> +     enter = ktime_get();
>> +
>> +     tegra_cpu_wfi();
>> +
>> +     exit = ktime_sub(ktime_get(), enter);
>> +     us = ktime_to_us(exit);
>> +
>> +     local_fiq_enable();
>> +     local_irq_enable();
>> +
>> +     dev->last_residency = us;
>> +
>> +     return index;
>> +}
>
> You can probably drop local_irq_disable() and local_irq_enable().

local_irq_enable() is required by the cpuidle call semantics. See
arch/arm/process.c, it has a WARN_ON(irqs_disabled()) after the
idle function call. The local_irq_disable() can and probably should
be dropped, although a comment that the function is called with
interrupts off and is expected to return with interrupts on would be
helpful.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-01-27 08:13    [W:0.061 / U:3.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site