Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2370809pxf; Sat, 13 Mar 2021 18:31:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxPEwGFwmobZPiXKPaNwggaX8b5SZoeFP8nC4SHSt/8zVZuk7elA8zd1boraMahArRQqSji X-Received: by 2002:a17:906:4d94:: with SMTP id s20mr1507729eju.286.1615689071679; Sat, 13 Mar 2021 18:31:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615689071; cv=none; d=google.com; s=arc-20160816; b=zSGeT+AjnAZJiGXfopbE6c2C/COPXtXVbS+A8CKc4MhIyUwyzAGmR45UkqWf8Obf1z /C1zm6ruRJ7Q1di2ZWuquz+kH+sI4QYQTXyuLpKKm1qAuRBUpBbrCso0IP1LEWEgkVe+ pPhfHgYqxSrApMNeKU5iHl4j7gsX245JbBjN8tjZ1yROiGTqkavygYZCYnc7d95aZDlZ g1BvFNHvpIhaHx/PdzQbUfW9WvilKmAXha49CCeP2tBiJvNir/YXtxEMAZkEEScba0+T 9IdsqMoDpZ7+OSPfZjgm1NAt66Rr55SPKlugfdNMFfZvgyYuedv/w77hIVHvJaCnEsvb evxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=XcCPBzO7fDJuVV0firUqqOG0ljQ0hcTN37WCfhCgy1Y=; b=IRwb5ddcSFvI62Rxiv1TgSVjXnWR2CqccVCRK/TH5Lkcgoj+zbVl17g2la//aXlTjn QKt5YabtiHoPdWnApAat0S1tsikZlaIa5OiTl+4lbW8+/EJPyUy9FFYNxwlgBXMx+X70 IS7EIrF6KmMdt8Ea1NoezatUeq4VZxKvKIzJfoE6RLOnfYimFQbVM+AcngxtJLBaxyJi zMBzpa4Tl0WKOEDw07xVd05pfdnduLMRV9+P3G+Qj8rVReL1DZiDhNInoAJYYr8DM60R PMvhgpkIYdAYi16wRBVrQ1tFV8qOnZ2JywF6AW3CWWfe5+8I5S5ouNJaKPn56A3EdQh6 vFAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eCyT1ewN; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p3si8026482ejd.319.2021.03.13.18.30.47; Sat, 13 Mar 2021 18:31:11 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=eCyT1ewN; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233103AbhCNC3w (ORCPT + 99 others); Sat, 13 Mar 2021 21:29:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:56722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231497AbhCNC3U (ORCPT ); Sat, 13 Mar 2021 21:29:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5A28A64E62; Sun, 14 Mar 2021 02:29:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615688960; bh=mt760bIfNdFduP4gxeD2h1k3Vjred890jDgDdCPGWbU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eCyT1ewNJq3FoqH4CWB/FKvn0cDgTHXq9uoU8QZhJ0d1vBvvvHei6gcYpwYR4wDfp eMsDtVerSGEseO7wQwXhrYZahe7SC83ved2Mi9vZ6k51/WLGptCaWVxS27qxrOFvBE 0O37DDYHhH8XwwjmGgKkWVXNX8b9We1i7fzNuqdxclHWSsIccn+MDdc4adMWoN/WWN hCvD+6eKJpeLYQ0PRkMj8EP82SH7EHj8DxsFE9NKoShc1jzFw8H5Na5fA8y7l6fEP/ 3zP6o39MOMPI7cJHPKJdV2ZSlUF+rxAQJqJz8Swbp2/vfAefjLob/9JmOeaWA7YJcj YDnlxkhAfceCQ== Date: Sun, 14 Mar 2021 10:29:14 +0800 From: Peter Chen To: Pawel Laszczak Cc: balbi@kernel.org, laurent.pinchart@ideasonboard.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, kurahul@cadence.com Subject: Re: [PATCH v2] usb: gadget: uvc: add bInterval checking for HS mode Message-ID: <20210314022914.GC17526@b29397-desktop> References: <20210308125338.4824-1-pawell@gli-login.cadence.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210308125338.4824-1-pawell@gli-login.cadence.com> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21-03-08 13:53:38, Pawel Laszczak wrote: > From: Pawel Laszczak > > 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. > > Signed-off-by: Pawel Laszczak > > --- > Changlog: > v2: > - removed duplicated assignment > > 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.25.1 > Reviewed-by: Peter Chen -- Thanks, Peter Chen