On Wednesday 05 January 2005 12:53 pm, Alan Stern wrote:
> I don't know about that low speed "Unlink after no-IRQ" message,

That's some kind of IRQ setup problem.  If there isn't a
FAQ on how to tweak IRQ setup in Linux, there should be!
There are options for APIC, Local-APIC, ACPI, and PCI, all
of which interact ... BIOS bugs make LOTS of trouble in
terms of IRQ setup.


> but you  
> may be able to fix the other problems by using the "old_scheme_first=y" 
> module parameter for usbcore.
> 
> Incidentally, if anyone can suggest why some devices like this one fail 
> with the new initialization scheme while (presumably) working correctly 
> with Windows, I would like to here it.  The intent of the new scheme was 
> to duplicate exactly the sequence of transfers that Windows uses.

Windows has many different versions ... they don't all act the same.

I'd be interested in knowing if the following patch makes much
of a difference ... I suspect it'd help other cases a bit better,
where the "-EPROTO" error suggests that the oversized read had a
somewhat impolite failure mode.  Though this case ("-ETIMEDOUT")
might be affected too; who knows.


It may also be worth noting that usb_control_msg() has a rather
atypical failure status.  Normally one expects that when software
reads N bytes successfully then gets an error, the return from
the read is N not an error code ... usb_control_msg() returns
the error code instead.  I've seen some devices that act a lot
happier if that's changed to return N, like any normal read;
so usb_internal_control_msg() would

        return length ? length : retv;

I forget why I never submitted a patch to do that.

- Dave

--- 1.148/drivers/usb/core/hub.c	Sun Nov  7 14:31:07 2004
+++ edited/drivers/usb/core/hub.c	Wed Jan  5 16:00:58 2005
@@ -2162,7 +2162,9 @@
 		if (USE_NEW_SCHEME(retry_counter)) {
 			struct usb_device_descriptor *buf;
 
-#define GET_DESCRIPTOR_BUFSIZE	64
+#define GET_DESCRIPTOR_BUFSIZE	USB_DT_DEVICE_SIZE
+#define str(s) xstr(s)
+#define xstr(s) #s
 			buf = kmalloc(GET_DESCRIPTOR_BUFSIZE, GFP_NOIO);
 			if (!buf) {
 				retval = -ENOMEM;
@@ -2197,11 +2199,14 @@
 			if (udev->descriptor.bMaxPacketSize0 == 0) {
 				dev_err(&udev->dev, "device descriptor "
 						"read/%s, error %d\n",
-						"64", j);
+						str(GET_DESCRIPTOR_BUFSIZE),
+						j);
 				retval = -EMSGSIZE;
 				continue;
 			}
 #undef GET_DESCRIPTOR_BUFSIZE
+#undef xstr
+#undef str
 		}
 
 		for (j = 0; j < SET_ADDRESS_TRIES; ++j) {

Reply via email to