Re: kernel: rtc: 1000 > kern.hz: Timing will be inaccurate, please increase hz.

From: Erik Trulsson <ertr1013_at_student.uu.se>
Date: Wed, 21 Apr 2004 12:40:04 +0200
On Wed, Apr 21, 2004 at 01:33:17PM +0300, Ion-Mihai Tetcu wrote:
> On Tue, 20 Apr 2004 19:05:54 -0700 (PDT)
> Mikko_Työläjärvi <mbsd_at_pacbell.net> wrote:
> 
> > On Tue, 20 Apr 2004, Nate Lawson wrote:
> > 
> > > On Thu, 15 Apr 2004, Ion-Mihai Tetcu wrote:
> > > > I've started to get this messages after upgrading to
> > > > /src/sys/dev/acpica/acpi_pcib.c rev=1.38 from rev 1.36
> > 
> > [...]
> > 
> > > I can't see anything wrong with your dmesg.  A quick grep through the
> > > kernel doesn't show any message like in the subject line.  I'm ccing this
> > > to current_at_ because the message sounds like it's hz or timecounter
> > > related.  It's not likely that this message is acpi-related.
> > 
> > It is ports/emulators/rtc.  Has nothing to do with acpi.
> 
> My bad, excuse me for the noise on acpi_at_. It just happen the I installed
> it in the same day I had the little acpi problem.
> 
> Still what is it complaining about ? It seems I'm lost here; I have an
> "options  HZ=1000" in my kernel.

That is actually a minor bug in emulators/rtc.
The relevant snippet of code from there is in files/rtc.c and looks like:

 sc->var.freq = freq;                                                      
 if (sc->var.freq * 9 > hz * 8) {
     sc->var.freq = hz;
     printf("rtc: %d > kern.hz: Timing will be inaccurate, please increase hz.\n", sc->var.freq);
     }
 
Note that when it prints "1000 > kern.hz" the number printed will be
what actually have set HZ to, rather than the frequency requested.
That is easily fixed by switching places of the "sc->var.freq = hz;"
line and the printf line.

Note also that the value for HZ needs to be a bit higher than the
frequency rtc is requested to use in order to stop rtc from
complaining.
The frequency rtc is requested to use is probably 1024 (at least that
is what mplayer uses when built with rtc support.)
If you set HZ to 1160 or higher the complaining should stop.


-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013_at_student.uu.se
Received on Wed Apr 21 2004 - 01:40:09 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:51 UTC