aboutsummaryrefslogtreecommitdiffstats
path: root/usb
diff options
authorGreg Kroah-Hartman <gregkh@suse.de>2010-10-14 12:38:00 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-14 12:38:00 -0700
commitf96dff13ee958f8098a59e525d903e335b38b5c9 (patch)
treefa102f3ec4d995724e6235bfe0017165f5568d74 /usb
parent16f02799214e38b8a545da586a51ca9a64c2e522 (diff)
downloadpatches-f96dff13ee958f8098a59e525d903e335b38b5c9.tar.gz
usb bugfix
Diffstat (limited to 'usb')
-rw-r--r--usb/usb-accept-some-invalid-ep0-maxpacket-values.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/usb/usb-accept-some-invalid-ep0-maxpacket-values.patch b/usb/usb-accept-some-invalid-ep0-maxpacket-values.patch
new file mode 100644
index 00000000000000..ad49fc51601b55
--- /dev/null
+++ b/usb/usb-accept-some-invalid-ep0-maxpacket-values.patch
@@ -0,0 +1,49 @@
+From stern+4cbd0eee@rowland.harvard.edu Thu Oct 14 12:35:30 2010
+Date: Thu, 14 Oct 2010 15:25:21 -0400 (EDT)
+From: Alan Stern <stern@rowland.harvard.edu>
+To: Greg KH <greg@kroah.com>
+cc: James <bjlockie@lockie.ca>
+Subject: USB: accept some invalid ep0-maxpacket values
+Message-ID: <Pine.LNX.4.44L0.1010141521440.1645-100000@iolanthe.rowland.org>
+
+A few devices (such as the RCA VR5220 voice recorder) are so
+non-compliant with the USB spec that they have invalid maxpacket sizes
+for endpoint 0. Nevertheless, as long as we can safely use them, we
+may as well do so.
+
+This patch (as1432) softens our acceptance criterion by allowing
+high-speed devices to have ep0-maxpacket sizes other than 64. A
+warning is printed in the system log when this happens, and the
+existing error message is clarified.
+
+Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
+Reported-by: James <bjlockie@lockie.ca>
+Cc: stable <stable@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/core/hub.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+--- a/drivers/usb/core/hub.c
++++ b/drivers/usb/core/hub.c
+@@ -2861,13 +2861,16 @@ hub_port_init (struct usb_hub *hub, stru
+ else
+ i = udev->descriptor.bMaxPacketSize0;
+ if (le16_to_cpu(udev->ep0.desc.wMaxPacketSize) != i) {
+- if (udev->speed != USB_SPEED_FULL ||
++ if (udev->speed == USB_SPEED_LOW ||
+ !(i == 8 || i == 16 || i == 32 || i == 64)) {
+- dev_err(&udev->dev, "ep0 maxpacket = %d\n", i);
++ dev_err(&udev->dev, "Invalid ep0 maxpacket: %d\n", i);
+ retval = -EMSGSIZE;
+ goto fail;
+ }
+- dev_dbg(&udev->dev, "ep0 maxpacket = %d\n", i);
++ if (udev->speed == USB_SPEED_FULL)
++ dev_dbg(&udev->dev, "ep0 maxpacket = %d\n", i);
++ else
++ dev_warn(&udev->dev, "Using ep0 maxpacket: %d\n", i);
+ udev->ep0.desc.wMaxPacketSize = cpu_to_le16(i);
+ usb_ep0_reinit(udev);
+ }