diff options
Diffstat (limited to 'kernel/time/hrtimer.c')
-rw-r--r-- | kernel/time/hrtimer.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 3bac94269a98..4adf32067862 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c | |||
@@ -799,6 +799,9 @@ u64 hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval) | |||
799 | if (delta.tv64 < 0) | 799 | if (delta.tv64 < 0) |
800 | return 0; | 800 | return 0; |
801 | 801 | ||
802 | if (WARN_ON(timer->state & HRTIMER_STATE_ENQUEUED)) | ||
803 | return 0; | ||
804 | |||
802 | if (interval.tv64 < hrtimer_resolution) | 805 | if (interval.tv64 < hrtimer_resolution) |
803 | interval.tv64 = hrtimer_resolution; | 806 | interval.tv64 = hrtimer_resolution; |
804 | 807 | ||
@@ -1139,11 +1142,14 @@ static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base, | |||
1139 | * Note: We clear the CALLBACK bit after enqueue_hrtimer and | 1142 | * Note: We clear the CALLBACK bit after enqueue_hrtimer and |
1140 | * we do not reprogramm the event hardware. Happens either in | 1143 | * we do not reprogramm the event hardware. Happens either in |
1141 | * hrtimer_start_range_ns() or in hrtimer_interrupt() | 1144 | * hrtimer_start_range_ns() or in hrtimer_interrupt() |
1145 | * | ||
1146 | * Note: Because we dropped the cpu_base->lock above, | ||
1147 | * hrtimer_start_range_ns() can have popped in and enqueued the timer | ||
1148 | * for us already. | ||
1142 | */ | 1149 | */ |
1143 | if (restart != HRTIMER_NORESTART) { | 1150 | if (restart != HRTIMER_NORESTART && |
1144 | BUG_ON(timer->state != HRTIMER_STATE_CALLBACK); | 1151 | !(timer->state & HRTIMER_STATE_ENQUEUED)) |
1145 | enqueue_hrtimer(timer, base); | 1152 | enqueue_hrtimer(timer, base); |
1146 | } | ||
1147 | 1153 | ||
1148 | WARN_ON_ONCE(!(timer->state & HRTIMER_STATE_CALLBACK)); | 1154 | WARN_ON_ONCE(!(timer->state & HRTIMER_STATE_CALLBACK)); |
1149 | 1155 | ||