Date: Sun, 2 Dec 2007 21:50:02 GMT From: Ben Kelly <bkelly@vadev.org> To: freebsd-usb@FreeBSD.org Subject: Re: usb/95173: [umass] [patch] cannot mount external usb harddisk VIA Technologies Inc. USB 2.0 IDE Bridge Message-ID: <200712022150.lB2Lo2xY062252@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR usb/95173; it has been noted by GNATS.
From: Ben Kelly <bkelly@vadev.org>
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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712022150.lB2Lo2xY062252>
