From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.linuxfoundation.org ([140.211.169.12]:42196 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753718AbcKNJVM (ORCPT ); Mon, 14 Nov 2016 04:21:12 -0500 Date: Mon, 14 Nov 2016 10:21:21 +0100 From: Greg KH To: Mike Krinkin Cc: linux-usb@vger.kernel.org, felipe.balbi@linux.intel.com, linux-media@vger.kernel.org, mchehab@kernel.org, laurent.pinchart@ideasonboard.com Subject: Re: [PATCH] usb: core: urb make use of usb_endpoint_maxp_mult Message-ID: <20161114092121.GA31797@kroah.com> References: <1479033076-2995-1-git-send-email-krinkin.m.u@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1479033076-2995-1-git-send-email-krinkin.m.u@gmail.com> Sender: linux-media-owner@vger.kernel.org List-ID: On Sun, Nov 13, 2016 at 01:31:16PM +0300, Mike Krinkin wrote: > Since usb_endpoint_maxp now returns only lower 11 bits mult > calculation here isn't correct anymore and that breaks webcam > for me. Patch make use of usb_endpoint_maxp_mult instead of > direct calculation. > > Fixes: abb621844f6a ("usb: ch9: make usb_endpoint_maxp() return > only packet size") > > Signed-off-by: Mike Krinkin > --- > drivers/usb/core/urb.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c > index 0be49a1..d75cb8c 100644 > --- a/drivers/usb/core/urb.c > +++ b/drivers/usb/core/urb.c > @@ -412,11 +412,8 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) > } > > /* "high bandwidth" mode, 1-3 packets/uframe? */ > - if (dev->speed == USB_SPEED_HIGH) { > - int mult = 1 + ((max >> 11) & 0x03); > - max &= 0x07ff; > - max *= mult; > - } > + if (dev->speed == USB_SPEED_HIGH) > + max *= usb_endpoint_maxp_mult(&ep->desc); > > if (urb->number_of_packets <= 0) > return -EINVAL; Felipe, this looks like it belongs in your tree...