Subject: Re: SCSI problems, the sequel
To: None <>
From: John F. Woods <>
List: current-users
Date: 01/31/1994 11:51:48
randyt> cmd fail

randyt> if (sd_scsi_cmd(unit, (struct scsi_generic *)&scsi_cmd,
randyt> 	    sizeof(scsi_cmd), (u_char *)&scsi_sense, sizeof(scsi_sense),
randyt> 	    2000, flags) != 0) {
randyt> 		printf("could not mode sense (4) for unit %d\n", unit);
randyt> 		printf(" using ficticious geometry\n");
randyt> 		sectors = sd_size(unit, flags);

davidb>I notice you have an HP drive.  When using an HP97560 I found that unless I
davidb>jumpered it to auto-spinup then it refused to respond to the mode sense and
davidb>fell over at this point (although I don't recall a "cmd fail").  The SCSI
davidb>driver issues a START UNIT to the drive (and I know this works for DEC
davidb>drives) but the HP drive barfed before that point.

Hmm, what commands does the SCSI driver issue?  It shouldn't be issuing
MODE SENSE until the drive is spinning, because many drives read their
parameters from the media.  The logic should be something like

	if not ready,
		noodle until TEST UNIT READY reports that it is spinning
		(beware of odd status returns; the MXT1240S at microcode
		revision 1.5 will usually return a BUSY (08) status byte
		during this process if you hit it at just the right time,
		which the microcode update program I wrote to upgrade our
		drives from 1.2 to 1.5 managed to hit nearly every time...)
	MODE SENSE or whatever else.

No doubt there are some drives for which this sequence won't work (in
particular, I think Apple internal drives need to be configured to respond
OK to their first TEST UNIT READY, saving the not-spinning UNIT ATTENTION
until the first command that actually accesses the medium (that's what
Apple gets for coding to a standard before it's voted on...), though
Apple internal drives are also usually configured for auto-spinup anyway).