[Skiboot] [PATCH 05/11] hw/sbe-p9: Re-set the SBE timer after SBE interrupt

Nicholas Piggin npiggin at gmail.com
Sat Nov 16 15:07:21 AEDT 2024


When the SBE interrupt fires, clear the previous sbe_timer_target
and has_new_target variables, because the timer code will send us
an updated timer expiry after running check_timers().

This allows for example, a case where the SBE timer has fired too
early to reschedule the SBE timer again rather than leaving it to
be picked up by polling. SBE timer can fire early if the timer
exceeds its maximum timeout, or of the SBE timing is a little off.

Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
 hw/sbe-p9.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/sbe-p9.c b/hw/sbe-p9.c
index 4eafd24fd..f164ff8a7 100644
--- a/hw/sbe-p9.c
+++ b/hw/sbe-p9.c
@@ -548,6 +548,8 @@ static void p9_sbe_timer_response(struct p9_sbe *sbe)
 	 * we can schedule next timer request.
 	 */
 	timer_update_cnt = 0;
+	sbe_timer_target = ~0ull;
+	has_new_target = false;
 	unlock(&sbe_timer_lock);
 
 	check_timers(true);
@@ -958,7 +960,7 @@ static void p9_sbe_timer_init(void)
 	assert(timer_ctrl_msg);
 	init_lock(&sbe_timer_lock);
 	sbe_has_timer = true;
-	sbe_timer_target = mftb();
+	sbe_timer_target = ~0ull;
 	sbe_last_gen_stamp = ~0ull;
 	sbe_timer_def_tb = usecs_to_tb(SBE_TIMER_DEFAULT_US);
 	prlog(PR_INFO, "Timer facility on chip %x\n", sbe_default_chip_id);
-- 
2.45.2



More information about the Skiboot mailing list