From 454e82ce676c1bb3f06283477d17dca6a60e6619 Mon Sep 17 00:00:00 2001 From: Elliot Berman Date: Thu, 17 Sep 2020 08:41:20 -0700 Subject: [PATCH] kernel: time: Restore original wheel index calculation Restore original wheel index calculation for GKI builds. Change-Id: Ia1afd393e1e33e6c1038159b0bf920775103cb92 Signed-off-by: Elliot Berman --- kernel/time/timer.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 2897af0857e9..968ab19e51c8 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -491,6 +491,13 @@ static inline void timer_set_idx(struct timer_list *timer, unsigned int idx) * Helper function to calculate the array index for a given expiry * time. */ +#ifndef CONFIG_SCHED_WALT +static inline unsigned calc_index(unsigned expires, unsigned lvl) +{ + expires = (expires + LVL_GRAN(lvl)) >> LVL_SHIFT(lvl); + return LVL_OFFS(lvl) + (expires & LVL_MASK); +} +#else static inline unsigned calc_index(unsigned expires, unsigned lvl) { if (lvl != 0 && (expires & ~(UINT_MAX << LVL_SHIFT(lvl)))) @@ -500,6 +507,7 @@ static inline unsigned calc_index(unsigned expires, unsigned lvl) return LVL_OFFS(lvl) + (expires & LVL_MASK); } +#endif static int calc_wheel_index(unsigned long expires, unsigned long clk) {