From dpelleg@cs.cmu.edu  Sun Mar  9 10:04:25 2003
Return-Path: <dpelleg@cs.cmu.edu>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 2594D37B404
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  9 Mar 2003 10:04:25 -0800 (PST)
Received: from gw.pelleg.org (gw.pelleg.org [205.201.13.235])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 1235043FBF
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  9 Mar 2003 10:04:24 -0800 (PST)
	(envelope-from dpelleg@cs.cmu.edu)
Received: from lank.auton.cs.cmu.edu (lank.wburn [192.168.3.41])
	(using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits))
	(Client CN "dpelleg.dsl.telerama.com", Issuer "Dan Pelleg" (verified OK))
	by gw.pelleg.org (Postfix) with ESMTP id 61EFB5A23
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  9 Mar 2003 13:04:22 -0500 (EST)
Received: by lank.auton.cs.cmu.edu (Postfix, from userid 7675)
	id C16AA804; Sun,  9 Mar 2003 13:04:23 -0500 (EST)
Message-Id: <20030309180423.C16AA804@lank.auton.cs.cmu.edu>
Date: Sun,  9 Mar 2003 13:04:23 -0500 (EST)
From: Dan Pelleg <daniel+gnats@pelleg.org>
Reply-To: Dan Pelleg <daniel+gnats@pelleg.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: QUIRK: SanDisk USB compact flash reader
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         49054
>Category:       kern
>Synopsis:       QUIRK: SanDisk USB compact flash reader
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    njl
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 09 10:10:13 PST 2003
>Closed-Date:    Sun Apr 27 12:56:36 PDT 2003
>Last-Modified:  Sun Apr 27 12:56:36 PDT 2003
>Originator:     Dan Pelleg
>Release:        FreeBSD 4.8-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD l 4.8-PRERELEASE FreeBSD 4.8-PRERELEASE #7: Sun Mar 9 12:34:22 EST 2003 d@l:/usr/scratch/obj/usr/src/sys/L i386

	
>Description:
 Quirks for a SanDisk ImageMate CF/SM card reader (only compact flash slot 
tested), model SDDR-75. This model is reported to be supported by umass(4),
but isn't really.


dmesg output:
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <SanDisk ImageMate CF-SM 0100> Removable Direct Access SCSI-0 device 
da0: 650KB/s transfers
da0: Attempt to query device size failed: NOT READY, Medium not present


Trying to mount it results in:
umass0: BBB reset failed, TIMEOUT
umass0: BBB bulk-in clear stall failed, TIMEOUT
umass0: BBB bulk-out clear stall failed, TIMEOUT

After adding the quirk, the dmesg output is still the same
(including the NOT READY line - note the CF media was inserted
at the time the reader was attached). However, now I can mount it,
and do file copies, so I assume it's harmless.


# camcontrol inquiry 0:0
pass0: <SanDisk ImageMate CF-SM 0100> Removable Direct Access SCSI-0 device 
pass0: Serial Number ~
pass0: 650KB/s transfers

# 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, ImageMate SDDR-75(0x0810), SanDisk Corp(0x0781), rev 1.00
 port 2 powered

(Note: this is after adding the usbdevs changes as in kern/49053 )

The email address daniel+gnats@pelleg.org is valid.

>How-To-Repeat:
>Fix:

--- sys/cam/scsi/scsi_da.c.orig	Sun Mar  9 08:31:16 2003
+++ sys/cam/scsi/scsi_da.c	Sun Mar  9 12:47:09 2003
@@ -283,6 +283,13 @@
 	},
 	{
 		/*
+		 * SanDisk USB ImageMate
+		 */
+		{T_DIRECT, SIP_MEDIA_REMOVABLE, "SanDisk", "ImageMate CF-*", "*"},
+		/*quirks*/ DA_Q_NO_6_BYTE
+	},
+	{
+		/*
 		 * The vendor, product and version strings coming from the
 		 * controller are null terminated instead of being padded with
 		 * spaces. The trailing wildcard character '*' is required.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->njl 
Responsible-Changed-By: dwmalone 
Responsible-Changed-When: Wed Mar 12 08:53:33 PST 2003 
Responsible-Changed-Why:  
Quirk for Nate. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=49054 
State-Changed-From-To: open->feedback 
State-Changed-By: njl 
State-Changed-When: Fri Mar 14 15:19:13 PST 2003 
State-Changed-Why:  

Please try the quirk committed to -current and -stable yesterday.  It matches 
ImageMate*. 

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

From: Nate Lawson <nate@root.org>
To: Dan Pelleg <daniel+gnats@pelleg.org>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: kern/49054: QUIRK: SanDisk USB compact flash reader
Date: Sun, 16 Mar 2003 20:11:16 -0800 (PST)

 Please use reply-all so gnats notes your replies.
 
 On Sat, 15 Mar 2003, Dan Pelleg wrote:
 > Nate Lawson writes:
 >  > Please try the quirk committed to -current and -stable yesterday.  It matches
 >  > ImageMate*.
 > 
 > That works, thanks! (tested only on -stable). I'm still getting
 > the error:
 > 
 > da0: Attempt to query device size failed: NOT READY, Medium not present
 > 
 > but other than that things work fine.
 
 I'm glad that it is working.  The error you see is likely because the USB
 chip has not fully initialized and powered up when it gets the SCSI
 probe.  Thus it responds "not ready".  dillon@ was working on adding a
 delay to the probe path.  I may revisit this problem in the future but as
 long as your drive works, I wouldn't worry about it.
 
 -Nate
 
State-Changed-From-To: feedback->closed 
State-Changed-By: njl 
State-Changed-When: Sun Apr 27 12:56:15 PDT 2003 
State-Changed-Why:  

Fix has been committed and MFCd. 

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