From patchwork Thu Nov 26 18:02:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 333034 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp1516724ilb; Thu, 26 Nov 2020 10:04:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+l9C97thdBeC6AyYJc4Wj6DE2vxUDeM47fok0eKWCtbjK+NFTD90iZYiry35zXIZ5EEj1 X-Received: by 2002:a17:906:a458:: with SMTP id cb24mr3750773ejb.321.1606413876680; Thu, 26 Nov 2020 10:04:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606413876; cv=none; d=google.com; s=arc-20160816; b=wqKiWw8cemLOM79ZpnNfqwlyYw7EnpsbXB0m9YA306dwGMPOpzZ7qGyWsFL0aL/7Xv xtkqufJgvAyMTCnUOIjbnM4ji5fjHgqkPoO7AR0kd+ygFLxO1ePYh17KOMH5wUqcPMyd EIaSctkdUNlEv5UdBKzwtE7QhC43WzBAEpwr18YXNSr7qYssgLYVv2HaT3BLqWVB4rcl +txRBsKars2gvWWMgqeQFP2BTmOOgEChz4nrB00YBdHR7PpL69LntNvA7RRQWkuRnUIF Vj/v83HEPcet2hNlgUxFxNY1175pLqy+Ad1Qr8Rcqjz61lBAbLG/AVXtqT4P/L9M1jMU ZILQ== 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 :message-id:date:subject:cc:to:from; bh=2Is2mbdj2e7cjnh1CBAo72fHpjHYzHh+dNnmFQbudQw=; b=GqmFlBPcZzLlwrolstv3MP7BeA5MY7jYJX5XpV/ZwVA8B8g5tRLzOUGOKyf+uTyDER PMHN8+f+gvFmvioGmSE9MmJ1NbN/cDwebMije3TC1dZmF0YcXk2OX3SqsKJcuTfwpXMr L67yon4fT5Nfef9uIVidaYjYr1MMUrluHBCE/RjpdTD1Xi9WEIFRJMzyrfczI6ejbOSh wgi4NOY+6hso6Nbj9iD0S4YYXMB9USYZqJqKqvGVaqiN6frDMnIROLQBZmJm7dEBexGj CUrNtKDv1jG44FVI9cBrWZMUmyfT8fCgygnkD+F96yyCrcJhrCok+4TDY18JgyBc9fKq poPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=fail (p=REJECT sp=REJECT dis=QUARANTINE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s3si3505960ejc.65.2020.11.26.10.04.36; Thu, 26 Nov 2020 10:04:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=fail (p=REJECT sp=REJECT dis=QUARANTINE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404622AbgKZSCp (ORCPT + 4 others); Thu, 26 Nov 2020 13:02:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:52790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404528AbgKZSCo (ORCPT ); Thu, 26 Nov 2020 13:02:44 -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 EC6E420B80; Thu, 26 Nov 2020 18:02:43 +0000 (UTC) From: Greg Kroah-Hartman To: balbi@kernel.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Will McVicker , EJ Hsu , Peter Chen , stable , Greg Kroah-Hartman Subject: [PATCH 1/4] USB: gadget: f_rndis: fix bitrate for SuperSpeed and above Date: Thu, 26 Nov 2020 19:02:32 +0100 Message-Id: <20201126180235.254523-1-gregkh@google.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@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(-) -- 2.29.2 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