[Skiboot] [PATCH v2 04/11] core/timer: Always update hardware timer

Reza Arbab arbab at linux.ibm.com
Sat Jan 25 05:56:54 AEDT 2025


On Tue, Jan 14, 2025 at 09:46:45PM +1000, Nicholas Piggin wrote: 
>@@ -119,15 +138,18 @@ static void __schedule_timer_at(struct timer *t, uint64_t when)
> 			if (when >= lt->target)
> 				continue;
> 			list_add_before(&timer_list, &lt->link, &t->link);
>-			goto bail;
>+			goto added;
> 		}
> 		list_add_tail(&timer_list, &t->link);
>-	}
>- bail:
>-	/* Pick up the next timer and upddate the SBE HW timer */
>-	lt = list_top(&timer_list, struct timer, link);
>-	if (lt) {
>-		update_timer_expiry(lt->target);
>+ added:
>+		/* Timer running code will update expiry at the end */
>+		if (!this_cpu_is_running_timer()) {
>+			/* Pick the next timer and upddate the SBE HW timer */
>+			lt = list_top(&timer_list, struct timer, link);
>+			if (lt && (lt == t || when < lt->target)) {
>+				update_timer_expiry(lt->target);
>+			}

I committed this hunk without the braces around the single statement.

>+		}
> 	}
> }
>

-- 
Reza Arbab


More information about the Skiboot mailing list