All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willy Tarreau <willy@w.ods.org>
To: "Richard B. Johnson" <root@chaos.analogic.com>
Cc: Willy Tarreau <willy@w.ods.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>, Jim Paris <jim@jtan.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Re: time() glitch on 2.4.18: solved
Date: Wed, 6 Nov 2002 00:15:34 +0100	[thread overview]
Message-ID: <20021105231534.GA28279@alpha.home.local> (raw)
In-Reply-To: <Pine.LNX.3.95.1021105152508.734B-100000@chaos.analogic.com>

On Tue, Nov 05, 2002 at 03:38:00PM -0500, Richard B. Johnson wrote:
> On Tue, 5 Nov 2002, Willy Tarreau wrote:
> 
> > On Tue, Nov 05, 2002 at 08:07:26PM +0000, Alan Cox wrote:
> > > On Tue, 2002-11-05 at 19:29, Richard B. Johnson wrote:
> > > > The only hardware a modern PC needs to use "slow-down_io" on is
> > > > the RTC CMOS device. Since we need to support older boards, you
> > > > don't want to remove the _p options indiscriminately, but you do
> > > > not want them ever between two consecutive writes to the same device-
> > > > port.
> > > 
> > > I own at least one that needs the _p on the DMA controller and at one
> > > that needs _p on the PIT
> > 
> > Well, in fact, Intel's 82C54 datasheet says that this chip needs at least
> > 165 ns between two consecutive operations, either read or write. So with a
> > 8 Mhz bus, you may effectively need to insert fake accesses, although most
> > modern chipsets certainly have better specs.
> > 
> 
> Its not a clocked bus. The 8 MHz means nothing. It's an async bus
> and if the setup timing of the data/address-decode/chip-select sequence
> is not violated, you get ~200ns between accesses so chip-to-chip
> select time comes automatically. But, some older motherboards violated
> all kinds of specs. They did this deliberately so you could plug
> RAM boards into the ISA bus and get reasonable performance. If we still
> support them, you need some artifical waits.

Well, some older (386) motherboards had the 8254 directly connected to the ISA
bus. And since Linux is 386-compatible, I think we should still support those
boards.

> It's not the port address. It's the bus state. The chip requires two
> consecutive writes when setting that latch. It's just like a 32-bit
> write to a 32-bit port (like PCI access), you can't write to the
> low-port, do something else, then write to the high port.

Yes you can ! the chip uses a CS (chip select) from an address decoder,
and sees the reads/writes only when both CS and either RD or WR are low.
I understand that all this circuitry may be simplified a bit in recent
chipsets (one unified decoder, fewer glue logic between chips), but there's
no reason that this should not be respected if the chip makers claim a bit
of compatibility.

> It needs to be done with no intervening bus states. In the AMD case, it's
> probably because the address is ignored on the second write.

Then it's buggy. This chip was originaly designed to work for 8086/80186,
which barely means work when directly connected to an ISA bus. If AMD make
their chip rely on PCI-like back-to-back behaviour, I don't agree for the
compatibility.

Now, since there's at least one buggy implementation, the solution is udelay().
But do you think that your chip may be confused by a memory access, when
udelay() fetches the count variable from memory, for example ?

The last other solution may be to simply use jmp $+2, which will be slow
enough on old sensible hardware, and imperceptible on more recent hardware
which doesn't require this.

Since Alan and you have one piece of hardware which show opposite behaviour,
we should get an ever working solution quickly :-)

Cheers,
Willy
 

  reply	other threads:[~2002-11-05 23:09 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-02  6:37 time() glitch on 2.4.18 at 177 days uptime? Jim Paris
2002-11-03 19:32 ` time() glitch on 2.4.18: solved Jim Paris
2002-11-03 20:30   ` Alan Cox
2002-11-05 16:30     ` [PATCH] " Jim Paris
2002-11-05 16:54       ` george anzinger
2002-11-05 17:10       ` Willy Tarreau
2002-11-05 18:16         ` Alan Cox
2002-11-05 18:02           ` Jim Paris
2002-11-05 18:37             ` Alan Cox
2002-11-05 18:20               ` Willy Tarreau
2002-11-05 18:50                 ` Jim Paris
2002-11-05 17:14       ` Willy Tarreau
2002-11-05 17:42         ` Jim Paris
2002-11-05 18:57           ` Richard B. Johnson
2002-11-05 19:08             ` Willy Tarreau
2002-11-05 19:29               ` Richard B. Johnson
2002-11-05 20:07                 ` Alan Cox
2002-11-05 20:14                   ` Willy Tarreau
2002-11-05 20:38                     ` Richard B. Johnson
2002-11-05 23:15                       ` Willy Tarreau [this message]
2002-11-06 12:47                         ` Richard B. Johnson
2002-11-06 13:25                           ` Alan Cox
2002-11-06 23:21                             ` Jim Paris
2002-11-05 20:23                   ` Richard B. Johnson
2002-11-05 20:57                     ` Alan Cox
2002-11-05 20:41                       ` Richard B. Johnson
2002-11-06 15:09                         ` Christer Weinigel
2002-11-06 15:49                           ` Richard B. Johnson
2002-11-05 20:06             ` Alan Cox
2002-11-05 17:32       ` Alan Cox

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=20021105231534.GA28279@alpha.home.local \
    --to=willy@w.ods.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=jim@jtan.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=root@chaos.analogic.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.