From patchwork Wed Mar 8 14:05:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 95043 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp2366295qgd; Wed, 8 Mar 2017 06:09:38 -0800 (PST) X-Received: by 10.98.12.148 with SMTP id 20mr7245372pfm.116.1488982178643; Wed, 08 Mar 2017 06:09:38 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g10si3350711pge.420.2017.03.08.06.09.38; Wed, 08 Mar 2017 06:09:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752062AbdCHOJh (ORCPT + 5 others); Wed, 8 Mar 2017 09:09:37 -0500 Received: from fllnx210.ext.ti.com ([198.47.19.17]:13243 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752820AbdCHOJh (ORCPT ); Wed, 8 Mar 2017 09:09:37 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id v28E5oxr018935; Wed, 8 Mar 2017 08:05:50 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1488981950; bh=VEf2svA6DEVscrZmU3oziA/XmYlWktNNO2rSCk+T9zM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Aji9h7oV1mknfg684yT3bk1eQQjTlTN1pitEvSiGRomNFAc0ySQ1xWa4oJqNzB3l7 PUmR5KL7i+/39bCDoiVFJxuLMJvQx75RqKL3WCZpewRmbhtFa0xWQJWyKzTci33aZl pBzih4K8UhowaDkaDJXFZXaXRhvr8PFnTXJh2HCE= Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v28E5oDa011943; Wed, 8 Mar 2017 08:05:50 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.294.0; Wed, 8 Mar 2017 08:05:50 -0600 Received: from lta0400828d.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v28E5jho020527; Wed, 8 Mar 2017 08:05:48 -0600 From: Roger Quadros To: , CC: , , , , Roger Quadros , Subject: [PATCH 1/2] usb: gadget: f_uvc: Fix SuperSpeed companion descriptor's wBytesPerInterval Date: Wed, 8 Mar 2017 16:05:43 +0200 Message-ID: <1488981944-28915-2-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488981944-28915-1-git-send-email-rogerq@ti.com> References: <1488981944-28915-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 --- drivers/usb/gadget/function/f_uvc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 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);