Subject: Re: port-sparc64/31925: smartd panics NetBSD 2.0.2_STABLE on sparc64
To: None <port-sparc64-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: netbsd-bugs
Date: 11/01/2005 12:51:02
The following reply was made to PR port-sparc64/31925; it has been noted by GNATS.

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Martin Husemann <martin@duskware.de>
Cc: gnats-bugs@NetBSD.org
Subject: Re: port-sparc64/31925: smartd panics NetBSD 2.0.2_STABLE on sparc64
Date: Tue, 1 Nov 2005 13:49:59 +0100

 --bp/iNruPH9dso1Pn
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 On Mon, Oct 31, 2005 at 01:19:47AM +0100, Martin Husemann wrote:
 > Ok, in -current (modulo a slight kern/kern_physio problem that I avoided by
 > downgrading to r1.61) I can reproduce the problem by running
 > 
 >   smartctl -a /dev/sd0c
 > 
 > in single user mode. IMHO the problem should be fixed in the esiop driver,
 > and the following patch avoids it for me. The real fix probably would
 > avoid setting XS_CTL_DATA_OUT for commands that do not send any data.
 
 I don't think the check should be in esiop. I think scsipi shoud not set
 XS_CTL_DATA_IN/OUT if there is no data (or more drivers may need to be fixed)
 I think the attached patch should be the right fix, can you test it ?
 My sparc64 doesn't have a esiop adapter in right now, I can put one tomorow
 when I go at work ...
 
 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --
 
 --bp/iNruPH9dso1Pn
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename=diff
 
 Index: scsipi_ioctl.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/scsipi/scsipi_ioctl.c,v
 retrieving revision 1.53
 diff -u -r1.53 scsipi_ioctl.c
 --- scsipi_ioctl.c	31 Oct 2005 14:36:41 -0000	1.53
 +++ scsipi_ioctl.c	1 Nov 2005 12:47:47 -0000
 @@ -267,9 +267,9 @@
  		goto bad;
  	}
  
 -	if (screq->flags & SCCMD_READ)
 +	if ((screq->flags & SCCMD_READ) && screq->datalen > 0)
  		flags |= XS_CTL_DATA_IN;
 -	if (screq->flags & SCCMD_WRITE)
 +	if ((screq->flags & SCCMD_WRITE) && screq->datalen > 0)
  		flags |= XS_CTL_DATA_OUT;
  	if (screq->flags & SCCMD_TARGET)
  		flags |= XS_CTL_TARGET;
 
 --bp/iNruPH9dso1Pn--