Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2475813pxj; Mon, 10 May 2021 04:02:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxFFj7Wg2G9egmjPvCRzMDSElTuXNchIdH96mugQnsdFAz5EFhu73pN2pjU1k0AJqVxhvK X-Received: by 2002:a05:6e02:1a67:: with SMTP id w7mr6661279ilv.137.1620644536219; Mon, 10 May 2021 04:02:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620644536; cv=none; d=google.com; s=arc-20160816; b=wq6shVRpw8T+jh14FoyUOS+hlWE3FJUQ7Z3LFm1T2V8DjrYZ+hFZhubyiavKRkLrFa xhYjIQxbYClSesmy8Ce0ioZLZg7+y6ezUPVNnUMITGxlXaaP9Jfm9C7Uq6bDEHT7R8nr k0M1inj9MivDuP278Al3jQyxtHWVGlHGjcb8NQlek7GC5zqZglLiMjnjDHXGBFMKLIXZ rW6CxOCXb8CNDJKOQaKEgQHm1TvUYw0tlaewkv98cVFiYrT0CeYE7+IQ6ZuklD0FL3m3 GxDFo/vrBlO1uUr3b6J0SDkdiu6oMgOLajWsbDyGpGYE36XLZhqaZ5V6IMTP0zZ3uJha XKDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qqLkRif3xEvdbiK3pa56SO/ArAxNt2QNWFG1KBoOhug=; b=B3EuDJk3ajxRdwiAcwjtFJkv21rv3xC+WZSa++cVmqpQB1cGU5WL1iPi15ehD7othU 9Rw4na07gFLN8AbQ331vDFS/AIbKQiOO6bQ6W0dVb5RgHBI+DMgsOs7G23j8eHyeRMng goe0PmfZg+Y+t9POcHm1sr9YlykKw8xxMt4TqUp7dHOBFnU/4c24slD9f5IxipzAfOs9 JkEgmUBnikz+ukWv3a2PTDystOCTQV9pYxdkM+Wk4Mbmt3xd5amOH8/zDM9bgS2OUque nRrd7ST2xP291JvPRduGudjBQYatM4qnqYKJUEvWCqXZxiKJijH+ZRO51Ulqbe2Wc04R svzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=T7biFIYx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e5si15025179jaq.6.2021.05.10.04.02.02; Mon, 10 May 2021 04:02:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=T7biFIYx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234491AbhEJK75 (ORCPT + 99 others); Mon, 10 May 2021 06:59:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:52048 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232521AbhEJKoY (ORCPT ); Mon, 10 May 2021 06:44:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E92BD6188B; Mon, 10 May 2021 10:33:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620642802; bh=yRYcq6j35c8xXbshQieIahs1G4PzznF+jh3voE7fUqo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T7biFIYxM/UcWfpS/w8/8HojvtjOHEtZ3oUqosMwTtxA7iSPjAsIkmDilnqeBt/Ym yfS/plkeHRsPWyJKjSdRU+F7JocpcXLKKf3YABo7f7+psCXSPAeeDl9bUteUgEjOR+ BUv6PUrcIZwJafPlaqAZb37NIUh2oBLZTWTt4T0U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Chen , Laurent Pinchart , Pawel Laszczak , Sasha Levin Subject: [PATCH 5.10 058/299] usb: gadget: uvc: add bInterval checking for HS mode Date: Mon, 10 May 2021 12:17:35 +0200 Message-Id: <20210510102006.803322252@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pawel Laszczak [ Upstream commit 26adde04acdff14a1f28d4a5dce46a8513a3038b ] Patch adds extra checking for bInterval passed by configfs. The 5.6.4 chapter of USB Specification (rev. 2.0) say: "A high-bandwidth endpoint must specify a period of 1x125 µs (i.e., a bInterval value of 1)." The issue was observed during testing UVC class on CV. I treat this change as improvement because we can control bInterval by configfs. Reviewed-by: Peter Chen Reviewed-by: Laurent Pinchart Signed-off-by: Pawel Laszczak Link: https://lore.kernel.org/r/20210308125338.4824-1-pawell@gli-login.cadence.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/gadget/function/f_uvc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c index 44b4352a2676..ed77a126a74f 100644 --- a/drivers/usb/gadget/function/f_uvc.c +++ b/drivers/usb/gadget/function/f_uvc.c @@ -633,7 +633,12 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f) uvc_hs_streaming_ep.wMaxPacketSize = cpu_to_le16(max_packet_size | ((max_packet_mult - 1) << 11)); - uvc_hs_streaming_ep.bInterval = opts->streaming_interval; + + /* A high-bandwidth endpoint must specify a bInterval value of 1 */ + if (max_packet_mult > 1) + uvc_hs_streaming_ep.bInterval = 1; + else + uvc_hs_streaming_ep.bInterval = opts->streaming_interval; uvc_ss_streaming_ep.wMaxPacketSize = cpu_to_le16(max_packet_size); uvc_ss_streaming_ep.bInterval = opts->streaming_interval; -- 2.30.2