From patchwork Mon Dec 28 12:48:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 354266 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_RED, 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 0210FC433DB for ; Mon, 28 Dec 2020 16:39:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD2DD2245C for ; Mon, 28 Dec 2020 16:39:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730006AbgL1QjY (ORCPT ); Mon, 28 Dec 2020 11:39:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:56074 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729424AbgL1NAM (ORCPT ); Mon, 28 Dec 2020 08:00:12 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BB42722573; Mon, 28 Dec 2020 12:59:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160397; bh=DE3cR/WXTTulpqmIcWjEFEhHP2EW4aJJyfdFm0vLJWE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aqL7HrUgc84vjW84d5QolGQ7rsuxnvpX2TsBV4AmJYd3HdZxPMrgz4UdssYO5zzsl W7qeTruG+dKrRywnBmbXIUbK+abVFsQeEHJAZfLLq15A6qWeoL6Gy4E+1R//odrqmp CMzny94APNqzqM1LQbWQ+H3bXxjG0jDi7qUavSyU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Felipe Balbi , Will McVicker , Peter Chen Subject: [PATCH 4.9 038/175] USB: gadget: f_midi: setup SuperSpeed Plus descriptors Date: Mon, 28 Dec 2020 13:48:11 +0100 Message-Id: <20201228124855.092762987@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124853.216621466@linuxfoundation.org> References: <20201228124853.216621466@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Will McVicker commit 457a902ba1a73b7720666b21ca038cd19764db18 upstream. 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 Reviewed-by: Peter Chen Link: https://lore.kernel.org/r/20201127140559.381351-4-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/function/f_midi.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/usb/gadget/function/f_midi.c +++ b/drivers/usb/gadget/function/f_midi.c @@ -1008,6 +1008,12 @@ static int f_midi_bind(struct usb_config f->hs_descriptors = usb_copy_descriptors(midi_function); if (!f->hs_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);