Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9041519pxu; Mon, 28 Dec 2020 05:12:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0xDodvdB6MMRaSAOH4Bslhna7mev4jbhU6EwjXKC50gyqhHPgfhS5NVhYGWxJqbfYgMm8 X-Received: by 2002:a05:6402:1caa:: with SMTP id cz10mr42435156edb.345.1609161130471; Mon, 28 Dec 2020 05:12:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609161130; cv=none; d=google.com; s=arc-20160816; b=Vj7HwnS6ANJloiAhwbGfMxcrXk+VhMMSeTofjLiYO/C6wSVqYK/pQETLIS5PxwXCJv TZYy5YO5qpEbVUR2DVNM1b0zwJrgCX2RtVvVQWFc/rx+JasToTFohAr9HIld/ubdITKa MCHBsi4S4uVqcfqD6iekr+n92O60nL22zktWR7pXlwxqfdvHY9soTLcYMOIBz1+d/r/b Y3Z/EvAYTaysi2tn/wQ38LjHyC+SGhefPdFtZw7ifZo7hjShMuayyswiJiUDT5MY/T+i nGt7PONdpbW34Oxgp81cO7HFpcFb3Ocf00yQUMzbpBUtDG6T+K4MI/ZXnnAG8LMJK5Ea kdZg== 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=aJDkbab/3w4Mb/oAPF5u/YYxTroDgCgnCbT7xgljj0s=; b=gPaEbI/tacRrzpAUYOzUlxyRnhyKBpnO/vjLdjDiOYDW4CJRnPa9BvcpzJQHP15pWy EPRCCcZ48rFxxWpC4Rgwi1aLxZzgUI4CTO/D0lVV50SAjOgvfxzCj9EhruBVsNhficrI Davci6jCAWyt6WKcb7dzdQ/yKYdjbpg4Ao4uGacf7RvS5rmMK/bNTDGDy18erTk6NsNo sDuMcZsuO9CjQPpzO+h+YsPU1Sr/qt8ZB+XH1748wAzheOoK60dqDkdvtnuRmPgQR2gB rxoDqvtNCIFe7AvgbITehkZ28VSn312THqAelw+jSoId7Pf8iQLBLDLplLif5cO5nKLw Jtgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ejEBg5WJ; 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 b13si19343365edw.300.2020.12.28.05.11.47; Mon, 28 Dec 2020 05:12:10 -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=ejEBg5WJ; 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 S1731265AbgL1NKA (ORCPT + 99 others); Mon, 28 Dec 2020 08:10:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:37730 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731244AbgL1NJ7 (ORCPT ); Mon, 28 Dec 2020 08:09:59 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9CD94207C9; Mon, 28 Dec 2020 13:09:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160959; bh=Bo8yfNXiHfXgUOHN8hGi8e7wn1liUW8gOAfUwaubMF4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ejEBg5WJtVKaJQ9INqVCWlfAF9Qaas3VAvncyze8NiioiaM+9XADAfP4qIkusdA7/ yHZXJBDfuuzcVnoTOt46SCPYl3GjCLV5EK0A0VZMJafbuiTamm2aQFafjDeVHfFwKW S/ARAikyr5zZ2v9qN8K02CigTFHkJDGNMH5U91Y8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Felipe Balbi , EJ Hsu , Peter Chen , Will McVicker Subject: [PATCH 4.14 053/242] USB: gadget: f_rndis: fix bitrate for SuperSpeed and above Date: Mon, 28 Dec 2020 13:47:38 +0100 Message-Id: <20201228124907.292264752@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@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: Will McVicker commit b00f444f9add39b64d1943fa75538a1ebd54a290 upstream. 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 Reviewed-by: Peter Chen Link: https://lore.kernel.org/r/20201127140559.381351-2-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/function/f_rndis.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/usb/gadget/function/f_rndis.c +++ b/drivers/usb/gadget/function/f_rndis.c @@ -91,8 +91,10 @@ static inline struct f_rndis *func_to_rn /* 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