From patchwork Tue Oct 27 13:56:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 312537 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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, 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 5AC92C8303D for ; Tue, 27 Oct 2020 15:43:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 07C3E2245D for ; Tue, 27 Oct 2020 15:43:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603813432; bh=Tvu2p9Pi8z1YiEfClLPGGISIx6HNTdHeQPv//3cQMlE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=yiK0UG6iUXeEJR/WANS3UbfjzR2R4jnGGF9m50f1O59Hd7CVGZtasn49Fga/UEnND 8tB/qtCgPaIsX6KbxisEyKiOUC1oCeWwZEI0cWbooJq5DJV2zSI7qtxHbNnvGQAOHr yNc/MsWfFsJ4cFLjDLNLE+lQYP8RhhraZdxAYt44= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1796318AbgJ0PRT (ORCPT ); Tue, 27 Oct 2020 11:17:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:54536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1796301AbgJ0PRO (ORCPT ); Tue, 27 Oct 2020 11:17:14 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 4748F2225C; Tue, 27 Oct 2020 15:17:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811832; bh=Tvu2p9Pi8z1YiEfClLPGGISIx6HNTdHeQPv//3cQMlE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F+AWv7lbJ6LfAOVdzswxbIAXkzSnCJZGIEzCWK4QmAUIwIjYsxjTZDwUGp+vvljAW JzAZerngEb5lYoMckDyDX/yG0BIahpekpAPWQ9haL1DD3PB+hshvszOFjwCBZ1VyLI r9y/ISSOGe0uVacZd2tXxrjdSRq+7bRlwOm+spHc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?utf-8?q?Maciej_=C5=BBenczykowski?= , Lorenzo Colitti , Felipe Balbi , Sasha Levin Subject: [PATCH 5.8 633/633] usb: gadget: f_ncm: allow using NCM in SuperSpeed Plus gadgets. Date: Tue, 27 Oct 2020 14:56:16 +0100 Message-Id: <20201027135552.515673673@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Lorenzo Colitti [ Upstream commit 7974ecd7d3c0f42a98566f281e44ea8573a2ad88 ] Currently, enabling f_ncm at SuperSpeed Plus speeds results in an oops in config_ep_by_speed because ncm_set_alt passes in NULL ssp_descriptors. Fix this by re-using the SuperSpeed descriptors. This is safe because usb_assign_descriptors calls usb_copy_descriptors. Tested: enabled f_ncm on a dwc3 gadget and 10Gbps link, ran iperf Reviewed-by: Maciej Żenczykowski Signed-off-by: Lorenzo Colitti Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin --- drivers/usb/gadget/function/f_ncm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c index 7672fa25085b0..92a7c3a839454 100644 --- a/drivers/usb/gadget/function/f_ncm.c +++ b/drivers/usb/gadget/function/f_ncm.c @@ -1536,7 +1536,7 @@ static int ncm_bind(struct usb_configuration *c, struct usb_function *f) fs_ncm_notify_desc.bEndpointAddress; status = usb_assign_descriptors(f, ncm_fs_function, ncm_hs_function, - ncm_ss_function, NULL); + ncm_ss_function, ncm_ss_function); if (status) goto fail;