From owner-freebsd-usb@FreeBSD.ORG Sun Dec 2 21:50:03 2007 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01FC416A474 for ; Sun, 2 Dec 2007 21:50:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D99A613C43E for ; Sun, 2 Dec 2007 21:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id lB2Lo2tl062253 for ; Sun, 2 Dec 2007 21:50:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id lB2Lo2xY062252; Sun, 2 Dec 2007 21:50:02 GMT (envelope-from gnats) Date: Sun, 2 Dec 2007 21:50:02 GMT Message-Id: <200712022150.lB2Lo2xY062252@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: Ben Kelly Cc: Subject: Re: usb/95173: [umass] [patch] cannot mount external usb harddisk VIA Technologies Inc. USB 2.0 IDE Bridge X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ben Kelly List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Dec 2007 21:50:03 -0000 The following reply was made to PR usb/95173; it has been noted by GNATS. From: Ben Kelly To: bug-followup@FreeBSD.org, diazepam@gmx.net Cc: Subject: Re: usb/95173: [umass] [patch] cannot mount external usb harddisk VIA Technologies Inc. USB 2.0 IDE Bridge Date: Sun, 02 Dec 2007 16:45:54 -0500 This is a multi-part message in MIME format. --------------010907000802070702090307 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I bought a Rocketfish external hard drive enclosure at Best Buy a couple weeks ago and ran into this same problem. I've streamlined James's patch and updated it for 7.0-BETA3. In addition, I modified it to fake a successful sync instead of returning an error. This avoids spamming logs with failure messages and also follows the precedent set by the NO_INQUIRY quirk. As far as I can tell, this has the same end effect as setting the DA_Q_NO_SYNC_CACHE quirk in the cam layer, so I believe it should be equally safe. --------------010907000802070702090307 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="via_umass.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="via_umass.patch" --- /usr/src/sys/dev/usb/umass.c 2007-07-05 05:26:08.000000000 +0000 +++ umass.c 2007-12-02 18:45:27.576058092 +0000 @@ -323,6 +323,12 @@ * sector number. */ # define READ_CAPACITY_OFFBY1 0x2000 + /* Device cannot handle a SCSI synchronize cache command. Normally + * this quirk would be handled in the cam layer, but for IDE bridges + * we need to associate the quirk with the bridge and not the + * underlying disk device. This is handled by faking a success result. + */ +# define NO_SYNCHRONIZE_CACHE 0x4000 }; static struct umass_devdescr_t umass_devdescrs[] = { @@ -804,6 +810,10 @@ UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_QUIRKS }, + { USB_VENDOR_VIA, USB_PRODUCT_VIA_USB2IDEBRIDGE, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + NO_SYNCHRONIZE_CACHE + }, { USB_VENDOR_VIVITAR, USB_PRODUCT_VIVITAR_35XX, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_INQUIRY @@ -2878,6 +2888,15 @@ xpt_done(ccb); return; } + if ((sc->quirks & NO_SYNCHRONIZE_CACHE) && + rcmd[0] == SYNCHRONIZE_CACHE) { + struct ccb_scsiio *csio = &ccb->csio; + + csio->scsi_status = SCSI_STATUS_OK; + ccb->ccb_h.status = CAM_REQ_CMP; + xpt_done(ccb); + return; + } if ((sc->quirks & FORCE_SHORT_INQUIRY) && rcmd[0] == INQUIRY) { csio->dxfer_len = SHORT_INQUIRY_LENGTH; --- /usr/src/sys/dev/usb/usbdevs 2007-11-28 06:10:16.000000000 +0000 +++ usbdevs 2007-12-02 18:44:39.873614696 +0000 @@ -2229,6 +2229,9 @@ /* U.S. Robotics products */ product USR USR5423 0x0121 USR5423 WLAN +/* VIA Technologies products */ +product VIA USB2IDEBRIDGE 0x6204 USB 2.0 IDE Bridge + /* VidzMedia products */ product VIDZMEDIA MONSTERTV 0x4fb1 MonsterTV P2H --------------010907000802070702090307--