This reverts commit d441dceb5dce71150f28add80d36d91bbfccba99 due to boot failures.
Unified · Split
| @@ -16,7 +16,6 @@ · 15 unmodified lines | ||
| 16 | 16 | #include <linux/profile.h> |
| 17 | 17 | #include <linux/sched.h> |
| 18 | 18 | #include <linux/module.h> |
| 19 | −#include <linux/sched/clock.h> | |
| 20 | 19 | #include <trace/events/power.h> |
| 21 | 20 | |
| 22 | 21 | #include <asm/irq_regs.h> |
| @@ -85,41 +84,12 @@ int tick_is_oneshot_available(void) · 62 unmodified lines | ||
| 85 | 84 | static void tick_periodic(int cpu) |
| 86 | 85 | { |
| 87 | 86 | if (tick_do_timer_cpu == cpu) { |
| 88 | − /* | |
| 89 | − * Use running_clock() as reference to check for missing ticks. | |
| 90 | − */ | |
| 91 | − static ktime_t last_update; | |
| 92 | − ktime_t now; | |
| 93 | − int ticks = 1; | |
| 94 | − | |
| 95 | − now = ns_to_ktime(running_clock()); | |
| 96 | 87 | write_seqlock(&jiffies_lock); |
| 97 | 88 | |
| 98 | − if (last_update) { | |
| 99 | − u64 delta = ktime_sub(now, last_update); | |
| 100 | − | |
| 101 | − /* | |
| 102 | − * Check for eventually missed ticks | |
| 103 | − * | |
| 104 | − * There is likely a persistent delta between | |
| 105 | − * last_update and tick_next_period. So they are | |
| 106 | − * updated separately. | |
| 107 | − */ | |
| 108 | − if (delta >= 2 * tick_period) { | |
| 109 | − s64 period = ktime_to_ns(tick_period); | |
| 110 | − | |
| 111 | − ticks = ktime_divns(delta, period); | |
| 112 | − } | |
| 113 | − last_update = ktime_add(last_update, | |
| 114 | − ticks * tick_period); | |
| 115 | − } else { | |
| 116 | − last_update = now; | |
| 117 | − } | |
| 118 | − | |
| 119 | 89 | /* Keep track of the next tick event */ |
| 120 | − tick_next_period = ktime_add(tick_next_period, | |
| 121 | − ticks * tick_period); | |
| 122 | − do_timer(ticks); | |
| 90 | + tick_next_period = ktime_add(tick_next_period, tick_period); | |
| 91 | + | |
| 92 | + do_timer(1); | |
| 123 | 93 | write_sequnlock(&jiffies_lock); |
| 124 | 94 | update_wall_time(); |
| 125 | 95 | } |