Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Dec 2002 03:09:43 -0500 (EST)
From:      Tim Vanderhoek <vanderh@ecf.toronto.edu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/46369: umass.c and scsi_da.c quirks for Pentax Optio digital camera
Message-ID:  <200212190809.gBJ89hMu002440@localhost.nowhere>

next in thread | raw e-mail | index | archive | help

>Number:         46369
>Category:       kern
>Synopsis:       umass.c and scsi_da.c quirks for Pentax Optio digital camera
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 19 00:10:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Tim Vanderhoek
>Release:        FreeBSD 4.7-STABLE i386
>Organization:
FreeBSD
>Environment:
System: FreeBSD turquoise 4.7-STABLE FreeBSD 4.7-STABLE #16: Thu Dec 19 02:35:18 EST 2002 tim@turquoise:/usr/src/sys/compile/TURQUOISE i386


>Description:

Note that these -stable sources are current as of today (Dec 19/18).

The Pentax Optio 230 camera doesn't want to work with FreeBSD.  I've
cut'n'pasted USB debug output under various options further below.

I got this thing to work by (hehe) mostly combining random lines
from other special cases.  I've given the minimum set of changes that
seem to be necessary for the camera to work in the Fix: section.

I had to change both umass.c and scsi_da.c to get this to work.  I'll
give this PR to njl first for the scsi_da.c changes.  Someone (other
than me) should look over the umass.c change too, please.

The product code of the Optio 230 appears to be 0x04, in case the
umass.c change should be made specific to the Optio 230.

Dec 19, failed output, virgin sources:

