lx_kit: handle truncation of hrtimer timeouts

Fixes #1986.
This commit is contained in:
Josef Söntgen 2016-05-31 13:49:48 +02:00 committed by Christian Helmuth
parent 964e9e91c7
commit 294c7e5076

View File

@ -61,6 +61,12 @@ int hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
{
unsigned long expires = tim.tv64 / (NSEC_PER_MSEC * HZ);
/*
* Prevent truncation through rounding the values by adding 1 jiffy
* in this case.
*/
expires += (expires == jiffies);
if (!Lx::timer().find(timer))
Lx::timer().add(timer, Lx::Timer::HR);