Subject: isa_dmastart return value ignored?
To: None <tech-kern@netbsd.org>
From: Leo Weppelman <leo@wau.mis.ah.nl>
List: tech-kern
Date: 02/22/2001 09:15:11
I am wondering if I am missing something or if a lot of drivers are based
on sheer luck...
I am playing with a Milan (basically a PC-ish hardware with a m68k CPU). It
has a more or less standard SuperIO and a PLX chipset for ISA/PCI. So I
could use a (nearly) unmodified copy of isa/fd.c and the standard isadma
code. So far so good...
When loading the installation ramdisk, I ran into 'hard errors' after approx.
reading 3 tracks on a 1.44M floppy (data overruns). After finding out that
it really wasn't the hardware, it turned out to be that isa_dmastart() was
failing. The isa dmamap has only 1 segment - well, that's life ;-) However,
when you try to load 1MB in tracksize chunks (== 36blks) of a floppy into
memory, you run into the fact that tracksize != pagesize and not all of
the allocated memory is physically contiguous. So at each page boundary
crossing, you have the risk of a failing isa_dmastart(). Note that the
'normal' method of retrying the transfer won't work here.
What I did to work around this is to trim down the transfer after each
isa_dmastart() failure, until it works or the tranfersize is zero. This
is tedious however, since you don't know the residual count. Would it
make sense to extend the interface here?
A quick grep through dev/isa showed that none of the drivers using
isa_dmastart() is actually checking the results. This makes me wonder if
I am doing something wrong...
Leo.