usb/91263: [patch] USB quirk needed for Logitec USB Hard disk LHD-EB250U2S

Jarrod O'Flaherty jofsama at yahoo.com
Tue Jan 3 00:50:04 PST 2006


>Number:         91263
>Category:       usb
>Synopsis:       [patch] USB quirk needed for Logitec USB Hard disk LHD-EB250U2S
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-usb
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 03 08:50:03 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Jarrod O'Flaherty
>Release:        6.0-RELEASE (patched & recompiled)
>Organization:
>Environment:
FreeBSD toshiba.happyatjamos.com 6.0-RELEASE FreeBSD 6.0-RELEASE #6: Tue Jan  3 12:16:16 JST 2006     

root at toshiba.happyatjamos.com:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
Hiya. I have a problem with a Logitec USB Hard Disk drive (LHD-EB250U2S) that appears identical to the problems concerning iPods detailed in PRs usb/81774 and usb/86438.

It was a bit of a hard task tracking down the issue, involving a move to NetBSD 2.1, which also failed, then NetBSD 3.0, which worked, then back to FreeBSD 6.0, where I downloaded the files related to PR usb/81774 and/or usb/86438 (file names and versions listed below), added a USB Quirk, and then compiled a custom kernel.

The cause of the problem with my Logitec HDD is apparently the usbd_clear_endpoint_stall() function call in usbd_setup_pipe() in the file /src/sys/dev/usb/usb_subr.c. 

To fix this problem I -- based on what I worked out from the changes to the USB package between NetBSD 2.1 and 3.0 -- downloaded the following files through FreeBSD's web CVS interface:-
usb_subr.c    v1.78
usb_quirks.h  v1.19
usb_quirks.c  v1.43
usbdevs       v1.236

I then added a USB quirk for my Logitec drive. The diff outputs to usbdevs and usb_quirks.c are given below under "Fix to the problem". 

Since I figure that some other users might also benefit from the quirk, I have (hopefully not wrongly) lodged a PR to capture the addition.

One difficulty is that Logitec (not Logitech, with a h) sells a range of disk drives here in Japan, all of which might potentially have the same issue. My series alone has 80GB, 160GB and 300GB versions in addition to the 250GB that I bought. It is not clear to me whether the device numbers are all different... I am guessing so though. The drives are detailed (in Japanese) on the following page:
http://www.logitec.co.jp/products/hd_lhd.html

It might be worth noting that according to Logitec's drivers' download page (given below) the following devices all have the same Windows and Mac driver:
LHD-EB300U2S , LHD-EB250U2S , LHD-EB160U2S , LHD-EB80U2S , LHD-EB300U2 , LHD-EB250U2 , LHD-EB160U2 , LHD-EB120U2 , LHD-EB80U2
Ref: http://www.logitec.co.jp/down/soft/hd/lhdebu2.html
(Note that to the best of my knowledge the final S on the first 4 units does not indicate a hardware difference but merely a promotional campaign where the purchaser is entitled to download a software title for free.)

This would lend (some) weight to the idea that they are all subject to the same issue with usbd_clear_endpoint_stall(). 

As an alternative to adding quirks I note that in NetBSD 3.0 they have deleted the function call usbd_clear_endpoint_stall() altogether. If this is not a violation of the USB spec, then perhaps this would be a possible solution for FreeBSD as well? 

If not, some kind of trace statement alerting users to the function call's failure might make it easier for them to detect the problem and thence add their own appropriate quirk. 

Cheers,
Jarrod.

>How-To-Repeat:
Plug in a Logitec USB Hard Disk (model LHD-EB250U2S in this case) and check your dmesg. The hard disk initialization does not complete properly and you are not able to mount it. (Presumably the same issue reported in PRs usb/81774 and usb/86438 on iPods.)
>Fix:
The patches I have applied are given below (taken from a diff -u and then cleaned up a bit ;) ):  


--- usbdevs.1.236	Mon Jan  2 11:56:06 2006
+++ usbdevs	Mon Jan  2 13:53:43 2006
@@ -1,5 +1,4 @@
-$FreeBSD: /repoman/r/ncvs/src/sys/dev/usb/usbdevs,v 1.236 2005/12/05 01:51:28 flz Exp $
+$FreeBSD: src/sys/dev/usb/usbdevs,v 1.236 2005/12/05 01:51:28 flz Exp $
 /* $NetBSD: usbdevs,v 1.392 2004/12/29 08:38:44 imp Exp $ */
 
 /*-
@@ -1117,6 +1116,7 @@
 /* Logitec Corp. products */
 product LOGITEC LDR_H443SU2     0x0033  DVD Multi-plus unit LDR-H443SU2
 product LOGITEC LDR_H443U2      0x00b3  DVD Multi-plus unit LDR-H443U2
+product LOGITEC LHD_EB250U2S    0x00d2  LHD USB Hard disk LHD-EB250U2S
 
 /* Lucent products */
 product LUCENT EVALKIT          0x1001  USS-720 evaluation kit



--- usb_quirks.c.1.43	Tue Jan  3 13:02:22 2006
+++ usb_quirks.c	Tue Jan  3 13:04:44 2006
@@ -38,8 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: /repoman/r/ncvs/src/sys/dev/usb/usb_quirks.c,v 1.43 2005/12/11 20:14:38 flz Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/usb_quirks.c,v 1.43 2005/12/11 20:14:38 flz Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -82,6 +81,8 @@
                                                     0x100, { UQ_AU_INP_ASYNC }},
  { USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPOD3G,      ANY,   { UQ_NO_OPEN_CLEARSTALL }},
  { USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPODVIDEO,   ANY,   { UQ_NO_OPEN_CLEARSTALL }},
+ { USB_VENDOR_LOGITEC, USB_PRODUCT_LOGITEC_LHD_EB250U2S, 
+						     ANY,   { UQ_NO_OPEN_CLEARSTALL }}, 
  /* XXX These should have a revision number, but I don't know what they are. */
  { USB_VENDOR_HP, USB_PRODUCT_HP_895C,              ANY,   { UQ_BROKEN_BIDIR }},


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-usb mailing list