Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9440430pxu; Mon, 28 Dec 2020 16:38:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5pGQyZd2SnY0wrMf9R/ED80VzqYYXP/vdONEdfDaxotEWMuveEPTrWkNsnIomusIt68ga X-Received: by 2002:a17:906:5f92:: with SMTP id a18mr44975926eju.126.1609202285588; Mon, 28 Dec 2020 16:38:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609202285; cv=none; d=google.com; s=arc-20160816; b=vlIV1/qsPigUcUXNnucI7gIBLDyNMSY4K6S2XYzvFr8xBftmncq3IP7R2A5s3dcMb3 xy6ryx0C5XcAffgyOD6FMX95ualg4qTKl+mGCwbrFeV0lbtuwHH89LAixeREVkFzNQP3 g0OQDmB+7CGJAVVjR3yXKlD5um2tGSJPCQlJxdqS7Db7XcazeCVBp8sDRgdOhpz5jdqR miLrrXlnK4q0B9UCsy342oEskArZ2tqFJ4vhKoA+LMp/aopHWlDrdl0FXuZMRniQWs1K DqAUOAgqC2JOy/C0/ENc4MfbjUEATQ5BhJBtAOpHN6ndVsHd0vitMDAmVoHIIeDAZ+TW 67Ng== 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=MT7csvXwHEmOr9RYLg8FJegL32Sp5bIYpT59bMfMrto=; b=NHOJTgRPsODakaLJb6mUwSr1DWDNNb68hngu6RCOQKmfqHe4Kt7Y5f1nDh3KmSYbKe h8oAYOrLKyzkmcd/yO/napDA5Ssx/nj3MZKvODjvOuD9VOzFGDUYSXjw4h0ymNMJPGim d7V/nNpJtnb4A1gpe9NRBz5Y3U+CTPBZflDpfYASdJA6tAYb16B+TrJ2xLKvX7FDS6lI lJxf1RsvjHqnRWdOftgI9jlSlrQfJPHg/shO03wwOTfbvwv2R2NWKW3oTGtleI+EBrk4 jynaOqMaJi/MFgesZaF46+PjqCJ/u3YGMvLVxibHK0GS10vzcRTvTb1nAAHQ7k8JGnyW wMfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UGTZLPsI; 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 g11si19375138ejc.500.2020.12.28.16.37.43; Mon, 28 Dec 2020 16:38:05 -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=UGTZLPsI; 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 S2633074AbgL1PwT (ORCPT + 99 others); Mon, 28 Dec 2020 10:52:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:40444 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403853AbgL1NkM (ORCPT ); Mon, 28 Dec 2020 08:40:12 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 68C28205CB; Mon, 28 Dec 2020 13:39:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609162772; bh=k9eOuaPTiFozOgNF9rx9KZ06evrYinSvgIJmaQqBn34=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UGTZLPsIlJWLZG58xDQSYgYfRdll1A9d/RHxCEh6cCyKecknS+4QfELRpT2LJl1U6 p6aLmY3znWlOXC/8aKsXxSQEVS1YRV7RokfC9Y9njjDd2TMxDQN5fBbhigb9y2aqYG 4SuyLPnGvD1mIgTJ81ezdeXKrOreCfj+VU8zGO/Y= 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 5.4 056/453] USB: gadget: f_rndis: fix bitrate for SuperSpeed and above Date: Mon, 28 Dec 2020 13:44:52 +0100 Message-Id: <20201228124939.944846922@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124937.240114599@linuxfoundation.org> References: <20201228124937.240114599@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 @@ -87,8 +87,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