From gnb@itga.com.au  Mon May  5 19:31:19 2003
Return-Path: <gnb@itga.com.au>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id DA88237B401
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  5 May 2003 19:31:19 -0700 (PDT)
Received: from ns1.itga.com.au (ns1.itga.com.au [202.53.40.214])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 5BC1643F3F
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  5 May 2003 19:31:18 -0700 (PDT)
	(envelope-from gnb@itga.com.au)
Received: from lightning.itga.com.au (lightning.itga.com.au [192.168.71.20])
	by ns1.itga.com.au (8.12.9/8.12.9) with ESMTP id h462VGm2062075
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 6 May 2003 12:31:16 +1000 (EST)
	(envelope-from gnb@itga.com.au)
Received: from hellcat.itga.com.au (hellcat.itga.com.au [10.132.2.163])
	by lightning.itga.com.au (8.9.3/8.9.3) with ESMTP id MAA11276;
	Tue, 6 May 2003 12:31:16 +1000 (EST)
Received: from hellcat.itga.com.au (localhost [127.0.0.1])
	by hellcat.itga.com.au (8.12.9/8.12.9) with ESMTP id h462VGFu000634
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 6 May 2003 12:31:16 +1000 (EST)
	(envelope-from gnb@hellcat.itga.com.au)
Received: (from gnb@localhost)
	by hellcat.itga.com.au (8.12.9/8.12.9/Submit) id h462VGPa000633;
	Tue, 6 May 2003 12:31:16 +1000 (EST)
Message-Id: <200305060231.h462VGPa000633@hellcat.itga.com.au>
Date: Tue, 6 May 2003 12:31:16 +1000 (EST)
From: Gregory Bond <gnb@itga.com.au>
Reply-To: Gregory Bond <gnb@itga.com.au>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: QUIRK: OTi USB Flash Memory keyring
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         51825
>Category:       kern
>Synopsis:       QUIRK: OTi USB Flash Memory keyring
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    njl
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 05 19:40:05 PDT 2003
>Closed-Date:    Sat May 17 15:00:57 PDT 2003
>Last-Modified:  Sat May 17 15:00:57 PDT 2003
>Originator:     Gregory Bond
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
ITG Australia Limited
>Environment:
System: FreeBSD hellcat.itga.com.au 4.8-STABLE FreeBSD 4.8-STABLE #10: Tue May 6 12:05:40 EST 2003 toor@grollo.itga.com.au:/usr/obj/usr/src/sys/HELLCAT i386


>Description:

OTi USB Flash keyring needs NO_6_BYTE quirk.  Symptoms w/o the quirk
are long hang (> 30 sec) when trying to access, then an error when
attempting to read.
	da0: reading primary partition table: error reading fsbn 0

What clued me in was, sometimes, after several tries at reading, I got
the following message:
	(da0:umass-sim0:0:0:0): READ(6)/WRITE(6) not supported, increasing minimum_cmd_size to 10.

I don't know why the auto 10-byte fallback wasn't kicking in earlier
or more reliably; I'm happy to run some tests if anyone can tell me
what to do.

>How-To-Repeat:

Plug in an OTi USB flash disk.  Attempt to mount it.

umass0: USB Solid state disk, rev 1.10/1.00, addr 2
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <OTi Flash Disk 1.11> Removable Direct Access SCSI-2 device 
da0: 650KB/s transfers
da0: 63MB (129024 512 byte sectors: 64H 32S/T 63C)
da0: reading primary partition table: error reading fsbn 0

hellcat# camcontrol inquiry da0
pass0: <OTi Flash Disk 1.11> Removable Direct Access SCSI-2 device 
pass0: Serial Number 
pass0: 650KB/s transfers 
hellcat# usbdevs -v
Controller /dev/usb0:
addr 1: self powered, config 1, UHCI root hub(0x0000), Intel(0x0000), rev 1.00
 port 1 powered
 port 2 powered
Controller /dev/usb1:
addr 1: self powered, config 1, UHCI root hub(0x0000), Intel(0x0000), rev 1.00
 port 1 addr 2: power 100 mA, config 1, Solid state disk(0x6803), USB(0x0ea0), rev 1.00
 port 2 powered
hellcat# 

>Fix:


--- OTi-quirk begins here ---
Index: sys/cam/scsi/scsi_da.c
===================================================================
RCS file: /usr/ncvs/src/sys/cam/scsi/scsi_da.c,v
retrieving revision 1.42.2.34
diff -u -r1.42.2.34 scsi_da.c
--- sys/cam/scsi/scsi_da.c	27 Apr 2003 20:05:11 -0000	1.42.2.34
+++ sys/cam/scsi/scsi_da.c	6 May 2003 02:05:24 -0000
@@ -426,6 +426,13 @@
 	},
 	{
 		/*
+		 * OTi USB Key-Storage
+		 */
+		{T_DIRECT, SIP_MEDIA_REMOVABLE, "OTi", "Flash Disk", "*"},
+		/*quirks*/ DA_Q_NO_6_BYTE
+	},
+	{
+		/*
 		 * Lexar Media Jumpdrive
 		 * PR: kern/47006
 		 */
--- OTi-quirk ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->njl 
Responsible-Changed-By: johan 
Responsible-Changed-When: Tue May 6 12:21:46 PDT 2003 
Responsible-Changed-Why:  
Over to quirks maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=51825 
State-Changed-From-To: open->analyzed 
State-Changed-By: njl 
State-Changed-When: Wed May 14 16:32:13 PDT 2003 
State-Changed-Why:  

Looks good.  I'm going to commit this soon. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=51825 
State-Changed-From-To: analyzed->closed 
State-Changed-By: njl 
State-Changed-When: Sat May 17 15:00:25 PDT 2003 
State-Changed-Why:  

Quirk has been committed and MFCd.  It is in 5.1R and 4-stable. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=51825 
>Unformatted:
