Subject: Re: LSI Logic 53c1030 / mpt(4) - dma error message
To: Frank van der Linden <fvdl@netbsd.org>
From: Nicolas Joly <njoly@pasteur.fr>
List: current-users
Date: 02/04/2005 18:21:03
On Fri, Feb 04, 2005 at 05:18:08PM +0100, Frank van der Linden wrote:
> On Fri, Feb 04, 2005 at 04:47:22PM +0100, Nicolas Joly wrote:
> > During boot, i get a DMA loading error message from this controller :
[...]
> > mpt1: error 22 loading DMA map
> > sd0(mpt1:0:1:0): generic HBA error
> > findroot: unable to read block 4294967296
>
> Hmm.
>
> A bus_dmamap_load can fail if the length specified is larger than that
> of the DMA map. Or.. if it's (partly) beyond the limit of valid DMA
> memory and bouncing doesn't work properly. Since the mpt driver doesn't
> use 64bit addresses (though it can and should), it's possible that
> the buffer has to be bounced since it's beyond 4G. However, the bus_dma
> code should deal with that (I did test mpt on a machine with 16G).
>
> Can you add a little code to sys/dev/ic/mpt_netbsd.c::mpt_run_xfer
> in the DMA map load case to print out some values?
>
> Like this:
>
> printf("datalen %d mapsize %llu first page at %llx\n",
> xs->datalen, (unsigned long long)req->dmap->dm_mapsize,
> vtophys(xs->data));
>
> ..and see what that says? If the datalen is <= the mapsize, then there
> might be something wrong with the bounce code. Also, the first physical
> address of the data might tell us if it is a problem with the bounce
> code or not.
Here are the first 2 values :
datalen 393456128 mapsize 0
mpt1: error 22 loading DMA map
sd0(mpt1:0:1:0): generic HBA error
findroot: unable to read block 4294967296
For the first page adress, i'm getting a warning i 'm unable to fix :-(
/local/src/NetBSD/src/sys/dev/ic/mpt_netbsd.c: In function `mpt_run_xfer':
/local/src/NetBSD/src/sys/dev/ic/mpt_netbsd.c:777: warning: passing arg 1 of `vtophys' makes integer from pointer without a cast
/local/src/NetBSD/src/sys/dev/ic/mpt_netbsd.c:777: warning: long long unsigned int format, paddr_t arg (arg 4)
Thanks.
--
Nicolas Joly
Biological Software and Databanks.
Institut Pasteur, Paris.