From owner-freebsd-bugs Thu Dec 19 0:10: 8 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B4AD37B401 for ; Thu, 19 Dec 2002 00:10:03 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 615C643ED4 for ; Thu, 19 Dec 2002 00:10:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id gBJ8A2x3061997 for ; Thu, 19 Dec 2002 00:10:02 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id gBJ8A2bK061996; Thu, 19 Dec 2002 00:10:02 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 20EA037B401 for ; Thu, 19 Dec 2002 00:09:46 -0800 (PST) Received: from tomts10-srv.bellnexxia.net (tomts10.bellnexxia.net [209.226.175.54]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3436943EA9 for ; Thu, 19 Dec 2002 00:09:45 -0800 (PST) (envelope-from t.vanderhoek@utoronto.ca) Received: from localhost.nowhere ([64.231.121.110]) by tomts10-srv.bellnexxia.net (InterMail vM.5.01.04.19 201-253-122-122-119-20020516) with ESMTP id <20021219080944.IFMZ13717.tomts10-srv.bellnexxia.net@localhost.nowhere> for ; Thu, 19 Dec 2002 03:09:44 -0500 Received: from localhost.nowhere (localhost [127.0.0.1]) by localhost.nowhere (8.12.6/8.12.5) with ESMTP id gBJ89iP1002441 for ; Thu, 19 Dec 2002 03:09:44 -0500 (EST) (envelope-from tim@localhost.nowhere) Received: (from tim@localhost) by localhost.nowhere (8.12.6/8.12.5/Submit) id gBJ89hMu002440; Thu, 19 Dec 2002 03:09:43 -0500 (EST) Message-Id: <200212190809.gBJ89hMu002440@localhost.nowhere> Date: Thu, 19 Dec 2002 03:09:43 -0500 (EST) From: Tim Vanderhoek Reply-To: Tim Vanderhoek To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/46369: umass.c and scsi_da.c quirks for Pentax Optio digital camera Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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: 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: 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