From nsayer@quack.kfu.com  Mon Jan  6 17:33:20 1997
Received: from quack.kfu.com (0@quack.kfu.com [204.147.226.1])
          by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id RAA19152
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 6 Jan 1997 17:33:18 -0800 (PST)
Received: from icarus.kfu.com (icarus.3do.com [198.211.30.57]) by quack.kfu.com (8.6.12/8.6.12) with ESMTP id RAA01262 for <FreeBSD-gnats-submit@freebsd.org>; Mon, 6 Jan 1997 17:33:14 -0800
Received: by icarus.kfu.com 
        (8.8.2//ident-1.0) id RAA00418; Mon, 6 Jan 1997 17:32:35 -0800 (PST) 
Message-Id: <199701070132.RAA00418@icarus.kfu.com>
Date: Mon, 6 Jan 1997 17:32:35 -0800 (PST)
From: nsayer@quack.kfu.com
Reply-To: nsayer@quack.kfu.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: start unit command screws up some CDROM drives.
X-Send-Pr-Version: 3.2

>Number:         2388
>Category:       kern
>Synopsis:       start unit command screws up some CDROM drives.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    joerg
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          support
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan  6 17:40:01 PST 1997
>Closed-Date:    Tue Oct 21 00:09:03 MEST 1997
>Last-Modified:  Tue Oct 21 00:09:57 MEST 1997
>Originator:     Nick Sayer
>Release:        FreeBSD 2.2-ALPHA i386
>Organization:
Just me
>Environment:


HP Omnibook 5000, amd SCSI controller

also duped on a P-Pro 200 w/ Adaptec 2940

>Description:

The SCSI CD driver will attempt to send a start-unit command on open
.
Some drives (for example, my Media Vision Reno) will hack and barf
if this happens.

>How-To-Repeat:

Any attempt to talk to the CD that results in an open will hang
or other such anti-social behavior.

>Fix:

The fix is to add a CDROM "quirk" that will disable the start unit
if a quirky CDROM is used. See the Reno entry.

diff -c scsi.o/cd.c scsi/cd.c
*** scsi.o/cd.c	Mon Jan  6 09:06:08 1997
--- scsi/cd.c	Mon Jan  6 09:07:02 1997
***************
*** 292,300 ****
  	 * not needed for some drives
  	 * failure here is ignored.
  	 */
! 	scsi_start_unit(sc_link, CD_START);
! 	scsi_prevent(sc_link, PR_PREVENT, SCSI_SILENT);
! 	SC_DEBUG(sc_link, SDEV_DB3, ("'start' attempted "));
  	/*
  	 * Load the physical device parameters
  	 */
--- 292,303 ----
  	 * not needed for some drives
  	 * failure here is ignored.
  	 */
! 	if (! (sc_link->quirks & CD_Q_NO_START) )
! 	{
! 		scsi_start_unit(sc_link, CD_START);
! 		scsi_prevent(sc_link, PR_PREVENT, SCSI_SILENT);
! 		SC_DEBUG(sc_link, SDEV_DB3, ("'start' attempted "));
! 	}
  	/*
  	 * Load the physical device parameters
  	 */
diff -c scsi.o/scsiconf.c scsi/scsiconf.c
*** scsi.o/scsiconf.c	Mon Jan  6 09:06:09 1997
--- scsi/scsiconf.c	Mon Jan  6 09:15:34 1997
***************
*** 352,357 ****
--- 352,361 ----
  		T_READONLY, T_READONLY, T_REMOV, "NEC",  "CD-ROM DRIVE:210","*",
  		"cd", SC_ONE_LU
  	},
+ 	{
+ 		T_READONLY, T_READONLY, T_REMOV, "MEDIAVIS",  "RENO CD-ROMX2A","*",
+ 		"cd", SC_ONE_LU, CD_Q_NO_START
+ 	},
  	/*
  	 * Doobe-doo-be doooo
  	 * -Mary
diff -c scsi.o/scsiconf.h scsi/scsiconf.h
*** scsi.o/scsiconf.h	Mon Jan  6 09:06:09 1997
--- scsi/scsiconf.h	Mon Jan  6 09:08:27 1997
***************
*** 275,280 ****
--- 275,281 ----
  
  /* cd specific CD_Q_* */
  #define CD_Q_NO_TOUCH		0x0001
+ #define CD_Q_NO_START		0x0002
  
  
  /*
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->joerg 
Responsible-Changed-By: mpp 
Responsible-Changed-When: Sun Feb 23 09:15:45 PST 1997 
Responsible-Changed-Why:  
Joerg said he would take this one. 
State-Changed-From-To: open->feedback 
State-Changed-By: joerg 
State-Changed-When: Sun Sep 7 17:06:14 MEST 1997 
State-Changed-Why:  

Things have been changing slightly in -current, so i had to apply a 
somewhat different patch.  Please verify that it's still doing what 
you want. 
State-Changed-From-To: feedback->closed 
State-Changed-By: joerg 
State-Changed-When: Tue Oct 21 00:09:03 MEST 1997 
State-Changed-Why:  

Nick doesn't have that drive anymore.  Let's assume everything's ok. 
>Unformatted:
