From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 12250 invoked from network); 21 Mar 1998 21:10:00 -0000 Received: from cri.ens-lyon.fr (140.77.1.32) by mail2.redhat.com with SMTP; 21 Mar 1998 21:10:00 -0000 Received: from gueuze.ens-lyon.fr (gueuze [140.77.11.77]) by cri.ens-lyon.fr (8.8.5/8.8.1) with ESMTP id WAA27413 for ; Sat, 21 Mar 1998 22:09:57 +0100 (MET) Received: (from lprylli@localhost) by gueuze.ens-lyon.fr (8.8.5/8.8.0) id WAA24994; Sat, 21 Mar 1998 22:09:56 +0100 (MET) Date: Sat, 21 Mar 1998 22:09:56 +0100 (MET) Message-Id: <199803212109.WAA24994@gueuze.ens-lyon.fr> From: Loic Prylli To: axp-list@redhat.com Subject: Re: SX164 Clock Problem In-Reply-To: <199803211338.NAA00295@clifton.hobby.nl> References: <199803192028.VAA10590@gueuze.ens-lyon.fr> <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;