aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/tick-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/time/tick-common.c')
-rw-r--r--kernel/time/tick-common.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
index 20b2fe37d105..015661279b68 100644
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -98,18 +98,19 @@ static void tick_periodic(int cpu)
98void tick_handle_periodic(struct clock_event_device *dev) 98void tick_handle_periodic(struct clock_event_device *dev)
99{ 99{
100 int cpu = smp_processor_id(); 100 int cpu = smp_processor_id();
101 ktime_t next; 101 ktime_t next = dev->next_event;
102 102
103 tick_periodic(cpu); 103 tick_periodic(cpu);
104 104
105 if (dev->mode != CLOCK_EVT_MODE_ONESHOT) 105 if (dev->mode != CLOCK_EVT_MODE_ONESHOT)
106 return; 106 return;
107 /*
108 * Setup the next period for devices, which do not have
109 * periodic mode:
110 */
111 next = ktime_add(dev->next_event, tick_period);
112 for (;;) { 107 for (;;) {
108 /*
109 * Setup the next period for devices, which do not have
110 * periodic mode:
111 */
112 next = ktime_add(next, tick_period);
113
113 if (!clockevents_program_event(dev, next, false)) 114 if (!clockevents_program_event(dev, next, false))
114 return; 115 return;
115 /* 116 /*
@@ -118,12 +119,11 @@ void tick_handle_periodic(struct clock_event_device *dev)
118 * to be sure we're using a real hardware clocksource. 119 * to be sure we're using a real hardware clocksource.
119 * Otherwise we could get trapped in an infinite 120 * Otherwise we could get trapped in an infinite
120 * loop, as the tick_periodic() increments jiffies, 121 * loop, as the tick_periodic() increments jiffies,
121 * when then will increment time, posibly causing 122 * which then will increment time, possibly causing
122 * the loop to trigger again and again. 123 * the loop to trigger again and again.
123 */ 124 */
124 if (timekeeping_valid_for_hres()) 125 if (timekeeping_valid_for_hres())
125 tick_periodic(cpu); 126 tick_periodic(cpu);
126 next = ktime_add(next, tick_period);
127 } 127 }
128} 128}
129 129