Skip to content

Commit

Permalink
cpuidle: Remove time measurement in poll state
Browse files Browse the repository at this point in the history
The time measurement is already done in the cpuidle framework in the
'cpuidle_enter_state' function.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Daniel Lezcano authored and Rafael J. Wysocki committed Jul 28, 2014
1 parent 3a4a267 commit dd38c9d
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions drivers/cpuidle/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,24 +182,13 @@ static void __cpuidle_driver_init(struct cpuidle_driver *drv)
static int poll_idle(struct cpuidle_device *dev,
struct cpuidle_driver *drv, int index)
{
ktime_t t1, t2;
s64 diff;

t1 = ktime_get();
local_irq_enable();
if (!current_set_polling_and_test()) {
while (!need_resched())
cpu_relax();
}
current_clr_polling();

t2 = ktime_get();
diff = ktime_to_us(ktime_sub(t2, t1));
if (diff > INT_MAX)
diff = INT_MAX;

dev->last_residency = (int) diff;

return index;
}

Expand Down

0 comments on commit dd38c9d

Please sign in to comment.