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

From: Willy Tarreau (willy@w.ods.org)
Date: Tue Nov 05 2002 - 12:14:06 EST


BTW, why not trying to resync, with something like :

   if (count >= LATCH)
        count = (count >> 8) | inb(0x40) << 8;

Cheers,
Willy

> 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;
> -
> 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/
-
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/



This archive was generated by hypermail 2b29 : Thu Nov 07 2002 - 22:00:38 EST