Subject: Re: LSI Logic 53c1030 / mpt(4) - dma error message
To: Nicolas Joly <njoly@pasteur.fr>
From: Jachym Holecek <freza@liberouter.org>
List: current-users
Date: 02/04/2005 22:38:20
> > If you are going to try this, make sure you are running a kernel with ddb
> > enabled and when the panic gets hit, please copy the backtrace ("db> bt")
> > and send it here (ok, it clearly falls off in findroot(), but seeing the
> > intermediate calls might be of use).
> 
> Just got the panic during boot process, with 2 SCSIPI debug lines ...

Good, but I can't see any problem by bare eye ;-). Could you please
try another patch (relative to src/sys)? It just hard-codes more
diagnostic output. As before, SCSIPI_DEBUG will be needed.

Just guessing -- is your root partition on sd0 somewhere around 20GB?

(I still think transfer bytecount gets screwed somewhere on the way,
there's a couple of implicit signed/unsigned int/int64_t casts involved...)

	Regards,
		-- Jachym Holecek

Index: dev/scsipi/scsipi_base.c
===================================================================
RCS file: /pub/NetBSD-CVS/src/sys/dev/scsipi/scsipi_base.c,v
retrieving revision 1.123
diff -u -r1.123 scsipi_base.c
--- dev/scsipi/scsipi_base.c	7 Dec 2004 23:14:03 -0000	1.123
+++ dev/scsipi/scsipi_base.c	4 Feb 2005 21:28:12 -0000
@@ -1925,6 +1925,10 @@
 	}
 #endif
 
+	printf("scsipi_execute_xs: ");
+	show_scsipi_xs(xs);
+	printf("\n");
+
 	/*
 	 * Deal with command tagging:
 	 *
Index: dev/scsipi/sd.c
===================================================================
RCS file: /pub/NetBSD-CVS/src/sys/dev/scsipi/sd.c,v
retrieving revision 1.232
diff -u -r1.232 sd.c
--- dev/scsipi/sd.c	7 Dec 2004 23:16:40 -0000	1.232
+++ dev/scsipi/sd.c	4 Feb 2005 21:28:13 -0000
@@ -659,6 +659,9 @@
 	SC_DEBUG(sd->sc_periph, SCSIPI_DB2, ("sdstrategy "));
 	SC_DEBUG(sd->sc_periph, SCSIPI_DB1,
 	    ("%d bytes @ blk %" PRId64 "\n", bp->b_bcount, bp->b_blkno));
+
+	printf("sdstrategy: blk %llu bcount %d\n", bp->b_blkno, bp->b_bcount);
+
 	/*
 	 * If the device has been made invalid, error out
 	 */
Index: miscfs/specfs/spec_vnops.c
===================================================================
RCS file: /pub/NetBSD-CVS/src/sys/miscfs/specfs/spec_vnops.c,v
retrieving revision 1.79
diff -u -r1.79 spec_vnops.c
--- miscfs/specfs/spec_vnops.c	25 May 2004 14:54:57 -0000	1.79
+++ miscfs/specfs/spec_vnops.c	4 Feb 2005 21:28:15 -0000
@@ -331,6 +331,7 @@
 			bn = (uio->uio_offset >> DEV_BSHIFT) &~ (bscale - 1);
 			on = uio->uio_offset % bsize;
 			n = min((unsigned)(bsize - on), uio->uio_resid);
+			printf("spec_read: bn %llu bsize %d\n", bn, bsize);
 			error = bread(vp, bn, bsize, NOCRED, &bp);
 			n = min(n, bsize - bp->b_resid);
 			if (error) {
Index: kern/vfs_bio.c
===================================================================
RCS file: /pub/NetBSD-CVS/src/sys/kern/vfs_bio.c,v
retrieving revision 1.141
diff -u -r1.141 vfs_bio.c
--- kern/vfs_bio.c	10 Jan 2005 15:29:50 -0000	1.141
+++ kern/vfs_bio.c	4 Feb 2005 21:28:16 -0000
@@ -572,6 +572,8 @@
 	struct proc *p = l->l_proc;
 	struct mount *mp;
 
+	printf("bio_doread: blkno %llu size %d\n", blkno, size);
+
 	bp = getblk(vp, blkno, size, 0, 0);
 
 #ifdef DIAGNOSTIC
Index: kern/vfs_vnops.c
===================================================================
RCS file: /pub/NetBSD-CVS/src/sys/kern/vfs_vnops.c,v
retrieving revision 1.85
diff -u -r1.85 vfs_vnops.c
--- kern/vfs_vnops.c	2 Jan 2005 16:08:29 -0000	1.85
+++ kern/vfs_vnops.c	4 Feb 2005 21:28:16 -0000
@@ -398,6 +398,8 @@
 	struct mount *mp;
 	int error;
 
+	printf("vn_rdwr: len %d offset %llu\n", len, offset);
+
 	if ((ioflg & IO_NODELOCKED) == 0) {
 		if (rw == UIO_READ) {
 			vn_lock(vp, LK_SHARED | LK_RETRY);