[Soekris] sc1100 TSC bug

Jim Cromie jim.cromie at gmail.com
Fri Sep 29 07:33:50 UTC 2006


dzpost at dedekind.net wrote:
> I'm confused about the status of the sc1100 TSC timer bug and its
> workaround.  I just installed linux on my new net4801, with a standard
> 2.6.18 kernel which I built for the purpose.  Based on what I'd read,
> I configured scx200_hrt module so it would use the high resolution
> timer as clock source instead of the TSC.
>
> When I install the scx200_hrt module, the clock starts running really
> _fast_: about 10 times normal speed.  Putting idle=poll in the kernel
> command line seems to fix it (in fact it then seems to run slightly
> slow, but I'm not sure about that).
>
>   
ilde=poll has no effect on the hi-res-timer based clocksource.
But it does help the TSC (see below)

> When I don't install the scx200_hrt module, I see this in the log
> files:
>
>   kernel: TSC appears to be running slowly. Marking it as unstable
>   kernel: Time: pit clocksource has been installed.
>
>   
that looks right.  18 has Generic Timekeeping System, which checks the 
TSC for 'sanity'
by comparing it for a short time against the 'jiffies' clocksource.  
This TSC fails that test.
So that clocksource is 'de-rated', and the GTS selects the less good, 
but working PIT. 

You can check the currently selected clocksource :

soekris:/sys# more devices/system/clocksource/clocksource0/*
::::::::::::::
devices/system/clocksource/clocksource0/available_clocksource
::::::::::::::
jiffies tsc pit
::::::::::::::
devices/system/clocksource/clocksource0/current_clocksource
::::::::::::::
tsc

This listing shows that on my box, the TSC is not detected as insane.
This is the 1st time Ive seen that, it may be that some changes to GTS 
in late -rcX's
reduced the sanity test time, and therefore its sensitivity.


Without the derating, modprobing scx200_hrt will not convince the GTS to 
select it,
since the TSC has the highest rating (highest resolution, lowest cost of 
reading)

soekris:/sys# modprobe scx200_hrt
[ 3123.253044] enabling scx200 high-res timer (27 MHz +0 ppm)
soekris:/sys#
soekris:/sys# more devices/system/clocksource/clocksource0/*
::::::::::::::
devices/system/clocksource/clocksource0/available_clocksource
::::::::::::::
scx200_hrt jiffies tsc pit
::::::::::::::
devices/system/clocksource/clocksource0/current_clocksource
::::::::::::::
tsc

Again, youre seeing the 'running slowly' message, so modprobing scx200_hrt
will replace the pit as the current_clocksource.

> I haven't checked it for more than a few minutes, but the clock seems
> be about as steady as with scx200_hrt and idle=poll.
>   
with idle=poll, the halt instruction isnt used, which avoids the errata 
(or the worst of it anyway)

http://soekris.com/Issue0003.htm
1) TSC stop during auto halt. The GX1 core has a bug (or feature ?) 
where the TSC stop during auto halt. That mean that the TSC is somehow 
useless and should not be used.

The cpu will run hotter, I dunno by how much.

soekris:/sys# date; ntpq -pcrv
Fri Sep 29 01:16:23 MDT 2006
     remote           refid      st t when poll reach   delay   offset  
jitter
==============================================================================
 harpo           .INIT.          16 u   23   64    0    0.000    0.000   
0.000
-time.dlitz.net  39.217.151.255   3 u   13   64  377   68.677   33.494  
48.481
*dsl081-199-165. .GPS.            1 u   18   64  377   97.208  -18.243  
22.906
+wsip-68-226-79- 80.198.124.92    3 u   24   64  377   97.499   10.027  
18.262
+dsl081-253-134. 192.5.41.40      2 u   19   64  377   75.940    9.848  
18.037
 LOCAL(0)        .LOCL.          13 l   11   64  377    0.000    0.000   
