From 5cbf2c1d788b602d64e77f269ba0344bf3a947bb Mon Sep 17 00:00:00 2001 From: cheloha Date: Thu, 11 Aug 2022 17:15:21 +0000 Subject: [PATCH] powerpc64: cpu_initclocks: do tc_init(9) before cpu_startclock() In the future, the clock interrupt will need a working timecounter to accurately reschedule itself. Move tc_init(9) up before cpu_startclock(). kettenis@ notes several other platforms need this same change. Maybe we can do the rest all at once. Tested by kettenis@. Link: https://marc.info/?l=openbsd-tech&m=165343754512382&w=2 ok kettenis@ --- sys/arch/powerpc64/powerpc64/clock.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/arch/powerpc64/powerpc64/clock.c b/sys/arch/powerpc64/powerpc64/clock.c index 31d1769e109..aef95e83dd8 100644 --- a/sys/arch/powerpc64/powerpc64/clock.c +++ b/sys/arch/powerpc64/powerpc64/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.4 2022/08/09 04:40:08 cheloha Exp $ */ +/* $OpenBSD: clock.c,v 1.5 2022/08/11 17:15:21 cheloha Exp $ */ /* * Copyright (c) 2020 Mark Kettenis @@ -57,6 +57,9 @@ tb_get_timecount(struct timecounter *tc) void cpu_initclocks(void) { + tb_timecounter.tc_frequency = tb_freq; + tc_init(&tb_timecounter); + tick_increment = tb_freq / hz; stathz = 100; @@ -68,9 +71,6 @@ cpu_initclocks(void) evcount_attach(&stat_count, "stat", NULL); cpu_startclock(); - - tb_timecounter.tc_frequency = tb_freq; - tc_init(&tb_timecounter); } void -- 2.20.1