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: 334008 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, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 CF934C64E7D 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 9ED9F20B80 for ; Thu, 26 Nov 2020 18:02:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404635AbgKZSCu (ORCPT ); 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: linux-usb@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(+) 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;