Subject: kern/12479: don't send mode sense commands when SDEV_MODESENSE is defined
To: None <gnats-bugs@gnats.netbsd.org>
From: Brett McCoy <bmccoy@morte.piffle.net>
List: netbsd-bugs
Date: 03/26/2001 10:56:38
>Number: 12479
>Category: kern
>Synopsis: do not send mode sense commands when SDEV_MODESENSE is defined
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Mon Mar 26 07:57:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Brett McCoy
>Release: 2001-03-26
>Organization:
>Environment:
System: NetBSD morte 1.5T NetBSD 1.5T (MORTEfw) #57: Mon Mar 26 09:30:38 EST 2001 bmccoy@morte:/usr/src/sys/arch/i386/compile/MORTEfw i386
Architecture: i386
Machine: i386
>Description:
Even if the SDEV_NOMODESENSE quirk is set mode sense commands are
still sent to the device. The quirk only affects what happens if
the mode sense commands fail. I believe that setting the
SDEV_NOMODESENSE quirk should disable any attempts at sending
mode sense commands. This allows a UFI device which always
responds to a mode sense command with the maximum capacity to
be used (with the fictitious settings).
>How-To-Repeat:
>Fix:
Index: sd_scsi.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/scsipi/sd_scsi.c,v
retrieving revision 1.15
diff -u -r1.15 sd_scsi.c
--- sd_scsi.c 2000/06/09 08:54:28 1.15
+++ sd_scsi.c 2001/03/26 15:56:03
@@ -270,6 +270,9 @@
if (sd->type == T_OPTICAL)
return (sd_scsibus_get_optparms(sd, dp, flags));
+ if (link->quirks & SDEV_NOMODESENSE)
+ goto fake_it;
+
if ((error = sd_scsibus_mode_sense(sd, &scsipi_sense, page = 4,
flags)) == 0) {
SC_DEBUG(link, SDEV_DB3,
>Release-Note:
>Audit-Trail:
>Unformatted: