From patchwork Mon Apr 12 22:29:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sarah Sharp X-Patchwork-Id: 92104 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3CMUTlT023102 for ; Mon, 12 Apr 2010 22:30:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754279Ab0DLWaF (ORCPT ); Mon, 12 Apr 2010 18:30:05 -0400 Received: from mga09.intel.com ([134.134.136.24]:40643 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754270Ab0DLWaD (ORCPT ); Mon, 12 Apr 2010 18:30:03 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 12 Apr 2010 15:29:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.52,192,1270450800"; d="log'?scan'208";a="508531945" Received: from xanatos.jf.intel.com (HELO xanatos) ([134.134.16.204]) by orsmga002.jf.intel.com with ESMTP; 12 Apr 2010 15:29:51 -0700 Date: Mon, 12 Apr 2010 15:29:32 -0700 From: Sarah Sharp To: linux-usb@vger.kernel.org, linux-media@vger.kernel.org Cc: Libin , andiry.xu@amd.com, Jean-Francois Moine , Mauro Carvalho Chehab , Hans de Goede Subject: xHCI bandwidth error with USB webcam Message-ID: <20100412222932.GA18647@xanatos> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 12 Apr 2010 22:30:31 +0000 (UTC) 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;