rpms/kernel/FC-3 linux-2.6.11-usb-aggressive-init-retry.patch, NONE, 1.1 kernel-2.6.spec, 1.805, 1.806

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Apr 18 05:04:56 UTC 2005


Update of /cvs/dist/rpms/kernel/FC-3
In directory cvs.devel.redhat.com:/tmp/cvs-serv15208

Modified Files:
	kernel-2.6.spec 
Added Files:
	linux-2.6.11-usb-aggressive-init-retry.patch 
Log Message:
 Retry more aggressively during USB device initialization


linux-2.6.11-usb-aggressive-init-retry.patch:
 hub.c |   28 ++++++++++++++++++----------
 1 files changed, 18 insertions(+), 10 deletions(-)

--- NEW FILE linux-2.6.11-usb-aggressive-init-retry.patch ---
From: stern at rowland.harvard.edu
Subject: [PATCH] USB: Retry more aggressively during device initialization

[PATCH] USB: Retry more aggressively during device initialization

This patch make the hub driver's device initialization routine more
aggressive about detecting errors and retrying.  It checks the result of
the 64-byte GET-DESCRIPTOR request to verify that the descriptor tag is
set correctly and the ep0-maxpacket value is legal; if either is not true
it will retry the request immediately.  David Brownell has said that this
kind of approach is necessary to make certain buggy devices work.


Signed-off-by: Alan Stern <stern at rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>


 drivers/usb/core/hub.c |   28 ++++++++++++++++++----------
 1 files changed, 18 insertions(+), 10 deletions(-)


diff -Nru a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
--- a/drivers/usb/core/hub.c	2005-03-08 16:55:02 -08:00
+++ b/drivers/usb/core/hub.c	2005-03-08 16:55:02 -08:00
@@ -2181,24 +2181,35 @@
 				retval = -ENOMEM;
 				continue;
 			}
-			buf->bMaxPacketSize0 = 0;
 
 			/* Use a short timeout the first time through,
 			 * so that recalcitrant full-speed devices with
 			 * 8- or 16-byte ep0-maxpackets won't slow things
 			 * down tremendously by NAKing the unexpectedly
-			 * early status stage.  Also, retry on length 0
-			 * or stall; some devices are flakey.
+			 * early status stage.  Also, retry on all errors;
+			 * some devices are flakey.
 			 */
 			for (j = 0; j < 3; ++j) {
+				buf->bMaxPacketSize0 = 0;
 				r = usb_control_msg(udev, usb_rcvaddr0pipe(),
 					USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
 					USB_DT_DEVICE << 8, 0,
 					buf, GET_DESCRIPTOR_BUFSIZE,
 					(i ? HZ * USB_CTRL_GET_TIMEOUT : HZ));
-				if (r == 0 || r == -EPIPE)
-					continue;
-				if (r < 0)
+				switch (buf->bMaxPacketSize0) {
+				case 8: case 16: case 32: case 64:
+					if (buf->bDescriptorType ==
+							USB_DT_DEVICE) {
+						r = 0;
+						break;
+					}
+					/* FALL THROUGH */
+				default:
+					if (r == 0)
+						r = -EPROTO;
+					break;
+				}
+				if (r == 0)
 					break;
 			}
 			udev->descriptor.bMaxPacketSize0 =
@@ -2214,10 +2225,7 @@
 				retval = -ENODEV;
 				goto fail;
 			}
-			switch (udev->descriptor.bMaxPacketSize0) {
-			case 64: case 32: case 16: case 8:
-				break;
-			default:
+			if (r) {
 				dev_err(&udev->dev, "device descriptor "
 						"read/%s, error %d\n",
 						"64", r);


Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/FC-3/kernel-2.6.spec,v
retrieving revision 1.805
retrieving revision 1.806
diff -u -r1.805 -r1.806
--- kernel-2.6.spec	14 Apr 2005 05:29:25 -0000	1.805
+++ kernel-2.6.spec	18 Apr 2005 05:04:53 -0000	1.806
@@ -284,6 +284,7 @@
 
 # USB bits
 Patch1400: linux-2.6.10-usb-use_both_schemes.patch
+Patch1401: linux-2.6.11-usb-aggressive-init-retry.patch
 
 # Netdump and Diskdump bits.
 Patch1500: linux-2.6.10-crashdump-common.patch
@@ -558,6 +559,8 @@
 # USB Bits.
 # Enable both old and new style USB initialisation.
 %patch1400 -p1
+# Retry more aggressively during USB device initialization
+%patch1401 -p1
 
 # netdump bits
 %patch1500 -p1
@@ -892,6 +895,9 @@
 %endif
 
 %changelog
+* Mon Apr 18 2005 Dave Jones <davej at redhat.com>
+- Retry more aggressively during USB device initialization
+
 * Thu Apr 14 2005 Dave Jones <davej at redhat.com>
 - Build DRM modular. (#154769)
 




More information about the fedora-cvs-commits mailing list