Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5e12076 authored by Chris Redpath's avatar Chris Redpath Committed by Dmitry Shmidt
Browse files

ANDROID: arch_timer: add error handling when the MPM global timer is cleared



Bug: 29000863
Signed-off-by: default avataralbert.zl_huang <albert.zl_huang@htc.com>
Change-Id: I2b5a28b0a9edb31bdaa1ca2310397dd2f36f6c23

Updated to use arch_timer_read_counter() as arch_counter_get_cntvct
doesn't exist in this kernel.

Signed-off-by: default avatarChris Redpath <chris.redpath@arm.com>
Signed-off-by: default avatarAndres Oportus <andresoportus@google.com>
parent a31778a0
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -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;