Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1596834pxu; Fri, 27 Nov 2020 10:35:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJwFnsJFZfCqyxHoxIkIFIOJMFmKCGt0L1cPg7hAA6UUZgse9TMPa4dM7obgyvE0g/YsNgDO X-Received: by 2002:a17:906:a182:: with SMTP id s2mr8999702ejy.249.1606502102945; Fri, 27 Nov 2020 10:35:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606502102; cv=none; d=google.com; s=arc-20160816; b=Bfg93kE2PA1Mz4fEgvoA9T8g2BwXvnNPfxNFNXg8vEmKIWgcta1SWDKznrE0cNBds5 KchxyLLZWQZCKvhtXiib2EUbz0tBOvTqW/VLy+mPeBUfjaNNP1apGmAxXj81Ol3sovp2 PiAKNEFT+VgsM/Hwo3LFloIuU3IeqEXliqdowmiGvY828Vr2b59fZXj5EXExMFKzFAvc LOpI2fUYQlNt1TES8XEbOlwQwCvltVWnhGdAcdZXaLH8BthM2djqQxuVuYgD0nAgef5v XJvbGJoRM4U82yNywUKY8CD31/YCFuP73wy3W/L7GuFqyQ+BU1pBcllnyGpAEDVPhSvM SMCw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2Is2mbdj2e7cjnh1CBAo72fHpjHYzHh+dNnmFQbudQw=; b=QVnRenEnhyHS/RQCmnnYiOaVDfZ75uoCsgSlgVWJg73TkNUURnUOMg9u7T5Ssafb0N j30a36e6kJdXbu/OFb7UfFyB/1xqYrTE+nQx109geaj+Xv4aB5B10AQiZKmsuU5Y6pxD s/VGgjkE0u9i6JH1rfWaHU6hrNpDmmrW9d6FG6YepR5d4NuOq9JARhPcpT6+z1qXHIBY GHIrqaxiq+tj8tJ1PL9pdop5m+RXQ8RL9lFBDw5Qww8kNSVRWKX0bhfsQ10y8auxtZfs lSZsfYrL4+Iq7Zg5p+ttj7QwSaW6OOzpiZoVCMjGK8xTYlLiIaBQHGJfLUZdJ/Lxq45x H0Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VJ0TiIZe; 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 k23si6944418ejk.626.2020.11.27.10.34.40; Fri, 27 Nov 2020 10:35:02 -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=@linuxfoundation.org header.s=korg header.b=VJ0TiIZe; 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 S1730733AbgK0OGJ (ORCPT + 99 others); Fri, 27 Nov 2020 09:06:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:46380 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727653AbgK0OGI (ORCPT ); Fri, 27 Nov 2020 09:06:08 -0500 Received: from localhost (82-217-20-185.cable.dynamic.v4.ziggo.nl [82.217.20.185]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8097D206CA; Fri, 27 Nov 2020 14:06:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606485968; bh=l+ML/gM0MaklgpBNcmLG6VwzDWRbhWmTWpVYK6fwplg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VJ0TiIZeoIC+p9dPdQWKararEE9+orC9K+1k178hP/rXqGVfMD+HcTGMBVgsliARI w5fmQJJXykd2jLE0+ps2z8H4LIbC0eGuefWay1vVaNjsPXHV5Cm2a1/D6UyjdK0u5M yl/QiyMzQAwMZPaDrbZmiEuYeV93nVLAHnqhwclQ= From: Greg Kroah-Hartman To: balbi@kernel.org Cc: peter.chen@nxp.com, willmcvicker@google.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, EJ Hsu , stable , Greg Kroah-Hartman Subject: [PATCH v2 1/5] USB: gadget: f_rndis: fix bitrate for SuperSpeed and above Date: Fri, 27 Nov 2020 15:05:55 +0100 Message-Id: <20201127140559.381351-2-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201127140559.381351-1-gregkh@linuxfoundation.org> References: <20201127140559.381351-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Will McVicker Align the SuperSpeed Plus bitrate for f_rndis to match f_ncm's ncm_bitrate defined by commit 1650113888fe ("usb: gadget: f_ncm: add SuperSpeed descriptors for CDC NCM"). Cc: Felipe Balbi Cc: EJ Hsu Cc: Peter Chen Cc: stable Signed-off-by: Will McVicker Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/function/f_rndis.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_rndis.c b/drivers/usb/gadget/function/f_rndis.c index 9534c8ab62a8..0739b05a0ef7 100644 --- a/drivers/usb/gadget/function/f_rndis.c +++ b/drivers/usb/gadget/function/f_rndis.c @@ -87,8 +87,10 @@ static inline struct f_rndis *func_to_rndis(struct usb_function *f) /* peak (theoretical) bulk transfer rate in bits-per-second */ static unsigned int bitrate(struct usb_gadget *g) { + if (gadget_is_superspeed(g) && g->speed >= USB_SPEED_SUPER_PLUS) + return 4250000000U; if (gadget_is_superspeed(g) && g->speed == USB_SPEED_SUPER) - return 13 * 1024 * 8 * 1000 * 8; + return 3750000000U; else if (gadget_is_dualspeed(g) && g->speed == USB_SPEED_HIGH) return 13 * 512 * 8 * 1000 * 8; else -- 2.29.2