diff options
-rw-r--r-- | kernel/time/timekeeping.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 403c2a092830..b53da5ecbea2 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -448,9 +448,12 @@ EXPORT_SYMBOL(timekeeping_inject_offset); | |||
448 | static int change_clocksource(void *data) | 448 | static int change_clocksource(void *data) |
449 | { | 449 | { |
450 | struct clocksource *new, *old; | 450 | struct clocksource *new, *old; |
451 | unsigned long flags; | ||
451 | 452 | ||
452 | new = (struct clocksource *) data; | 453 | new = (struct clocksource *) data; |
453 | 454 | ||
455 | write_seqlock_irqsave(&timekeeper.lock, flags); | ||
456 | |||
454 | timekeeping_forward_now(); | 457 | timekeeping_forward_now(); |
455 | if (!new->enable || new->enable(new) == 0) { | 458 | if (!new->enable || new->enable(new) == 0) { |
456 | old = timekeeper.clock; | 459 | old = timekeeper.clock; |
@@ -458,6 +461,10 @@ static int change_clocksource(void *data) | |||
458 | if (old->disable) | 461 | if (old->disable) |
459 | old->disable(old); | 462 | old->disable(old); |
460 | } | 463 | } |
464 | timekeeping_update(true); | ||
465 | |||
466 | write_sequnlock_irqrestore(&timekeeper.lock, flags); | ||
467 | |||
461 | return 0; | 468 | return 0; |
462 | } | 469 | } |
463 | 470 | ||