From gcr@w10.sac.fedex.com  Mon Mar  1 14:22:21 2004
Return-Path: <gcr@w10.sac.fedex.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id ABEE316A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  1 Mar 2004 14:22:21 -0800 (PST)
Received: from mx15.sac.fedex.com (mx15.sac.fedex.com [199.81.195.17])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 3B4AF43D39
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  1 Mar 2004 14:22:17 -0800 (PST)
	(envelope-from gcr@w10.sac.fedex.com)
Received: from ex14.fw.fedex.com (mx14.sac.fedex.com [199.82.159.12])
	by mx15.sac.fedex.com (8.12.9p2/8.12.9) with ESMTP id i21MMFGd045993
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 1 Mar 2004 16:22:15 -0600 (CST)
	(envelope-from gcr@w10.sac.fedex.com)
Received: from mx14.sac.fedex.com(199.82.159.12) by ex14.fw.fedex.com via csmap 
	 id 12277; Mon, 01 Mar 2004 17:24:20 -0600 (CST)
Received: from w10.sac.fedex.com (root@w10.sac.fedex.com [161.135.204.136])
	by mx14.sac.fedex.com (8.12.9p2/8.12.9) with ESMTP id i21MMFo8087480
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 1 Mar 2004 16:22:15 -0600 (CST)
	(envelope-from gcr@w10.sac.fedex.com)
Received: from w10.sac.fedex.com (gcr@localhost [127.0.0.1])
	by w10.sac.fedex.com (8.12.10/8.12.10) with ESMTP id i21MMERN001915;
	Mon, 1 Mar 2004 16:22:14 -0600 (CST)
	(envelope-from gcr@w10.sac.fedex.com)
Received: (from gcr@localhost)
	by w10.sac.fedex.com (8.12.10/8.12.10/Submit) id i21MME2W001914;
	Mon, 1 Mar 2004 16:22:14 -0600 (CST)
	(envelope-from gcr)
Message-Id: <200403012222.i21MME2W001914@w10.sac.fedex.com>
Date: Mon, 1 Mar 2004 16:22:14 -0600 (CST)
From: Greg Rivers <gcr@sa.fedex.com>
To: FreeBSD-gnats-submit@freebsd.org
Subject: Add support for SimpleTech UCF-100 USB CompactFlash reader [PATCH]
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         63619
>Category:       kern
>Synopsis:       Add support for SimpleTech UCF-100 USB CompactFlash reader [PATCH]
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 01 14:30:15 PST 2004
>Closed-Date:    Sun Jun 13 07:46:39 GMT 2004
>Last-Modified:  Sun Jun 13 07:46:39 GMT 2004
>Originator:     Greg Rivers
>Release:        FreeBSD 5.2.1-RELEASE i386
>Organization:
FedEx Internet Operations
>Environment:
System: FreeBSD w10.sac.fedex.com 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #0: Sat Feb 28 22:42:34 CST 2004 root@w10.sac.fedex.com:/usr/src/sys/i386/compile/W10 i386


