NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/57133



The following reply was made to PR kern/57133; it has been noted by GNATS.

From: Brian Buhrow <buhrow%nfbcal.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: buhrow%nfbcal.org@localhost
Subject: Re: kern/57133
Date: Sun, 1 Oct 2023 12:11:05 -0700

 	Hello.  Following up on this issue again, I decided to print the SCsI command that
 triggers the problem, in hopes that might help folks figure out what's going wrong.  Below is
 some excerpted output that shows the problem.
 
 Also, I dinclude a patch to mpii.c which avoids the panic, but provides more information about
 the issue, so, as folks encounter the error in the field, we can get more data.  this patch
 allows me to run with the mpii card and the apparently troublesome Western Digital disks
 without a problem.
 
 First, the debug output, then the patch.
 
 
 [  10.5574554] sd0 at scsibus0 target 0 lun 0: <ATA, WDC WD4003FFBX-6, 0A83> disk fixed
 [  10.5574554] sd0: 3726 GB, 3815448 cyl, 16 head, 127 sec, 512 bytes/sect x 7814037168 sectors
 [  10.5681363] dk0 at sd0: "1adc589e-4f32-11ee-b97c-00259036fd2e", 7814033005 blocks at 34, type: raidframe
 [  10.5853388] sd0: tagged queueing
 [  10.7574556] mpii0: resid = 0, datalen = 16384
 [  10.7574556] mpii0: SCSI command info is: 0xa3 0c 80 00 00 00 00 00 40 00 00 00
 sd1 at scsibus0 target 1 lun 0: <ATA, WDC WD4003FFBX-6, 0A83> disk fixed
 [  10.7774550] sd1: 3726 GB, 3815448 cyl, 16 head, 127 sec, 512 bytes/sect x 7814037168 sectors
 [  10.8374548] mssd1: tagged queueing
 [  11.0074552] mpii0: resid = 0, datalen = 16384
 [  11.0074552] mpii0: SCSI command info is: 0xa3 0c 80 00 00 00 00 00 40 00 00 00
 sd2 at scsibus0 target 2 lun 0: <ATA, WDC WD4003FFBX-6, 0A83> disk fixed
 [  11.0274552] sd2: 3726 GB, 3815448 cyl, 16 head, 127 sec, 512 bytes/sect x 7814037168 sectors
 [  11.0574559] sd2: 3907019088 trailing sectors not covered by disklabel
 [  11.0674553] sd2: tagged queueing
 [  11.2574559] mpii0: resid = 0, datalen = 16384
 [  11.2574559] mpii0: SCSI command info is: 0xa3 0c 80 00 00 00 00 00 40 00 00 00
 sd3 at scsibus0 target 5 lun 0: <ATA, WDC WD4003FFBX-6, 0A83> disk fixed
 [  11.2774557] sd3: 3726 GB, 3815448 cyl, 16 head, 127 sec, 512 bytes/sect x 7814037168 sectors
 [  11.2874554] dk1 at sd3: "549e5298-5113-11ee-910e-00259036fd2e", 7814033005 blocks at 34, type: raidframe
 [  11.2974554] sd3: tagged queueing
 
 
 Now, the patch.
 
 Index: mpii.c
 ==================================================================
 RCS file: /cvsroot/src/sys/dev/pci/mpii.c,v
 retrieving revision 1.29
 diff -u -r1.29 mpii.c
 --- mpii.c	7 Aug 2021 16:19:14 -0000	1.29
 +++ mpii.c	1 Oct 2023 18:58:28 -0000
 @@ -1,4 +1,4 @@
 -/* $NetBSD$ */
 +/* $NetBSD: mpii.c,v 1.29 2021/08/07 16:19:14 thorpej Exp $ */
  /*	$OpenBSD: mpii.c,v 1.115 2018/08/14 05:22:21 jmatthew Exp $	*/
  /*
   * Copyright (c) 2010, 2012 Mike Belopuhov
 @@ -20,7 +20,7 @@
   */
  
  #include <sys/cdefs.h>
 -__KERNEL_RCSID(0, "$NetBSD$");
 +__KERNEL_RCSID(0, "$NetBSD: mpii.c,v 1.29 2021/08/07 16:19:14 thorpej Exp $");
  
  #include "bio.h"
  
 @@ -3203,8 +3203,18 @@
  		bus_dmamap_unload(sc->sc_dmat, dmap);
  	}
  
 +	if (xs->resid != xs->datalen) {
 +		printf("%s: resid = %u, datalen = %u\n",
 +		DEVNAME(sc), xs->resid, xs->datalen);
 +		printf("%s: SCSI command info is: ",DEVNAME(sc));
 +		scsipi_print_cdb(xs->cmd);
 +		printf("\n");
 +	}
 +
  	KASSERT(xs->error == XS_NOERROR);
 +#if 0
  	KASSERT(xs->resid == xs->datalen);
 +#endif
  	KASSERT(xs->status == SCSI_OK);
  
  	if (ccb->ccb_rcb == NULL) {
 


Home | Main Index | Thread Index | Old Index