[Skiboot] [PATCH 2/2] timer: Reschedule timer if OPAL receives early timer interrupt

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Thu May 3 23:21:26 AEST 2018


If we receive timer interrupt before timer expiry, we are not rescheduling
timer again. Lets fix this by rescheduling timer.

Suggested-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
 core/timer.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/core/timer.c b/core/timer.c
index 1c5395178..5890b203c 100644
--- a/core/timer.c
+++ b/core/timer.c
@@ -203,10 +203,15 @@ static void __check_timers(uint64_t now)
 	for (;;) {
 		t = list_top(&timer_list, struct timer, link);
 
-		/* Top of list not expired ? that's it ... */
-		if (!t || t->target > now)
+		if (!t)
 			break;
 
+		/* Top of list not expired ? re-schedule timer */
+		if (t->target > now) {
+			update_timer_expiry(t->target);
+			break;
+		}
+
 		/* Top of list still running, we have to delay handling
 		 * it. For now just skip until the next poll, when we have
 		 * SLW interrupts, we'll probably want to trip another one
-- 
2.14.3



More information about the Skiboot mailing list