Messages in this thread Patch in this message | | | Date | Fri, 21 Feb 2014 17:56:15 -0000 | From | Thomas Gleixner <> | Subject | [RFC patch 1/5] hrtimer: Always check for HRTIMER_MODE_REL |
| |
We have not just HRTIMER_MODE_REL and HRTIMER_MODE_ABS, so a direct check for mode == HRTIMER_MODE_ABS is not sufficient.
Always check for the HRTIMER_MODE_REL bit.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- kernel/hrtimer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Index: tip/kernel/hrtimer.c =================================================================== --- tip.orig/kernel/hrtimer.c +++ tip/kernel/hrtimer.c @@ -1186,7 +1186,7 @@ static void __hrtimer_init(struct hrtime cpu_base = &__raw_get_cpu_var(hrtimer_bases); - if (clock_id == CLOCK_REALTIME && mode != HRTIMER_MODE_ABS) + if (clock_id == CLOCK_REALTIME && (mode & HRTIMER_MODE_REL)) clock_id = CLOCK_MONOTONIC; base = hrtimer_clockid_to_base(clock_id); @@ -1620,7 +1620,7 @@ long hrtimer_nanosleep(struct timespec * goto out; /* Absolute timers do not update the rmtp value and restart: */ - if (mode == HRTIMER_MODE_ABS) { + if (!(mode & HRTIMER_MODE_REL)) { ret = -ERESTARTNOHAND; goto out; }
| |