From: Chris Redpath Date: Mon, 25 Jul 2016 14:13:58 +0000 (+0100) Subject: arch_timer: add error handling when the MPM global timer is cleared X-Git-Tag: firefly_0821_release~176^2~204 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7bba794daaa85dce327e52b201439bb2c148b6c9;p=firefly-linux-kernel-4.4.55.git arch_timer: add error handling when the MPM global timer is cleared Bug: 29000863 Signed-off-by: albert.zl_huang Change-Id: I2b5a28b0a9edb31bdaa1ca2310397dd2f36f6c23 Updated to use arch_timer_read_counter() as arch_counter_get_cntvct doesn't exist in this kernel. Signed-off-by: Chris Redpath --- diff --git a/kernel/sched/walt.c b/kernel/sched/walt.c index b9ae8d5c4393..d9d09914ce30 100644 --- a/kernel/sched/walt.c +++ b/kernel/sched/walt.c @@ -185,7 +185,14 @@ update_window_start(struct rq *rq, u64 wallclock) int nr_windows; delta = wallclock - rq->window_start; - BUG_ON(delta < 0); + /* If the MPM global timer is cleared, set delta as 0 to avoid kernel BUG happening */ + if (delta < 0) { + if (arch_timer_read_counter() == 0) + delta = 0; + else + BUG_ON(1); + } + if (delta < walt_ravg_window) return;