From james@now.ie  Tue Apr 23 04:38:05 2002
Return-Path: <james@now.ie>
Received: from mail.kerna.ie (ns.kerna.ie [194.106.143.66])
	by hub.freebsd.org (Postfix) with ESMTP id 23F6137B405
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 23 Apr 2002 04:38:00 -0700 (PDT)
Received: from ram.kerna.ie (ram.kerna.ie [194.106.143.99])
	by mail.kerna.ie (8.9.3/8.9.3) with ESMTP id MAA23562
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 23 Apr 2002 12:37:57 +0100 (BST)
Received: from bender.kerna.ie (bender.kerna.ie [192.168.42.133])
	by ram.kerna.ie (8.9.3/8.9.3) with ESMTP id MAA19444
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 23 Apr 2002 12:37:57 +0100
Received: (from james@localhost)
	by bender.kerna.ie (8.11.6/8.11.6) id g3NBcYp00699;
	Tue, 23 Apr 2002 12:38:34 +0100 (IST)
	(envelope-from james@now.ie)
Message-Id: <200204231138.g3NBcYp00699@bender.kerna.ie>
Date: Tue, 23 Apr 2002 12:38:34 +0100 (IST)
From: James Raftery <james@now.ie>
Reply-To: James Raftery <james@now.ie>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] No 6-byte-read on Wincan USB pen flash drive, needs quirk
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         37378
>Category:       kern
>Synopsis:       [PATCH] No 6-byte-read on Wincan USB pen flash drive, needs quirk
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    njl
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 23 04:40:01 PDT 2002
>Closed-Date:    Tue Oct 08 12:20:56 PDT 2002
>Last-Modified:  Tue Oct 08 12:20:56 PDT 2002
>Originator:     James Raftery
>Release:        FreeBSD 4.5-RELEASE-p4 i386
>Organization:
>Environment:
System: FreeBSD bender.kerna.ie 4.5-RELEASE-p4 FreeBSD 4.5-RELEASE-p4 #5: Tue Apr 23 11:30:53 IST 2002 james@bender.kerna.ie:/usr/obj/usr/src/sys/BENDER i386

Dell Optiplex GX110 with the following USB whatnots:

uhci0: <Intel 82801AA (ICH) USB controller> port 0xff80-0xff9f irq 11 at device 31.2 on pci0
usb0: <Intel 82801AA (ICH) USB controller> on uhci0
usb0: USB revision 1.0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered

and a Wincan (branded as ``Copera'') 64MB USB pen flash drive. Detected
as:

umass0: Wincan USB HDD, rev 1.00/1.00, addr 2
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <Wincan HARD DRIVE DISK 1.05> Removable Direct Access SCSI-0 device 
da0: 650KB/s transfers
da0: 62MB (128000 512 byte sectors: 64H 32S/T 62C)

Using the usb and umass kernel modules from RELENG_4_5.

>Description:

The USB drive is detected, as above, but any attempt to access da0
fails with:

/kernel: (da0:umass-sim0:0:0:0): READ(06). CDB: 8 0 0 0 1 0 
/kernel: (da0:umass-sim0:0:0:0): ILLEGAL REQUEST asc:20,0
/kernel: (da0:umass-sim0:0:0:0): Invalid command operation code
/kernel: da0: reading primary partition table: error reading fsbn 0

>How-To-Repeat:

Connect pen drive and try ``disklabel /dev/da0''.

>Fix:

A patch to /usr/src/sys/cam/scsi/scsi_da.c to add a quirk for this
device is below. It works for me on RELENG_4_5. The patch is against
scsi_da.c with RCS Id:

$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.42.2.20 2002/01/14 09:25:43 sobomax Exp $


--- scsi_da.c.patch begins here ---
--- scsi_da.c.orig	Thu Apr 18 17:18:04 2002
+++ scsi_da.c	Tue Apr 23 11:23:58 2002
@@ -262,6 +262,13 @@
 		{T_DIRECT, SIP_MEDIA_FIXED, "MAXTOR*", "K040H2*", "*"},
 		/*quirks*/ DA_Q_NO_6_BYTE
 	},
