NetBSD Problem Report #24915
Received: (qmail 6416 invoked by uid 605); 25 Mar 2004 22:06:58 -0000
Message-Id: <200403252206.i2PM6tF00496@legolas.mt.sri.com>
Date: Thu, 25 Mar 2004 15:06:55 -0700 (MST)
From: chris@cjones.org
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: chris@netbsd.org
To: gnats-bugs@gnats.netbsd.org
Subject: SCSI changers and disabled block descriptors
X-Send-Pr-Version: 3.95
>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 +0000 2004
>Closed-Date:
>Last-Modified: Fri Apr 23 02:01:32 +0000 2004
>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:
From: "Charles M. Hannum" <abuse@spamalicious.com>
To: chris@cjones.org
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/24915: SCSI changers and disabled block descriptors
Date: Thu, 25 Mar 2004 22:35:12 +0000
It's a valid point, but your patch is *definitely* not sufficient. As with
the SCSI disk and CD-ROM code, you need to handle skipping past the block
descriptor(s) if any are returned; otherwise you could be looking at the
wrong data and really screw things up. (This was the source of almost all of
the weird-ass block size problems, in particular with umass devices, until I
fixed it.)
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.