Subject: kern/24915: SCSI changers and disabled block descriptors
To: None <gnats-bugs@gnats.netbsd.org>
From: None <chris@cjones.org>
List: netbsd-bugs
Date: 03/25/2004 15:06:55
>Number:         24915
>Category:       kern
>Synopsis:       SCSI changers and disabled block descriptors
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 25 22:07:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Chris Jones
>Release:        NetBSD 1.6.1_STABLE
>Organization:
chris@mt.sri.com -----------------------------------------------------
Chris Jones                                    SRI International, Inc.
www.mt.sri.com                                             www.sri.com
>Environment:
	
	
System: NetBSD legolas.mt.sri.com 1.6.1_STABLE NetBSD 1.6.1_STABLE (LEGOLAS) #5: Thu Mar 25 14:52:01 MST 2004 chris@legolas.mt.sri.com:/usr/src/sys/arch/i386/compile/LEGOLAS i386
Architecture: i386
Machine: i386
>Description:
I have a CDL1100, which is a SCSI CDROM changer device:

ch0 at scsibus0 target 1 lun 0: <SONY, CDL1100, 1.12> SCSI2 8/changer removable
ch0: 100 slots, 2 drives, 1 picker, 1 portal

On a stock kernel, it doesn't probe successfully; ch.c is unable to
read the element address page.  There's a comment in ch.c which reads:

XXX: Note: not all changers can deal with disabled block descriptors

And, in fact, this is the problem with my CDL1100.  The enclosed patch
makes it work.  I have little understanding of SCSI internals, so I
don't know what a block descriptor is, or what other devices this
patch might break.
>How-To-Repeat:
	
>Fix:
Index: ch.c
===================================================================
RCS file: /cvsroot/src/sys/dev/scsipi/ch.c,v
retrieving revision 1.49
diff -u -w -r1.49 ch.c
--- ch.c	6 May 2002 13:43:57 -0000	1.49
+++ ch.c	25 Mar 2004 22:00:52 -0000
@@ -1162,7 +1162,7 @@
 	 * Grab info from the element address assignment page.
 	 */
 	memset(&sense_data, 0, sizeof(sense_data));
-	error = scsipi_mode_sense(sc->sc_periph, SMS_DBD, 0x1d,
+	error = scsipi_mode_sense(sc->sc_periph, 0, 0x1d,
 	    &sense_data.header, sizeof(sense_data),
 	    scsiflags | XS_CTL_DATA_ONSTACK, CHRETRIES, 6000);
 	if (error) {
@@ -1189,7 +1189,7 @@
 	/*
 	 * XXX: Note: not all changers can deal with disabled block descriptors
 	 */
-	error = scsipi_mode_sense(sc->sc_periph, SMS_DBD, 0x1f,
+	error = scsipi_mode_sense(sc->sc_periph, 0, 0x1f,
 	    &sense_data.header, sizeof(sense_data),
 	    scsiflags | XS_CTL_DATA_ONSTACK, CHRETRIES, 6000);
 	if (error) {
>Release-Note:
>Audit-Trail:
>Unformatted: