aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clocksource')
-rw-r--r--drivers/clocksource/samsung_pwm_timer.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/clocksource/samsung_pwm_timer.c b/drivers/clocksource/samsung_pwm_timer.c
index 92b2f130ae9b..0234c8d2c8f2 100644
--- a/drivers/clocksource/samsung_pwm_timer.c
+++ b/drivers/clocksource/samsung_pwm_timer.c
@@ -176,6 +176,19 @@ static void samsung_time_start(unsigned int channel, bool periodic)
176static int samsung_set_next_event(unsigned long cycles, 176static int samsung_set_next_event(unsigned long cycles,
177 struct clock_event_device *evt) 177 struct clock_event_device *evt)
178{ 178{
179 /*
180 * This check is needed to account for internal rounding
181 * errors inside clockevents core, which might result in
182 * passing cycles = 0, which in turn would not generate any
183 * timer interrupt and hang the system.
184 *
185 * Another solution would be to set up the clockevent device
186 * with min_delta = 2, but this would unnecessarily increase
187 * the minimum sleep period.
188 */
189 if (!cycles)
190 cycles = 1;
191
179 samsung_time_setup(pwm.event_id, cycles); 192 samsung_time_setup(pwm.event_id, cycles);
180 samsung_time_start(pwm.event_id, false); 193 samsung_time_start(pwm.event_id, false);
181 194