diff mbox

xHCI bandwidth error with USB webcam

Message ID 20100412222932.GA18647@xanatos (mailing list archive)
State RFC
Headers show

Commit Message

Sarah Sharp April 12, 2010, 10:29 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 222af47..6de3117 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -643,6 +643,7 @@  static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev)
 	xfer = gspca_dev->cam.bulk ? USB_ENDPOINT_XFER_BULK
 				   : USB_ENDPOINT_XFER_ISOC;
 	i = gspca_dev->alt;			/* previous alt setting */
+find_alt:
 	if (gspca_dev->cam.reverse_alts) {
 		while (++i < gspca_dev->nbalt) {
 			ep = alt_xfer(&intf->altsetting[i], xfer);
@@ -666,10 +667,11 @@  static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev)
 	if (gspca_dev->nbalt > 1) {
 		gspca_input_destroy_urb(gspca_dev);
 		ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, i);
-		if (ret < 0) {
-			err("set alt %d err %d", i, ret);
-			ep = NULL;
-		}
+		/* xHCI hosts will reject set interface requests
+		 * if they take too much bandwidth, so try again.
+		 */
+		if (ret < 0)
+			goto find_alt;
 		gspca_input_create_urb(gspca_dev);
 	}
 	return ep;