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: 333590 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54F1FC64E7A for ; Thu, 26 Nov 2020 18:02:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2B0E5207BC for ; Thu, 26 Nov 2020 18:02:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404619AbgKZSCp (ORCPT ); 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: stable@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 From patchwork Thu Nov 26 18:02:33 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: 333033 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp1514759ilb; Thu, 26 Nov 2020 10:02:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwOTiFjHPA6BY9ZNczyL7PS1QEB0KbtFubWiFxIZTXIv6bDFxtetGl8JsAQh3TWM2gr08BM X-Received: by 2002:a17:906:2e82:: with SMTP id o2mr3892735eji.106.1606413763489; Thu, 26 Nov 2020 10:02:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606413763; cv=none; d=google.com; s=arc-20160816; b=yErCkQEA9ltK2rV7MsdD/w3ubsMQPvBoM/Uj22om1xSY8IuW1bh8QUZUYwkbSbgeF+ XCUpV0RVwr2ltveZDZlINJ1muu/sDzcx7rJyIaxcXgY1s2jrdltHRaV/9qbzHIwrhuFA +ggeGEdXt9mMTsQwmEiHYS6cx6LIau7TrE0VRDUKpww8R+yUr4/t9pZiPdPF7VacA+BD faKlqCKJQM540HOiEPr7EzMWJfK8vD7vwt1JtUp4sNber9126bZiR+06ID2efcSW56AA P+bYFc2Y7tgJqlAgh8pg0db5+xQzVDrGxQ1MgqvrsbLaQz3IqivwLXSaFnFep3VQ+kSt RKiA== 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; bh=etutvXuY14C0d94WJ0fvlLeW3eXUaxduhen4EUyaL30=; b=ubcdvo0wNfm7gBZ6DNgHU/5xKDFRjSaHe0tJ5l+5ntLSp/JsnlTfLLwu784+kI9H9Y rDARS1aRPO/6aXNXy4hcrFtUS+D9ndViceF1ckzwt0O0puJTeDnpOalXCMxzc+g+h5JI mrDyzO08RoRmDaGzApztps2PhxzC062+DocFZAMrMj/guHerqCTfJobdt6ntzcGJRRi0 N84bcqE4U1xecrbWUoB5rZv/yxrPAfhnH1Cl7GAD0StQF9HzJY3ypYJpmuXAVvjTIyB+ /ydgbgNqcAe0Sns/lDhGveqRXeONFwq4/CalHKb/PijNf3H4uVl7zVHk7I1Mdw4sPQAq 9yIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 a21si3088853ejk.367.2020.11.26.10.02.43; Thu, 26 Nov 2020 10:02:43 -0800 (PST) Received-SPF: pass (google.com: domain of stable-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 stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S2404588AbgKZSCm (ORCPT + 14 others); Thu, 26 Nov 2020 13:02:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:52762 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404528AbgKZSCm (ORCPT ); Thu, 26 Nov 2020 13:02:42 -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 9C703207BC; Thu, 26 Nov 2020 18:02:41 +0000 (UTC) From: Greg Kroah-Hartman To: balbi@kernel.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, "taehyun.cho" , stable , Will McVicker , Greg Kroah-Hartman Subject: [PATCH 2/4] USB: gadget: f_acm: add support for SuperSpeed Plus Date: Thu, 26 Nov 2020 19:02:33 +0100 Message-Id: <20201126180235.254523-2-gregkh@google.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201126180235.254523-1-gregkh@google.com> References: <20201126180235.254523-1-gregkh@google.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: "taehyun.cho" Setup the SuperSpeed Plus descriptors for f_acm. This allows the gadget to work properly without crashing at SuperSpeed rates. Cc: Felipe Balbi Cc: stable Signed-off-by: taehyun.cho Signed-off-by: Will McVicker Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/function/f_acm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.29.2 diff --git a/drivers/usb/gadget/function/f_acm.c b/drivers/usb/gadget/function/f_acm.c index 46647bfac2ef..349945e064bb 100644 --- a/drivers/usb/gadget/function/f_acm.c +++ b/drivers/usb/gadget/function/f_acm.c @@ -686,7 +686,7 @@ acm_bind(struct usb_configuration *c, struct usb_function *f) acm_ss_out_desc.bEndpointAddress = acm_fs_out_desc.bEndpointAddress; status = usb_assign_descriptors(f, acm_fs_function, acm_hs_function, - acm_ss_function, NULL); + acm_ss_function, acm_ss_function); if (status) goto fail; From patchwork Thu Nov 26 18:02:34 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: 333035 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp1516741ilb; Thu, 26 Nov 2020 10:04:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9i0ZFH6GNLB3xMXXL11qs++ecI/e65In97OCVChMB/E1whGWkYfJ7i+OtL94m03AMFPfc X-Received: by 2002:a17:906:8282:: with SMTP id h2mr3741922ejx.50.1606413877542; Thu, 26 Nov 2020 10:04:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606413877; cv=none; d=google.com; s=arc-20160816; b=u1XAMWAerQiHuc+crvnPpnXX4uA2zZf3w/mHbPg0xh3MccKOoP856SFV7H+ii+6h5x CIBZxwQ/FQof4ejGNZfKY/iU0CVo9ITUXYJUKC1lxlCyNASf/6CTH2rlL0cgR6zHNEPC DvM5/HtE6L9FZOfA5wlxqjR9bXt7fg6gCqZ20zDnb7CnJx0uHPaZkgB+D4WhFsNAWZFz S0iGYkOc6PzGqFImj78+BrRTnN4Jkh8OaIaHYgspwobU9ozLNht6sNU5DrCUwv+kR7c8 IEXOOQB3gAJriv4NGoUMr0WZT8WUYraacDNmaLyoQNQj4UcnRz9NN7TDeym+4Ksr1T0J gEDg== 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; bh=3BbYB8jyVtVzmYukMQTJC6VVQm7K3N+IaNm1izmdICk=; b=rEojoHsXX12pgXM7yCUilKhDY+N7rCKYAAjmKlobfjfMZ36rkWPe1BaFDXm1CbJc98 tw0Krf9iBf++NOs2ojXvgisjOSBEjuRwSI5OSM+gK11/0R/5i6Fe7Bq3A72w1sCMueYT wBtnYtBv97ZgCkm2CBrbWTxSt+6kNBPMgiCbWKyT8EC3BrBBX2WvQ09RHIBi1K1QghPw u52lK09I8QMSUeMF+zoPX13K4Dv6VShc06T3iYJmme2lJv1JOaHKH//Zct5AeA0EqQNq uVx8eD7cV/lpgRJnOOHtniPpVLIXAuvOa/vlwzs/JYnCan5FNOTGDbYtDgSNZGCXslB+ CO1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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.37; Thu, 26 Nov 2020 10:04:37 -0800 (PST) Received-SPF: pass (google.com: domain of stable-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 stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S2404630AbgKZSCu (ORCPT + 14 others); Thu, 26 Nov 2020 13:02:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:52918 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404528AbgKZSCu (ORCPT ); Thu, 26 Nov 2020 13:02:50 -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 3C73B21D81; Thu, 26 Nov 2020 18:02:49 +0000 (UTC) From: Greg Kroah-Hartman To: balbi@kernel.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, "taehyun.cho" , Peter Chen , stable , Will McVicker , Greg Kroah-Hartman Subject: [PATCH 3/4] USB: gadget: f_fs: add SuperSpeed Plus support Date: Thu, 26 Nov 2020 19:02:34 +0100 Message-Id: <20201126180235.254523-3-gregkh@google.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201126180235.254523-1-gregkh@google.com> References: <20201126180235.254523-1-gregkh@google.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: "taehyun.cho" Setup the descriptors for SuperSpeed Plus for f_fs. This allows the gadget to work properly without crashing at SuperSpeed rates. Cc: Felipe Balbi Cc: Peter Chen Cc: stable Signed-off-by: taehyun.cho Signed-off-by: Will McVicker Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/function/f_fs.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.29.2 diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index 046f770a76da..a34a7c96a1ab 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -1327,6 +1327,7 @@ static long ffs_epfile_ioctl(struct file *file, unsigned code, struct usb_endpoint_descriptor *desc; switch (epfile->ffs->gadget->speed) { + case USB_SPEED_SUPER_PLUS: case USB_SPEED_SUPER: desc_idx = 2; break; @@ -3222,6 +3223,10 @@ static int _ffs_func_bind(struct usb_configuration *c, func->function.os_desc_n = c->cdev->use_os_string ? ffs->interfaces_count : 0; + if (likely(super)) { + func->function.ssp_descriptors = + usb_copy_descriptors(func->function.ss_descriptors); + } /* And we're done */ ffs_event_add(ffs, FUNCTIONFS_BIND); return 0; From patchwork Thu Nov 26 18:02:35 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: 333036 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp1516768ilb; Thu, 26 Nov 2020 10:04:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJwc6et6cL7svmPhQE4hrxTEVDrUsy6LkZ9yci9wveF9HKMjd6J1PuF3RTtiYN6EWwVB8EIn X-Received: by 2002:a50:f682:: with SMTP id d2mr3723295edn.95.1606413879068; Thu, 26 Nov 2020 10:04:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606413879; cv=none; d=google.com; s=arc-20160816; b=AYRB2oU1WWG5Nu9//RbK+BPWIkFuwECCeXN6DEL07+11ckbazqlD1HJZi/0uat9RCc EH2nV3jhOwlskpH8KaJHCOSFMvgnVKxSXxanhscnLxrE1fov/uJ1E875o5uefCKic3cT dyukfMPeK1JAq2fyBcJzxpAxwUhZ5KlH9tpnPLa9mTn2mp7maxhM1Zx10I4fyFy4DTsk s1f1cLQs5IANFpI2vyfJJvFtSeTiPbc167CUb6tKtebUAESdyP7NREAliNXczICzCZQz aAezGYPzSjaQnNbfVRrFr3hKsQMngZcW/U5lu74X753qvHe2Th1QrpcMDPeGG3+uNvVt QWjA== 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; bh=iRaoLE2Nv/3zZDzc7xxNOsjc9OQHX008zESaLawlQfk=; b=adsOGsb6iP9j+KkVxKl3h2L/7kATtASAq4phVuxdbAxvzV7oDgPA7O6sevQ1lxY+rM Tk2XqLBdxFQ1SQk6AQsVztEG2ZqvkkFgAQiExji2MH946ppIb5yBEWWzPD2gGe84E8Tr HJPOyYKtNhTFgB9p/k0P6LAnDumBd/3nv1KYgA7S11EWC0C5MUaaQMKQNYFp8dtQcORC sr3faCtcA5QdzVcW3QhD66E9FMKYM3doXABm2kYGcQDenAaIWH9Db4pC1vTWnKaXrMx+ Saw24pV/ioBrQAjQQh/VYrf8Tn/+HLhzLmm3jK9NK70GY1ZtfscapfSNe0YJCJhOZJkU kBFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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.38; Thu, 26 Nov 2020 10:04:39 -0800 (PST) Received-SPF: pass (google.com: domain of stable-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 stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S2404641AbgKZSCw (ORCPT + 14 others); Thu, 26 Nov 2020 13:02:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:52952 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404528AbgKZSCw (ORCPT ); Thu, 26 Nov 2020 13:02:52 -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 95207207BC; Thu, 26 Nov 2020 18:02:51 +0000 (UTC) From: Greg Kroah-Hartman To: balbi@kernel.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Will McVicker , stable , Greg Kroah-Hartman Subject: [PATCH 4/4] USB: gadget: f_midi: setup SuperSpeed Plus descriptors Date: Thu, 26 Nov 2020 19:02:35 +0100 Message-Id: <20201126180235.254523-4-gregkh@google.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201126180235.254523-1-gregkh@google.com> References: <20201126180235.254523-1-gregkh@google.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Will McVicker Needed for SuperSpeed Plus support for f_midi. This allows the gadget to work properly without crashing at SuperSpeed rates. Cc: Felipe Balbi Cc: stable Signed-off-by: Will McVicker Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/function/f_midi.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.29.2 diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c index 85cb15734aa8..ceb67651de4f 100644 --- a/drivers/usb/gadget/function/f_midi.c +++ b/drivers/usb/gadget/function/f_midi.c @@ -1048,6 +1048,11 @@ static int f_midi_bind(struct usb_configuration *c, struct usb_function *f) f->ss_descriptors = usb_copy_descriptors(midi_function); if (!f->ss_descriptors) goto fail_f_midi; + if (gadget_is_superspeed_plus(c->cdev->gadget)) { + f->ssp_descriptors = usb_copy_descriptors(midi_function); + if (!f->ssp_descriptors) + goto fail_f_midi; + } } kfree(midi_function);