Re: [PATCH] Re: time() glitch on 2.4.18: solved

Alan Cox (alan@lxorguk.ukuu.org.uk)
05 Nov 2002 17:32:53 +0000


On Tue, 2002-11-05 at 16:30, Jim Paris wrote:
> This works well.
>
> -jim
>
> diff -urN linux-2.4.18/arch/i386/kernel/time.c linux-2.4.18-jim/arch/i386/kernel/time.c
> --- linux-2.4.18/arch/i386/kernel/time.c Fri Mar 15 18:28:53 2002
> +++ linux-2.4.18-jim/arch/i386/kernel/time.c Tue Nov 5 11:22:02 2002
> @@ -501,6 +501,16 @@
>
> count = inb_p(0x40); /* read the latched count */
> count |= inb(0x40) << 8;
> +
> + /* Any unpaired read will cause the above to swap MSB/LSB
> + forever. Try to detect this and reset the counter. */
> + if (count > LATCH) {
> + 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;

Add a printk to address the fact we want to know about this and I think
thats enough to meet George's objection ?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/