Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199263
b: refs/heads/master
c: 2da513f
h: refs/heads/master
i:
  199261: 771d37e
  199259: e2962ef
  199255: 5b1b946
  199247: 592f35b
  199231: 373274d
v: v3
  • Loading branch information
Venkatesh Pallipadi authored and Len Brown committed May 28, 2010
1 parent 921fffc commit b67d4d7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 34a18d6fe5430184e4ca96eeb074ee671d89fe7b
refs/heads/master: 2da513f582a96c053aacc2c92873978d2ea7abff
14 changes: 10 additions & 4 deletions trunk/drivers/acpi/processor_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
struct acpi_processor *pr;
struct acpi_processor_cx *cx = cpuidle_get_statedata(state);
ktime_t kt1, kt2;
s64 idle_time_ns;
s64 idle_time;
s64 sleep_ticks = 0;

Expand Down Expand Up @@ -900,12 +901,14 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
sched_clock_idle_sleep_event();
acpi_idle_do_entry(cx);
kt2 = ktime_get_real();
idle_time = ktime_to_us(ktime_sub(kt2, kt1));
idle_time_ns = ktime_to_ns(ktime_sub(kt2, kt1));
idle_time = idle_time_ns;
do_div(idle_time, NSEC_PER_USEC);

sleep_ticks = us_to_pm_timer_ticks(idle_time);

/* Tell the scheduler how much we idled: */
sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS);
sched_clock_idle_wakeup_event(idle_time_ns);

local_irq_enable();
current_thread_info()->status |= TS_POLLING;
Expand Down Expand Up @@ -933,6 +936,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
struct acpi_processor *pr;
struct acpi_processor_cx *cx = cpuidle_get_statedata(state);
ktime_t kt1, kt2;
s64 idle_time_ns;
s64 idle_time;
s64 sleep_ticks = 0;

Expand Down Expand Up @@ -1015,11 +1019,13 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
spin_unlock(&c3_lock);
}
kt2 = ktime_get_real();
idle_time = ktime_to_us(ktime_sub(kt2, kt1));
idle_time_ns = ktime_to_us(ktime_sub(kt2, kt1));
idle_time = idle_time_ns;
do_div(idle_time, NSEC_PER_USEC);

sleep_ticks = us_to_pm_timer_ticks(idle_time);
/* Tell the scheduler how much we idled: */
sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS);
sched_clock_idle_wakeup_event(idle_time_ns);

local_irq_enable();
current_thread_info()->status |= TS_POLLING;
Expand Down

0 comments on commit b67d4d7

Please sign in to comment.