0.004
assID=0 status=0644 leap_none, sync_ntp, 4 events, event_peer/strat_chg,
version="ntpd 4.2.2 at 1.1532-o Fri Sep 15 09:33:32 UTC 2006 (1)",
processor="i586", system="Linux/2.6.18-sk", leap=00, stratum=2,
precision=-18, rootdelay=97.208, rootdispersion=49.444, peer=62615,
refid=64.81.199.165,
reftime=c8c746b6.320a9d1a  Fri, Sep 29 2006  1:16:06.195, poll=7,
clock=c8c746c8.3baf4aeb  Fri, Sep 29 2006  1:16:24.233, state=4,
offset=-8.301, frequency=32.007, jitter=28.369, noise=37.219,
stability=5.513, tai=0


you can force the selection of the scx200_hrt:

soekris:/sys# echo scx200_hrt > 
devices/system/clocksource/clocksource0/current
_clocksource
[ 4598.986771] Time: scx200_hrt clocksource has been installed.
soekris:/sys#
soekris:/sys# more devices/system/clocksource/clocksource0/*
::::::::::::::
devices/system/clocksource/clocksource0/available_clocksource
::::::::::::::
scx200_hrt jiffies tsc pit
::::::::::::::
devices/system/clocksource/clocksource0/current_clocksource
::::::::::::::
scx200_hrt

with that done, jitter is reported as lower, but could partly be settling.

soekris:/sys# date; ntpq -pcrv
Fri Sep 29 01:23:09 MDT 2006
     remote           refid      st t when poll reach   delay   offset  
jitter
==============================================================================
 harpo           .INIT.          16 u   41   64    0    0.000    0.000   
0.000
-time.dlitz.net  39.132.199.255   3 u   98  128  377   68.677   33.494  
47.133
*dsl081-199-165. .GPS.            1 u  101  128  377   96.907  -16.173   
7.870
+wsip-68-226-79- 80.198.124.92    3 u   45  128  377   97.361  -16.640   
6.623
+dsl081-253-134. 192.5.41.40      2 u   40  128  377   76.261   -4.474  
11.623
 LOCAL(0)        .LOCL.          13 l   29   64  377    0.000    0.000   
0.004
assID=0 status=0644 leap_none, sync_ntp, 4 events, event_peer/strat_chg,
version="ntpd 4.2.2 at 1.1532-o Fri Sep 15 09:33:32 UTC 2006 (1)",
processor="i586", system="Linux/2.6.18-sk", leap=00, stratum=2,
precision=-18, rootdelay=96.907, rootdispersion=39.237, peer=62615,
refid=64.81.199.165,
reftime=c8c74777.31063eb4  Fri, Sep 29 2006  1:19:19.191, poll=7,
clock=c8c7485e.40e257b3  Fri, Sep 29 2006  1:23:10.253, state=4,
offset=-11.102, frequency=31.496, jitter=9.440, noise=34.830,
stability=5.160, tai=0


> What is the "pit"?  Does this mean I don't need the scx200_hrt module
> at all?  My understanding is that idle=poll makes the cpu consume more
> power and generate more heat, which I would rather avoid.
>
> Can someone set the record straight on the current situation?  It
> would be nice to have this information updated on the Soekris web page
> as well :)
>
>   
soekris:/sys# lsmod
Module                  Size  Used by
scx200_hrt              2872  0 [permanent]
scx200_gpio             5444  0
scx200                  5120  2 scx200_hrt,scx200_gpio
pc8736x_gpio            6220  0
nsc_gpio                3664  2 scx200_gpio,pc8736x_gpio
pc87360                21584  0
hwmon_vid               2896  1 pc87360
i2c_isa                 6712  1 pc87360
i2c_core               24160  2 pc87360,i2c_isa
ndiswrapper           185032  0
usbcore               112884  1 ndiswrapper


Could you verify everything again ?
Id like to get to the bottom of the misbehaviors youre seeing.

> Thanks.
>
> -David
>   

hth,
jimc


More information about the Soekris-tech mailing list