+        {
+		/*
+		 * Wincan USB Pen Drive
+		 */
+		{T_DIRECT, SIP_MEDIA_REMOVABLE, "Wincan", "HARD DRIVE*", "*"},
+		/*quirks*/ DA_Q_NO_6_BYTE
+	},
 	{
 		{T_OPTICAL, SIP_MEDIA_REMOVABLE, "FUJITSU", "MCF3064AP", "*"},
 		/*quirks*/ DA_Q_NO_6_BYTE
--- scsi_da.c.patch ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-scsi 
Responsible-Changed-By: johan 
Responsible-Changed-When: Tue Apr 23 14:11:51 PDT 2002 
Responsible-Changed-Why:  
Over to maintainer group. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37378 

From: Nate Lawson <nate@root.org>
To: freebsd-gnats-submit@FreeBSD.org, james@now.ie
Cc:  
Subject: Re: kern/37378: [PATCH] No 6-byte-read on Wincan USB pen flash drive,
 needs quirk
Date: Thu, 15 Aug 2002 16:31:42 -0700 (PDT)

 Please upgrade to 4.6R or -STABLE and let us know if you have more
 problems.  If you do, please send dmesg output.  Note:  "minimum_cmd_size
 is increased to 10" message is *not* an error.
 
 -Nate
 

From: James Raftery <james@now.ie>
To: Nate Lawson <nate@root.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/37378: [PATCH] No 6-byte-read on Wincan USB pen flash drive, needs quirk
Date: Fri, 16 Aug 2002 11:39:31 +0100

 Nate Lawson <nate@root.org> wrote:
 > Please upgrade to 4.6R or -STABLE and let us know if you have more
 > problems. If you do, please send dmesg output. Note: "minimum_cmd_size
 > is increased to 10" message is *not* an error.
 
 Hi,
 
 I actually went to RELENG_4_6 at home last weekend, with the intention
 of testing the READ(6)/WRITE(6) auto-detection code added to that
 branch.
 
 Unfortunately, my flash drive appears to have failed. When I get it
 working again (doesn't seem likely) or replaced I'll update this PR.
 
 Thanks,
 james
State-Changed-From-To: open->suspended 
State-Changed-By: njl 
State-Changed-When: Fri Aug 16 13:17:31 PDT 2002 
State-Changed-Why:  
Submitter can reopen this in the future once hardware is available for 
testing. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37378 
Responsible-Changed-From-To: freebsd-scsi->scsi 
Responsible-Changed-By: johan 
Responsible-Changed-When: Sat Aug 24 19:10:34 PDT 2002 
Responsible-Changed-Why:  
Use short names for mailing list to make searches    
using the web query form work with the shown responsible. 

This also makes open PRs show up in the summery mail. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=37378 
Responsible-Changed-From-To: scsi->njl 
Responsible-Changed-By: njl 
Responsible-Changed-When: Tue Oct 1 13:49:42 PDT 2002 
Responsible-Changed-Why:  

New quirk maintainer.  Please add any information that is missing 
(i.e. new/old dmesg, exact device info, etc.)  You can find all the 
needed information at: 
http://www.root.org/~nate/freebsd/quirks.html 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37378 

From: Nate Lawson <nate@root.org>
To: James Raftery <james@now.ie>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: kern/37378
Date: Wed, 2 Oct 2002 15:17:50 -0700 (PDT)

 If you are able to get the hw working and test it, let me know.  This PR
 will be closed in 2 weeks.
 
State-Changed-From-To: suspended->closed 
State-Changed-By: njl 
State-Changed-When: Tue Oct 8 12:19:07 PDT 2002 
State-Changed-Why:  
User has notified me that the hw is dead and can no longer test the fix that 
is in 4.6R+.  Since his equipment correctly responds with a check condition 
instead of hanging, I assume that the fix would work for it although there 
is no way to tell.  If another user has the same problem, they should open 
a new PR. 

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