Subject: Re: a problem with a SCSI disk
To: None <matthieu@laas.fr>
From: James E. Bernard <jbernard@tater.Mines.EDU>
List: port-sparc
Date: 05/14/1996 11:30:29
Matthieu,

>I've a problem with an old Hitachi 600Mo SCSI disk on an IPC.
>This disk works OK on this machine under SunOS 4.1.3, but produces a
>'Non media hardware failure' error when used with NetBSD-current on
>the same machine.

>Here are the probe messages at boot:

>sd1 at scsibus0 targ 1 lun 0: <HITACHI, DK515C, CP16> SCSI1 0/direct fixed
>sd1: sd1(esp0:1:0): non-media hardware failure, data = 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>drive offline

  As a matter of fact, I ran into the same problem with the same disk on a
sparc 1.  It turns out that the disk responds with an error condition when
the MI scsi code hits it with a START command.  I've been meaning to get
around to thinking about a good way to fix this and submitting a PR, but
haven't found the time.  In any case, a workaround is to patch sd.c to omit
the START commands (I'll attach the patch below).  If you can boot over the
net and build a kernel, or build one on another machine, you should be able
to get the system installed easily.

--Jim Bernard
  jbernard@mines.edu

P.S.: This patch is relative to a fairly recent -current version of sd.c,
but the affected areas have not (I think) changed since 1.1, so you should
easily be able to apply it by hand if patch fails.

*** sd.c-dist	Sat May  4 05:59:10 1996
--- sd.c	Sat May  4 06:18:44 1996
***************
*** 199,206 ****
  	 */
  	printf("\n");
  	printf("%s: ", sd->sc_dev.dv_xname);
! 	if (scsi_start(sd->sc_link, SSS_START,
! 	    SCSI_AUTOCONF | SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_MEDIA_CHANGE | SCSI_SILENT) ||
  	    sd_get_parms(sd, SCSI_AUTOCONF) != 0)
  		printf("drive offline\n");
  	else
--- 199,206 ----
  	 */
  	printf("\n");
  	printf("%s: ", sd->sc_dev.dv_xname);
! 	if (/* scsi_start(sd->sc_link, SSS_START,
! 	    SCSI_AUTOCONF | SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_MEDIA_CHANGE | SCSI_SILENT) || */
  	    sd_get_parms(sd, SCSI_AUTOCONF) != 0)
  		printf("drive offline\n");
  	else
***************
*** 294,304 ****
--- 294,306 ----
  			goto bad3;
  
  		/* Start the pack spinning if necessary. */
+ 		/*
  		error = scsi_start(sc_link, SSS_START,
  				   SCSI_IGNORE_ILLEGAL_REQUEST |
  				   SCSI_IGNORE_MEDIA_CHANGE | SCSI_SILENT);
  		if (error)
  			goto bad3;
+ 		*/
  
  		sc_link->flags |= SDEV_OPEN;