diff options
Diffstat (limited to 'kernel/sched/idle.c')
-rw-r--r-- | kernel/sched/idle.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c index 80940939b733..b98283fc6914 100644 --- a/kernel/sched/idle.c +++ b/kernel/sched/idle.c | |||
@@ -311,7 +311,7 @@ static enum hrtimer_restart idle_inject_timer_fn(struct hrtimer *timer) | |||
311 | return HRTIMER_NORESTART; | 311 | return HRTIMER_NORESTART; |
312 | } | 312 | } |
313 | 313 | ||
314 | void play_idle(unsigned long duration_ms) | 314 | void play_idle(unsigned long duration_us) |
315 | { | 315 | { |
316 | struct idle_timer it; | 316 | struct idle_timer it; |
317 | 317 | ||
@@ -323,7 +323,7 @@ void play_idle(unsigned long duration_ms) | |||
323 | WARN_ON_ONCE(current->nr_cpus_allowed != 1); | 323 | WARN_ON_ONCE(current->nr_cpus_allowed != 1); |
324 | WARN_ON_ONCE(!(current->flags & PF_KTHREAD)); | 324 | WARN_ON_ONCE(!(current->flags & PF_KTHREAD)); |
325 | WARN_ON_ONCE(!(current->flags & PF_NO_SETAFFINITY)); | 325 | WARN_ON_ONCE(!(current->flags & PF_NO_SETAFFINITY)); |
326 | WARN_ON_ONCE(!duration_ms); | 326 | WARN_ON_ONCE(!duration_us); |
327 | 327 | ||
328 | rcu_sleep_check(); | 328 | rcu_sleep_check(); |
329 | preempt_disable(); | 329 | preempt_disable(); |
@@ -333,7 +333,8 @@ void play_idle(unsigned long duration_ms) | |||
333 | it.done = 0; | 333 | it.done = 0; |
334 | hrtimer_init_on_stack(&it.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); | 334 | hrtimer_init_on_stack(&it.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); |
335 | it.timer.function = idle_inject_timer_fn; | 335 | it.timer.function = idle_inject_timer_fn; |
336 | hrtimer_start(&it.timer, ms_to_ktime(duration_ms), HRTIMER_MODE_REL_PINNED); | 336 | hrtimer_start(&it.timer, ns_to_ktime(duration_us * NSEC_PER_USEC), |
337 | HRTIMER_MODE_REL_PINNED); | ||
337 | 338 | ||
338 | while (!READ_ONCE(it.done)) | 339 | while (!READ_ONCE(it.done)) |
339 | do_idle(); | 340 | do_idle(); |