From: Jeronimo Pellegrini <pellegrini@mpcnet.com.br>
To: Andrzej Krzysztofowicz <ankry@green.mif.pg.gda.pl>
Cc: linux-kernel@vger.kernel.org, vojtech@suse.cz
Subject: Re: [PATCH] VIA timer fix was removed?
Date: Mon, 12 Nov 2001 14:05:30 -0200 [thread overview]
Message-ID: <20011112140530.A23866@socrates> (raw)
In-Reply-To: <20011112111409.A2617@socrates> <200111121448.PAA01060@green.mif.pg.gda.pl>
In-Reply-To: <200111121448.PAA01060@green.mif.pg.gda.pl>
On Mon, Nov 12, 2001 at 03:48:24PM +0100, Andrzej Krzysztofowicz wrote:
> > The following patch (introduced by Vojtech Pavlik some time ago) was
> > removed somewhere between 2.4.14 and 2.4.15-pre3.
> > Without it, the timer counter is reset to a wrong value and
> > gettimeofday() starts to return strange values
> >
> > Nothing aboutit is mentioned in the changelog, so I suppose it wasn't
> > supposed to be removed?
>
> Maybe, it happens because somebody forgot to comment why this code is
> necessary here ?
> Just a guess...
Then perhaps this would be a good idea?
J.
--- linux-2.4.15-pre3/arch/i386/kernel/time.c Sun Nov 11 21:33:31 2001
+++ linux-2.4.15-pre3-new/arch/i386/kernel/time.c Mon Nov 12 14:04:20 2001
@@ -501,6 +501,19 @@
count = inb_p(0x40); /* read the latched count */
count |= inb(0x40) << 8;
+
+ /*
+ * When using some via chipsets (as the vt82c686a, for example)
+ * the system timer counter (i8253) should be reprogrammed in
+ * this case, otherwise it may be reset to a wrong value.
+ */
+ if (count > LATCH-1) {
+ outb_p(0x34, 0x43);
+ outb_p(LATCH & 0xff, 0x40);
+ outb(LATCH >> 8, 0x40);
+ count = LATCH - 1;
+ }
+
spin_unlock(&i8253_lock);
count = ((LATCH-1) - count) * TICK_SIZE;
next prev parent reply other threads:[~2001-11-12 16:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-12 13:14 [PATCH] VIA timer fix was removed? Jeronimo Pellegrini
2001-11-12 14:48 ` Andrzej Krzysztofowicz
2001-11-12 16:05 ` Jeronimo Pellegrini [this message]
2001-11-12 18:49 ` Nils Philippsen
2001-11-12 19:00 ` Jeronimo Pellegrini
2001-11-12 19:21 ` Nils Philippsen
2001-11-12 21:27 ` Neale Banks
2001-11-12 21:31 ` Alan Cox
2001-11-12 21:58 ` Vojtech Pavlik
2001-11-12 21:59 ` Neale Banks
2001-11-12 22:43 ` Alan Cox
[not found] <20011119182927.A19179@suse.cz>
2002-04-08 6:33 ` Neale Banks
2002-04-08 7:24 ` Vojtech Pavlik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20011112140530.A23866@socrates \
--to=pellegrini@mpcnet.com.br \
--cc=ankry@green.mif.pg.gda.pl \
--cc=linux-kernel@vger.kernel.org \
--cc=vojtech@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox