|
@@ -1095,7 +1095,12 @@ static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
|
|
|
|
|
|
cpu_base = raw_cpu_ptr(&hrtimer_bases);
|
|
|
|
|
|
- if (clock_id == CLOCK_REALTIME && mode != HRTIMER_MODE_ABS)
|
|
|
+ /*
|
|
|
+ * POSIX magic: Relative CLOCK_REALTIME timers are not affected by
|
|
|
+ * clock modifications, so they needs to become CLOCK_MONOTONIC to
|
|
|
+ * ensure POSIX compliance.
|
|
|
+ */
|
|
|
+ if (clock_id == CLOCK_REALTIME && mode & HRTIMER_MODE_REL)
|
|
|
clock_id = CLOCK_MONOTONIC;
|
|
|
|
|
|
base = hrtimer_clockid_to_base(clock_id);
|