Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753144AbdCIJhQ (ORCPT ); Thu, 9 Mar 2017 04:37:16 -0500 Received: from fllnx209.ext.ti.com ([198.47.19.16]:62224 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751355AbdCIJhM (ORCPT ); Thu, 9 Mar 2017 04:37:12 -0500 Subject: Re: [PATCH 1/2] usb: gadget: f_uvc: Fix SuperSpeed companion descriptor's wBytesPerInterval To: , References: <1488981944-28915-1-git-send-email-rogerq@ti.com> <1488981944-28915-2-git-send-email-rogerq@ti.com> CC: , , , , From: Roger Quadros Message-ID: <3292baba-26d5-16b2-de45-054fee803f0a@ti.com> Date: Thu, 9 Mar 2017 11:34:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <1488981944-28915-2-git-send-email-rogerq@ti.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1407 Lines: 40 Felipe, On 08/03/17 16:05, Roger Quadros wrote: > The streaming_maxburst module parameter is 0 offset (0..15) > so we must add 1 while using it for wBytesPerInterval > calculation for the SuperSpeed companion descriptor. > > Without this host uvcvideo driver will always see the wrong > wBytesPerInterval for SuperSpeed uvc gadget and may not find > a suitable video interface endpoint. > e.g. for streaming_maxburst = 0 case it will always > fail as wBytePerInterval was evaluating to 0. > > Cc: stable@vger.kernel.org > Signed-off-by: Roger Quadros Please pick this one for v4.11-rc with Laurent's Reviewed-by. Thanks. > --- > drivers/usb/gadget/function/f_uvc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c > index 29b41b5..c7689d0 100644 > --- a/drivers/usb/gadget/function/f_uvc.c > +++ b/drivers/usb/gadget/function/f_uvc.c > @@ -625,7 +625,7 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f) > uvc_ss_streaming_comp.bMaxBurst = opts->streaming_maxburst; > uvc_ss_streaming_comp.wBytesPerInterval = > cpu_to_le16(max_packet_size * max_packet_mult * > - opts->streaming_maxburst); > + (opts->streaming_maxburst + 1)); > > /* Allocate endpoints. */ > ep = usb_ep_autoconfig(cdev->gadget, &uvc_control_ep); > -- cheers, -roger