[attach]
umass0: Asahi Optical Co.,Ltd. PENTAX OPTIO 230, rev 1.10/1.00, addr 2
[... waiting ... disconnect camera since nothing's happening ...]
umass0: CBI reset failed, IOERROR
umass0: CBI bulk-in stall clear failed, IOERROR
umass0: CBI bulk-out stall clear failed, IOERROR
umass0: CBI reset failed, IOERROR
umass0: CBI bulk-in stall clear failed, IOERROR
umass0: CBI bulk-out stall clear failed, IOERROR
umass0: CBI reset failed, IOERROR
umass0: CBI bulk-in stall clear failed, IOERROR
umass0: CBI bulk-out stall clear failed, IOERROR
umass0: CBI reset failed, IOERROR
umass0: CBI bulk-in stall clear failed, IOERROR
umass0: CBI bulk-out stall clear failed, IOERROR
umass0: CBI reset failed, IOERROR
umass0: CBI bulk-in stall clear failed, IOERROR
umass0: CBI bulk-out stall clear failed, IOERROR
umass0: at uhub0 port 1 (addr 2) disconnected
umass0: detached


Add in the DA_Q_NO_6_BYTE and DA_Q_NO_SYNC_CACHE quirks in scsi_da.c
and add RS_NO_CLEAR_UA to umass.c and the camera works.  Now, remove
each of these and cut'n'paste the debug output:

--------------------------------------------------------------------
Dec 19, here is the output when the DA_Q_NO_6_BYTE quirk is removed
from scsi_da.c:

umass0: Asahi Optical Co.,Ltd. PENTAX OPTIO 230, rev 1.10/1.00, addr 2, 8070i (ATAPI) over CBI
umass0:2:0:-1: Attached to scbus2 as device 0
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <PENTAX DIGITAL_CAMERA 1.00> Removable Direct Access SCSI-0 device
da0: 150KB/s transfers
da0: 245MB (501761 512 byte sectors: 64H 32S/T 245C)
umass0: Unsupported ATAPI command 0x08, 6 byte command should have been converted
da0: reading primary partition table: error reading fsbn 0
turquoise# ls /pentax
turquoise# mount /pentax
umass0: Unsupported ATAPI command 0x08, 6 byte command should have been converte
d
da0: reading primary partition table: error reading fsbn 0
msdos: /dev/da0s1: Input/output error


--------------------------------------------------------------------
Dec 19, Without the DA_Q_NO_SYNC_CACHE; the only noticeable problem is
when I unmount the camera.  Nothing terrible happens when
DA_Q_NO_SYNC_CACHE is omitted.

turqoise# umount /pentax
umass0: Unsupported ATAPI command 0x35
(da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x6, scsi status ==
0x0


--------------------------------------------------------------------
Dec 19, Without the RS_NO_CLEAR_UA in umass.c:

umass0: Asahi Optical Co.,Ltd. PENTAX OPTIO 230, rev 1.10/1.00, addr
2, 8070i (ATAPI) over CBI
umass0:2:0:-1: Attached to scbus2 as device 0
[... waiting ... forcefully disconnect camera (ie, pull the plug since 
     refuses to disconnect in any other way) ...]
umass0: CBI reset failed, IOERROR
umass0: CBI bulk-in stall clear failed, IOERROR
umass0: CBI bulk-out stall clear failed, IOERROR
umass0: at uhub0 port 1 (addr 2) disconnected
umass0: detached



--------------------------------------------------------------------
Dec 19, Successful output:

umass0: Asahi Optical Co.,Ltd. PENTAX OPTIO 230, rev 1.10/1.00, addr
2, 8070i (ATAPI) over CBI
umass0:2:0:-1: Attached to scbus2 as device 0
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <PENTAX DIGITAL_CAMERA 1.00> Removable Direct Access SCSI-0 device
da0: 150KB/s transfers
da0: 245MB (501761 512 byte sectors: 64H 32S/T 245C)
umass0: at uhub0 port 1 (addr 2) disconnected
(da0:umass-sim0:0:0:0): lost device
(da0:umass-sim0:0:0:0): removing device entry
umass0: detached


>How-To-Repeat:

>Fix:


--- ~umass.c	Thu Dec 19 02:58:21 2002
+++ umass.c	Thu Dec 19 02:58:39 2002
@@ -600,20 +600,28 @@
 	}
 
 	if (UGETW(dd->idVendor) == USB_VENDOR_INSYSTEM
 	    && UGETW(dd->idProduct) == USB_PRODUCT_INSYSTEM_USBCABLE) {
 		sc->drive = INSYSTEM_USBCABLE;
 		sc->proto = UMASS_PROTO_ATAPI | UMASS_PROTO_CBI;
 		sc->quirks |= NO_TEST_UNIT_READY | NO_START_STOP;
 		return(UMATCH_VENDOR_PRODUCT);
 	}
 
+	if (UGETW(dd->idVendor) == USB_VENDOR_ASAHIOPTICAL) {
+		/* The Pentax Optio 230 digital camera doesn't seem
+		 * to work without RS_NO_CLEAR_UA.  Probably applies to
+		 * Pentax's other digital camera offerings, too.
+		 */
+		sc->quirks |= RS_NO_CLEAR_UA;
+	}
+
 	if (UGETW(dd->idVendor) == USB_VENDOR_FUJIPHOTO
 	    && UGETW(dd->idProduct) == USB_PRODUCT_FUJIPHOTO_MASS0100) {
 		sc->quirks |= RS_NO_CLEAR_UA;
 	}
 
 	if (UGETW(dd->idVendor) == USB_VENDOR_YEDATA
 	    && UGETW(dd->idProduct) == USB_PRODUCT_YEDATA_FLASHBUSTERU) {
 
 		/* Revisions < 1.28 do not handle the inerrupt endpoint
 		 * very well.



--- ~scsi_da.c	Thu Dec 19 02:59:50 2002
+++ scsi_da.c	Thu Dec 19 03:06:19 2002
@@ -238,12 +238,21 @@
 		/* Another USB floppy */
 		{T_DIRECT, SIP_MEDIA_REMOVABLE, "MATSHITA", "FDD CF-VFDU*","*"},
 		/*quirks*/ DA_Q_NO_6_BYTE|DA_Q_NO_SYNC_CACHE
 	},
 	{
 		/*
+		 * Pentax Optio 230 digital camera, and presumably
+		 * the other Pentax Optio cameras.
+		 */
+		{T_DIRECT, SIP_MEDIA_REMOVABLE,
+		    "PENTAX", "DIGITAL_CAMERA", "*"},
+		/*quirks*/ DA_Q_NO_6_BYTE|DA_Q_NO_SYNC_CACHE
+	},
+	{
+		/*
 		 * Sony Memory Stick adapter MSAC-US1 and
 		 * Sony PCG-C1VJ Internal Memory Stick Slot (MSC-U01).
 		 * Make all sony MS* products use this quirk.
 		 */
 		{T_DIRECT, SIP_MEDIA_REMOVABLE, "Sony", "MS*", "*"},
 		/*quirks*/ DA_Q_NO_6_BYTE|DA_Q_NO_SYNC_CACHE
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200212190809.gBJ89hMu002440>