Re: serial input overrun(s) using ide-cd

Richard B. Johnson (root@chaos.analogic.com)
Mon, 13 Oct 1997 16:55:16 -0400 (EDT)


On Mon, 13 Oct 1997, Ronald Hesper wrote:

> Ted wrote:
> >...
> > --- certain broken IDE controllers will cause MASSIVE FILESYSTEM DAMAGE
> > if the stream of data during a programmed i/o data transfer is
> > interrupted by an interrupt.
> > - Ted
> >

Given this, I don't see how you could even boot such a system. This
simply can't be the problem . PIO is interruptible. It's not very
efficient, but certainly very safe. At the hardware level, PIO works just
like DMA except the CPU functions as the DMA controller which makes it
inefficient because the CPU can't do other things while the I/O operation
is in progress.

The data-flow into and out of the sector buffer is throttled using the
I/O channel ready bit. Data never goes directly to the disk. It is
transferred to and from a sector buffer, basically a FIFO. You can take
as much time as you want writing to or readinf from a FIFO. That's what
they are for. Therfore, you can be interrupted many times without adverse
affect.

If data are being corrupted, a particular board/IDE controller may have
been broken, but I don't see how it is possible for a specific design to
be broken. In other words, there may be a broken board out there, but
it can't be a generic broken design. Therefore a list of "bad controllers"
showing this defect can't exist.

There IS a known problem with some CPU cache controllers that can be
programmed for "write-behind" caching. They should all be set for write-
through (the normal mode). The problem being that some of these
controllers ignore the I/O (memory or port) bit. You could be writing
to a sector buffer via programmed I/O (a port operation) and the cache
controller may put its data on the bus (a memory operation). This can
(read will) make a mess of a file-system. The published "work-around" was
to turn OFF interrupts during PIO. This is dumb. The correct solution is
to turn OFF write-behind caching which does nothing to improve performance
because one seldom writes the same thing over-and-over again to the same
memory location in real world applications. Write-through operation will
keep you out of trouble even with poor board/controller designs.

Cheers,
DJ
Richard B. Johnson
Analogic Corporation
Penguin : Linux version 2.1.55 on an i586 machine (66.15 BogoMips).
Warning : It's hard to stay on the trailing edge of technology.
Linux : Engineering tool
Spam : sync@localhost, daemon@loghost