summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2018-03-05 12:05:38 +0800
committerAlex Shi <alex.shi@linaro.org>2018-03-05 12:05:38 +0800
commita2b5256f1edd2d412d14ec9dceb1d28e39a794e4 (patch)
tree15e0a0fb9382a6d4a4b1b4c71ab4df7832f552f8 /kernel
parent825f312805c0a74cd2a081f43eb8ca7073228d0f (diff)
parent47356cfded444826565f2430bce8ba294372b861 (diff)
Merge tag 'v4.4.120' into linux-linaro-lsk-v4.4
This is the 4.4.120 stable release
Diffstat (limited to 'kernel')
-rw-r--r--kernel/time/hrtimer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 323282e63865..8c4e27cbfe7f 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1139,7 +1139,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);