Subject: bin/25734: /sbin/scsictl has too short a timeout for start/stop commands
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <mhitch@netbsd.org>
List: netbsd-bugs
Date: 05/27/2004 19:03:11
>Number:         25734
>Category:       bin
>Synopsis:       /sbin/scsictl has too short a timeout for start/stop commands
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 28 01:03:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Michael L. Hitch
>Release:        NetBSD 2.0_BETA
>Organization:
	
>Environment:
	
	
System: NetBSD net3.msu.montana.edu 2.0_BETA NetBSD 2.0_BETA (GENERIC) #2: Wed May 26 22:54:17 MDT 2004 mhitch@neverland.msu.montana.edu:/usr/home/mhitch/NetBSD-2-0/OBJ/vax/sys/arch/vax/compile.vax/GENERIC vax
Architecture: vax
Machine: vax
>Description:
	The timeout value used for stop/start commands in /sbin/scsictl is 10
	seconds.  This is too short for some devices.  The timeout should be
	increased.
>How-To-Repeat:
	Connect an older drive (Seagate Barracuda for example:

	sd0 at scsibus0 target 0 lun 0: <SEAGATE, ST15150N, 9103> disk fixed

	Attempt to stop the drive:

	net3# time scsictl /dev/rsd0c stop
	sd0(asc0:0:0:0): asc0: timed out [ecb 0x80579000 (flags 0x101, dleft 0, stat 0)], <state 1, nexus 0x0, phase(l 10, c 100, p 7), resid 0, msg(q 0,o 0) >
	/dev/rsd0c: SCSI command timed out
	0.0u 0.0s 0:16.97 0.2% 0+0k 0+0io 1pf+0w
>Fix:
	Change the timeout for the start/stop commands to 20 or 30 seconds:


Index: sbin/scsictl/scsictl.c
===================================================================
RCS file: /cvsroot/src/sbin/scsictl/scsictl.c,v
retrieving revision 1.23
diff -u -r1.23 scsictl.c
--- sbin/scsictl/scsictl.c	5 Jan 2004 23:23:33 -0000	1.23
+++ sbin/scsictl/scsictl.c	27 May 2004 21:39:03 -0000
@@ -807,7 +807,7 @@
 	cmd.opcode = START_STOP;
 	cmd.how = SSS_START;
 
-	scsi_command(fd, &cmd, sizeof(cmd), NULL, 0, 10000, 0);
+	scsi_command(fd, &cmd, sizeof(cmd), NULL, 0, 30000, 0);
 
 	return;
 }
@@ -833,7 +833,7 @@
 	cmd.opcode = START_STOP;
 	cmd.how = SSS_STOP;
 
-	scsi_command(fd, &cmd, sizeof(cmd), NULL, 0, 10000, 0);
+	scsi_command(fd, &cmd, sizeof(cmd), NULL, 0, 30000, 0);
 
 	return;
 }
>Release-Note:
>Audit-Trail:
>Unformatted: