From 3a636854c13c1b68adbccd97c1dd991dbe9ee683 Mon Sep 17 00:00:00 2001 From: Tomasz Figa Date: Tue, 23 Apr 2013 17:46:30 +0200 Subject: [PATCH] --- yaml --- r: 374227 b: refs/heads/master c: 81d4f7bfdc9417e7d8fc1133c762daa4458eec5e h: refs/heads/master i: 374225: ba599608d73de705b8e41d19a2d401bf1f005598 374223: 7d234c25e7b4fb3cc64e01b890a31a5b2b5b578d v: v3 --- [refs] | 2 +- trunk/drivers/clocksource/samsung_pwm_timer.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 9fe262f1cbfb..4ac690359d27 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6fe4dfd041dadbc1cc2460ed8680f2734dc3dc95 +refs/heads/master: 81d4f7bfdc9417e7d8fc1133c762daa4458eec5e diff --git a/trunk/drivers/clocksource/samsung_pwm_timer.c b/trunk/drivers/clocksource/samsung_pwm_timer.c index 92b2f130ae9b..0234c8d2c8f2 100644 --- a/trunk/drivers/clocksource/samsung_pwm_timer.c +++ b/trunk/drivers/clocksource/samsung_pwm_timer.c @@ -176,6 +176,19 @@ static void samsung_time_start(unsigned int channel, bool periodic) static int samsung_set_next_event(unsigned long cycles, struct clock_event_device *evt) { + /* + * This check is needed to account for internal rounding + * errors inside clockevents core, which might result in + * passing cycles = 0, which in turn would not generate any + * timer interrupt and hang the system. + * + * Another solution would be to set up the clockevent device + * with min_delta = 2, but this would unnecessarily increase + * the minimum sleep period. + */ + if (!cycles) + cycles = 1; + samsung_time_setup(pwm.event_id, cycles); samsung_time_start(pwm.event_id, false);