On 07/21/2010 10:44 PM, Stephen Warren wrote: > Phil Dibowitz wrote: >> On 07/18/2010 10:11 PM, Alan Stern wrote: >>> Aside from that, this is basically okay. There's a couple of things >>> in the patch itself you might want to consider changing: >> >> Great, thanks. All cosmetic, and done my local version. >> >> Stephen - as soon as you confirm the patch works (the second one, please, >> not the first, since they're non-cosmetic changes), I'll submit upstream. > > Sorry for the slow response; I had a heck of a time getting a kernel to > work on Ubuntu, and trying to track down why my debug prints weren't > appearing... > > Unfortunately, this patch does not work. > > udev->quirks is set up later than the newly added usage in > hub_port_connect_change, specifically in the usb_new_device call later in > the "for SET_CONFIG_TRIES" loop. Hence, there are no quirks set at that > time, and the workaround msleep() is never executed. Oh, good call. Well, let's see. I suspsect that usb_enumerate_device is what actually triggers the device failure, so I can move the work around to between usb_detect_quirks() and usb_enumerate_devices() That's IF something before that doesn't trigger the problem (like check_speed). Give this one a shot? This is as early as I can do it without more significant code changes I probably shouldn't be doing. :) -- Phil Dibowitz phil@xxxxxxxx Open Source software and tech docs Insanity Palace of Metallica http://www.phildev.net/ http://www.ipom.com/ "Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind." - Dr. Seuss
The Logitech Harmony 700 series needs an extra delay during initialization. This patch adds a USB quirk which enables such a delay and adds the device to the quirks list. Signed-off-by: Phil Dibowitz <phil@xxxxxxxx> --- linux-2.6.35-rc5-phil/drivers/usb/core/hub.c | 4 ++++ linux-2.6.35-rc5-phil/drivers/usb/core/quirks.c | 3 +++ linux-2.6.35-rc5-phil/include/linux/usb/quirks.h | 4 ++++ 3 files changed, 11 insertions(+) diff -puN drivers/usb/core/quirks.c~usbcore-checkspeed-quirk drivers/usb/core/quirks.c --- linux-2.6.35-rc5/drivers/usb/core/quirks.c~usbcore-checkspeed-quirk 2010-07-18 16:00:15.000000000 +0200 +++ linux-2.6.35-rc5-phil/drivers/usb/core/quirks.c 2010-07-18 18:28:08.000000000 +0200 @@ -38,6 +38,9 @@ static const struct usb_device_id usb_qu /* Creative SB Audigy 2 NX */ { USB_DEVICE(0x041e, 0x3020), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Logitech Harmony 700-series */ + { USB_DEVICE(0x046d, 0xc122), .driver_info = USB_QUIRK_DELAY_INIT }, + /* Philips PSC805 audio device */ { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME }, diff -puN drivers/usb/core/hub.c~usbcore-checkspeed-quirk drivers/usb/core/hub.c --- linux-2.6.35-rc5/drivers/usb/core/hub.c~usbcore-checkspeed-quirk 2010-07-18 16:00:15.000000000 +0200 +++ linux-2.6.35-rc5-phil/drivers/usb/core/hub.c 2010-07-21 23:10:04.000000000 +0200 @@ -20,6 +20,7 @@ #include <linux/usb.h> #include <linux/usbdevice_fs.h> #include <linux/usb/hcd.h> +#include <linux/usb/quirks.h> #include <linux/kthread.h> #include <linux/mutex.h> #include <linux/freezer.h> @@ -1802,6 +1803,9 @@ int usb_new_device(struct usb_device *ud pm_runtime_enable(&udev->dev); usb_detect_quirks(udev); + if (udev->quirks & USB_QUIRK_DELAY_INIT) + msleep(1000); + err = usb_enumerate_device(udev); /* Read descriptors */ if (err < 0) goto fail; diff -puN include/linux/usb/quirks.h~usbcore-checkspeed-quirk include/linux/usb/quirks.h --- linux-2.6.35-rc5/include/linux/usb/quirks.h~usbcore-checkspeed-quirk 2010-07-18 16:00:15.000000000 +0200 +++ linux-2.6.35-rc5-phil/include/linux/usb/quirks.h 2010-07-19 01:36:25.000000000 +0200 @@ -26,4 +26,8 @@ and can't handle talking to these interfaces */ #define USB_QUIRK_HONOR_BNUMINTERFACES 0x00000020 +/* device needs a pause during initialization, after we read the device + descriptor */ +#define USB_QUIRK_DELAY_INIT 0x00000040 + #endif /* __LINUX_USB_QUIRKS_H */ _
Attachment:
signature.asc
Description: OpenPGP digital signature