Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Loic Prylli <Loic.Prylli@ens-lyon.fr>
To: axp-list@redhat.com
Subject: Re: SX164 Clock Problem
Date: Sat, 21 Mar 1998 22:09:56 +0100 (MET)	[thread overview]
Message-ID: <199803212109.WAA24994@gueuze.ens-lyon.fr> (raw)
In-Reply-To: <199803211338.NAA00295@clifton.hobby.nl>


Wim van Dorst writes:
 > 
 > I have run the program on my PC164SX several times with:
 > - a self-built 2.0.33 kernel
 > - the stock rh5 sx164 kernel (as Jay Estabrook suggested)
 > 
 > The former give me the double timespeed (`date`=2*`clock`)
 > and the latter gives me the normal timespeed (`date`=`clock`).
 > 
 > Here are the results for the self-built kernel:
 > [...]

Ok, so it looks like the same problem (actually given the percentages,
it looks the date on your Alpha was perharps running about 1.6 too
fast rather than exatly 2?) 

Below the patch I use (not this workaround should be ok, but it does not
really solve the real problem, the interrupt handler should not be
called twice).


It is strange than the redhat one works ok, maybe the timer handler is
a bit slower to execute (due a smaller level of optimization while
compiling the kernel), and the problem cannot occur?

Loic

--- linux/arch/alpha/kernel/time.c.std  Sat Mar 21 21:01:41 1998
+++ linux/arch/alpha/kernel/time.c      Sat Mar 21 21:05:39 1998
@@ -61,12 +61,23 @@
  * timer_interrupt() needs to keep up the real-time clock,
  * as well as call the "do_timer()" routine every clocktick
  */
+
+#define MINCYCLE 50000/2
+/* the minimum number of rpcc cycles between two timer interrupts, it
+   assume > 50 Mhz processor clock, for a 600Mhz machine, this
+   workaround will work if the timer handler takes less than 25000
+   cycles=40us (that should be ok) */
+
 void timer_interrupt(struct pt_regs * regs)
 {
        __u32 delta, now;
+       static int ignored;
 
        now = rpcc();
        delta = now - state.last_time;
+       if (delta < MINCYCLE && ignored++ < 4)
+         return 0;
+       ignored = 0;
        state.last_time = now;
        if (delta > state.max_cycles_per_tick) {
                int i, missed_ticks;


  reply	other threads:[~1998-03-21 21:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-03-15 12:35 SX164 Clock Problem Jay.Estabrook
1998-03-16  9:49 ` Ladislav Zejda
1998-03-19 20:28 ` Loic Prylli
1998-03-21 13:38   ` Wim van Dorst
1998-03-21 21:09     ` Loic Prylli [this message]
1998-03-23 11:43     ` Ladislav Zejda
     [not found] <199803242130.QAA04157@linux03.amt.tay1.dec.com>
1998-03-25  9:14 ` Ladislav Zejda
1998-03-25 12:23   ` Christopher Huffine
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox