Re: powerpc64: do tc_init(9) before cpu_startclock()

2022-05-26 Thread Mark Kettenis
> From: Scott Cheloha 
> Date: Thu, 26 May 2022 08:51:22 -0500
> 
> > On May 24, 2022, at 7:12 PM, Scott Cheloha  wrote:
> > 
> > In the future, the clock interrupt will need a working timecounter to
> > accurately reschedule itself.
> > 
> > Move tc_init(9) up before cpu_startclock().
> > 
> > (I can't test this but it seems correct.)
> > 
> > ok?
> 
> Ping.
> 
> This is trivial, can someone with powerpc64 hardware confirm this
> boots?

Confirmed.

Note that some of the other architectures (macppc and riscv64 for
example) do things in the same order.  So those need changing too and
it would be good to not let that slip.

ok kettenis@

> > Index: clock.c
> > ===
> > RCS file: /cvs/src/sys/arch/powerpc64/powerpc64/clock.c,v
> > retrieving revision 1.3
> > diff -u -p -r1.3 clock.c
> > --- clock.c 23 Feb 2021 04:44:31 -  1.3
> > +++ clock.c 25 May 2022 00:05:59 -
> > @@ -57,6 +57,9 @@ tb_get_timecount(struct timecounter *tc)
> > void
> > cpu_initclocks(void)
> > {
> > +   tb_timecounter.tc_frequency = tb_freq;
> > +   tc_init(_timecounter);
> > +
> > tick_increment = tb_freq / hz;
> > 
> > stathz = 100;
> > @@ -68,9 +71,6 @@ cpu_initclocks(void)
> > evcount_attach(_count, "stat", NULL);
> > 
> > cpu_startclock();
> > -
> > -   tb_timecounter.tc_frequency = tb_freq;
> > -   tc_init(_timecounter);
> > }
> > 
> > void
> 
> 



Re: powerpc64: do tc_init(9) before cpu_startclock()

2022-05-26 Thread Scott Cheloha
> On May 24, 2022, at 7:12 PM, Scott Cheloha  wrote:
> 
> In the future, the clock interrupt will need a working timecounter to
> accurately reschedule itself.
> 
> Move tc_init(9) up before cpu_startclock().
> 
> (I can't test this but it seems correct.)
> 
> ok?

Ping.

This is trivial, can someone with powerpc64 hardware confirm this
boots?

> Index: clock.c
> ===
> RCS file: /cvs/src/sys/arch/powerpc64/powerpc64/clock.c,v
> retrieving revision 1.3
> diff -u -p -r1.3 clock.c
> --- clock.c   23 Feb 2021 04:44:31 -  1.3
> +++ clock.c   25 May 2022 00:05:59 -
> @@ -57,6 +57,9 @@ tb_get_timecount(struct timecounter *tc)
> void
> cpu_initclocks(void)
> {
> + tb_timecounter.tc_frequency = tb_freq;
> + tc_init(_timecounter);
> +
>   tick_increment = tb_freq / hz;
> 
>   stathz = 100;
> @@ -68,9 +71,6 @@ cpu_initclocks(void)
>   evcount_attach(_count, "stat", NULL);
> 
>   cpu_startclock();
> -
> - tb_timecounter.tc_frequency = tb_freq;
> - tc_init(_timecounter);
> }
> 
> void



powerpc64: do tc_init(9) before cpu_startclock()

2022-05-24 Thread Scott Cheloha
In the future, the clock interrupt will need a working timecounter to
accurately reschedule itself.

Move tc_init(9) up before cpu_startclock().

(I can't test this but it seems correct.)

ok?

Index: clock.c
===
RCS file: /cvs/src/sys/arch/powerpc64/powerpc64/clock.c,v
retrieving revision 1.3
diff -u -p -r1.3 clock.c
--- clock.c 23 Feb 2021 04:44:31 -  1.3
+++ clock.c 25 May 2022 00:05:59 -
@@ -57,6 +57,9 @@ tb_get_timecount(struct timecounter *tc)
 void
 cpu_initclocks(void)
 {
+   tb_timecounter.tc_frequency = tb_freq;
+   tc_init(_timecounter);
+
tick_increment = tb_freq / hz;
 
stathz = 100;
@@ -68,9 +71,6 @@ cpu_initclocks(void)
evcount_attach(_count, "stat", NULL);
 
cpu_startclock();
-
-   tb_timecounter.tc_frequency = tb_freq;
-   tc_init(_timecounter);
 }
 
 void