>Description:
	The SimpleTech UCF-100 USB CompactFlash reader
	(http://www.simpletech.com/parts/sti_ucf100.htm) does not work.
	Attaching it wedges the machine.

	These patches make it usable, if not fully functional.


>How-To-Repeat:
	Plug the device in.  Errors are generated as follows:

	kernel: umass0: USB Mass Storage, rev 1.10/1.13, addr 2
	kernel: umass0: Get Max Lun not supported (STALLED)
	kernel: umass0: BBB reset failed, STALLED
	kernel: umass0: BBB bulk-in clear stall failed, STALLED
	kernel: umass0: BBB bulk-out clear stall failed, STALLED
	kernel: umass0: BBB reset failed, STALLED
	kernel: umass0: BBB bulk-in clear stall failed, STALLED
	kernel: umass0: BBB bulk-out clear stall failed, STALLED
	kernel: umass0: BBB reset failed, STALLED
	kernel: umass0: BBB bulk-in clear stall failed, STALLED
	kernel: umass0: BBB bulk-out clear stall failed, STALLED
	kernel: umass0: BBB reset failed, STALLED
	kernel: umass0: BBB bulk-in clear stall failed, STALLED
	kernel: umass0: BBB bulk-out clear stall failed, STALLED
	kernel: umass0: BBB reset failed, STALLED
	kernel: umass0: BBB bulk-in clear stall failed, STALLED
	kernel: umass0: BBB bulk-out clear stall failed, STALLED
	kernel: umass0: BBB reset failed, STALLED
	kernel: umass0: BBB bulk-in clear stall failed, STALLED
	kernel: umass0: BBB bulk-out clear stall failed, STALLED
	kernel: GEOM: create disk da0 dp=0xc2e0c450
	kernel: umass0: BBB reset failed, STALLED
	kernel: umass0: BBB bulk-in clear stall failed, STALLED
	kernel: umass0: BBB bulk-out clear stall failed, STALLED
	kernel: umass0: BBB reset failed, STALLED
	kernel: umass0: BBB bulk-in clear stall failed, STALLED
	kernel: umass0: BBB bulk-out clear stall failed, STALLED
	kernel: umass0: BBB reset failed, STALLED
	kernel: umass0: BBB bulk-in clear stall failed, STALLED
	kernel: umass0: BBB bulk-out clear stall failed, STALLED
	kernel: umass0: BBB reset failed, STALLED
	kernel: umass0: BBB bulk-in clear stall failed, STALLED
	kernel: umass0: BBB bulk-out clear stall failed, STALLED
	kernel: umass0: BBB reset failed, STALLED
	kernel: umass0: BBB bulk-in clear stall failed, STALLED
	kernel: umass0: BBB bulk-out clear stall failed, STALLED
	kernel: (da0:umass-sim0:0:0:0): got CAM status 0x4
	kernel: (da0:umass-sim0:0:0:0): fatal error, failed to attach to device
	kernel: (da0:umass-sim0:0:0:0): lost device
	kernel: umass0: BBB reset failed, STALLED
	kernel: umass0: BBB bulk-in clear stall failed, STALLED
	kernel: umass0: BBB bulk-out clear stall failed, STALLED
	kernel: umass0: BBB reset failed, STALLED
	kernel: umass0: BBB bulk-in clear stall failed, STALLED
	kernel: umass0: BBB bulk-out clear stall failed, STALLED
	kernel: umass0: BBB reset failed, STALLED
	kernel: umass0: BBB bulk-in clear stall failed, STALLED
	kernel: umass0: BBB bulk-out clear stall failed, STALLED
	kernel: umass0: BBB reset failed, STALLED
	kernel: umass0: BBB bulk-in clear stall failed, STALLED
	kernel: umass0: BBB bulk-out clear stall failed, STALLED
	kernel: umass0: BBB reset failed, STALLED
	kernel: umass0: BBB bulk-in clear stall failed, STALLED
	kernel: umass0: BBB bulk-out clear stall failed, STALLED
	kernel: (da0:umass-sim0:0:0:0): removing device entry
	kernel: GEOM: destroy disk da0 dp=0xc2e0c450
	kernel: umass0: at uhub0 port 1 (addr 2) disconnected
	kernel: umass0: detached

	[ machine wedges ]

	syslogd: kernel boot file is /boot/kernel/kernel
	kernel: Copyright (c) 1992-2004 The FreeBSD Project.
	kernel: Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	kernel: The Regents of the University of California. All rights reserved.
	kernel: FreeBSD 5.2.1-RELEASE #0: Wed Feb 25 21:16:35 CST 2004
	...


>Fix:

Apply the following patches to usbdevs and umass.c in /usr/src/sys/dev/usb/:

------------------------------------- cut --------------------------------------
--- usbdevs	2004/02/25 23:07:42	1.1
+++ usbdevs	2004/02/26 19:15:35	1.2
@@ -271,6 +271,7 @@
 vendor MICROTECH	0x07af	Microtech
 vendor GENERALINSTMNTS	0x07b2	General Instruments (Motorola)
 vendor OLYMPUS		0x07b4	Olympus
+vendor SIMPLETECH	0x07c4	SimpleTech
 vendor ABOCOM		0x07b8	AboCom Systems
 vendor KEISOKUGIKEN	0x07c1	Keisokugiken
 vendor APG		0x07c5	APG Cash Drawer
@@ -1100,6 +1101,9 @@
 /* Silicon Portals Inc. */
 product SILICONPORTALS YAPPH_NF	0x0200	YAP Phone (no firmware)
 product SILICONPORTALS YAPPHONE	0x0201	YAP Phone
+
+/* SimpleTech products */
+product SIMPLETECH UCF100	0xa400	FlashLink UCF-100 CompactFlash Reader
 
 /* Sirius Technologies products */
 product SIRIUS ROADSTER		0x0001	NetComm Roadster II 56 USB
------------------------------------- cut --------------------------------------

------------------------------------- cut --------------------------------------
--- umass.c	2004/02/25 23:09:55	1.1
+++ umass.c	2004/02/26 19:15:35	1.2
@@ -386,6 +386,10 @@
 	  UMASS_PROTO_ATAPI | UMASS_PROTO_CBI_I,
 	  FORCE_SHORT_INQUIRY
 	},
+	{ USB_VENDOR_SIMPLETECH, USB_PRODUCT_SIMPLETECH_UCF100, RID_WILDCARD,
+          UMASS_PROTO_ATAPI | UMASS_PROTO_BBB,
+	  NO_INQUIRY | NO_GETMAXLUN
+	},
 	{ VID_EOT, PID_EOT, RID_EOT, 0, 0 }
 };
 

------------------------------------- cut --------------------------------------


With the above patches in place, the device attaches and can be used for
DOS file systems.  However, attempting to use UFS, or write blocks bigger
than 16k (eg. with dd) results in SCSI errors and an eventual hang.
I don't know how to tell whether this is due to a problem with the device,
or with the SCSI/CAM driver.  But it shouldn't hang the machine in any
case.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: sanpei 
State-Changed-When: Wed Mar 3 22:46:10 PST 2004 
State-Changed-Why:  
I will commit this changes 

http://www.freebsd.org/cgi/query-pr.cgi?pr=63619 
State-Changed-From-To: analyzed->patched 
State-Changed-By: sanpei 
State-Changed-When: Wed Mar 3 23:54:18 PST 2004 
State-Changed-Why:  
Commited, Thanks.I will MFC. 

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

From: Greg Rivers <gcr@sa.fedex.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/63619: Add support for SimpleTech UCF-100 USB CompactFlash reader [PATCH]
Date: Thu, 4 Mar 2004 09:33:20 -0600

 Thanks for commiting the changes.  The device is fully functional with them.  
 I can no longer reproduce the SCSI errors with large block sizes; it works 
 fine now.  I think the USB interface was in a bad state, and a power cycle 
 cleared it.
 -- 
 Greg Rivers
 
State-Changed-From-To: patched->closed 
State-Changed-By: sanpei 
State-Changed-When: Sun Jun 13 07:46:17 GMT 2004 
State-Changed-Why:  
I forgot close this PR. 

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