Subject: Re: LSI Logic 53c1030 / mpt(4) - dma error message
To: Nicolas Joly <njoly@pasteur.fr>
From: Frank van der Linden <fvdl@netbsd.org>
List: current-users
Date: 02/04/2005 17:18:08
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 :
>
> mpt0 at pci4 dev 1 function 0: LSI Logic 53c1030 Ultra320 SCSI
> mpt0: interrupting at ioapic2 pin 1 (irq 5)
> scsibus0 at mpt0: 16 targets, 8 luns per target
> mpt1 at pci4 dev 1 function 1: LSI Logic 53c1030 Ultra320 SCSI
> mpt1: interrupting at ioapic2 pin 2 (irq 3)
> scsibus1 at mpt1: 16 targets, 8 luns per target
> [...]
> scsibus0: waiting 2 seconds for devices to settle...
> scsibus1: waiting 2 seconds for devices to settle...
> sd0 at scsibus1 target 1 lun 0: <HITACHI, HUS103073FL3800, SA14> disk fixed
> sd0: 70007 MB, 65494 cyl, 3 head, 729 sec, 512 bytes/sect x 143374805 sectors
> sd0: sync (6.25ns offset 80), 16-bit (320.000MB/s) transfers, tagged queueing
> sd1 at scsibus1 target 2 lun 0: <HITACHI, HUS103073FL3800, SA14> disk fixed
> sd1: 70007 MB, 65494 cyl, 3 head, 729 sec, 512 bytes/sect x 143374805 sectors
> sd1: sync (6.25ns offset 80), 16-bit (320.000MB/s) transfers, tagged queueing
> ses0 at scsibus1 target 9 lun 0: <SDR, GEM318P, 1> processor fixed
> ses0: SAF-TE Compliant Device
> ses0: async, 8-bit transfers
> 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.
- Frank