From 84e39dcb3bf4b0ea5ed9b1bcd1b1fb43d2a4bc63 Mon Sep 17 00:00:00 2001 From: "Gary S. Robertson" Date: Wed, 10 Sep 2014 14:57:16 -0500 Subject: hrtimer.h: prevent pinned timer state from breaking inactive test An hrtimer may be pinned to a CPU but inactive, so it is no longer valid to test the hrtimer.state struct member as having no bits set when inactive. Changed the test function to mask out the HRTIMER_STATE_PINNED bit when checking for inactive state. Change-Id: I632f37874ef79887ee1202a028ef734f392d6ed0 Signed-off-by: Gary S. Robertson [ohaugan@codeaurora.org: Port to 4.4] Git-commit: 902e4d4eb0d2158d2792166221a72a829caecf07 Git-repo: git://git.linaro.org/people/mike.holmes/santosh.shukla/lng-isol.git Signed-off-by: Olav Haugan --- kernel/time/hrtimer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'kernel') diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index ab304f854743..f3b89de9ca2a 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1186,8 +1186,8 @@ bool hrtimer_active(const struct hrtimer *timer) cpu_base = READ_ONCE(timer->base->cpu_base); seq = raw_read_seqcount_begin(&cpu_base->seq); - if (timer->state != HRTIMER_STATE_INACTIVE || - cpu_base->running == timer) + if (((timer->state & ~HRTIMER_STATE_PINNED) != + HRTIMER_STATE_INACTIVE) || cpu_base->running == timer) return true; } while (read_seqcount_retry(&cpu_base->seq, seq) || -- cgit v1.2.3