From patchwork Tue Jun 8 04:42:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Maciej_=C5=BBenczykowski?= X-Patchwork-Id: 456336 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 64309C47082 for ; Tue, 8 Jun 2021 04:42:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4252261263 for ; Tue, 8 Jun 2021 04:42:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229536AbhFHEoT (ORCPT ); Tue, 8 Jun 2021 00:44:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbhFHEoT (ORCPT ); Tue, 8 Jun 2021 00:44:19 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 233BDC061787 for ; Mon, 7 Jun 2021 21:42:12 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id k7so11146903pjf.5 for ; Mon, 07 Jun 2021 21:42:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZMsvU3fKoubbU8qmsenuy5RIoCMUqHrHUOqVh+OSU5g=; b=TGpYDNqx55JjPj6skb4523PrVZHBn3UJiYn7m1gWU/bSHyKJU17mkXd/eEhT1YXjfP xs0eM4vIvP5pqW72lnUgnVH13WD0NWROd5HmYe1OmdNjXBzerGj2Xs01uJX60dwYComf xnW6O3GswMptfdnjVs4olAHrH2oEUooUPUZ599mNy9fkBIDG5LEY+Svc3lxS9x39D3nA 0qxdi+jDV87yrRmxZNUv23njeqxVHaP6Is9CUJ0Cs7C7vhu49snHA63jbgj3EVhdoSEi 5RrC1IgIcXojsbEh28PujUNKE7nMPg8EvPZe9o8lArE2Mv8hfaPBlsl2dtJQN9hLGd/n nvkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZMsvU3fKoubbU8qmsenuy5RIoCMUqHrHUOqVh+OSU5g=; b=GNoG/+0p56SVJ3bF1cZE6RAIL6AmiIA0X7HeqajBFBEXtKWJQA/Kt8VK90HlHUa9vE Nlk172Ts6FEeuSjifiozcsSKqkyjwbPPDNLq9IznOVUM2Nvb0kQl7F6FmsfGBmoJPTO3 bDWoBBal/KJKK55+lu5LAS+VDo24WExs6xjXjB1HNaNwLOcJAJrEz4c5E6ax1h2/HQT8 haKZ571zxZ90zN5QYYrbNIPKqP/qKILy534/EODVtPqUesgYrTbf6fcG5U/bndtFuEyl L4hRlgtM4MquRKAHeygrvB46Z7vzspPZtJWjTVFGAuPOl/hWgk1PIAUdJ+IPfhA1XmDE 9qVg== X-Gm-Message-State: AOAM531qnXWwb39qg1OrixBB0BDlrHk5L5E2hOnyzlKy8mrGyOgclUmO xOO2S4/hu+NqL8OFYve4H0Y= X-Google-Smtp-Source: ABdhPJytryDhq+qUx2Fg/Wm2Ffm/mJIzHC/vUyRTkwgNb/66an9LNPvh2F28BX6osnL9vRZFyD+Ilw== X-Received: by 2002:a17:902:e849:b029:114:1fab:b9e1 with SMTP id t9-20020a170902e849b02901141fabb9e1mr2329194plg.76.1623127326061; Mon, 07 Jun 2021 21:42:06 -0700 (PDT) Received: from athina.mtv.corp.google.com ([2620:15c:211:0:34c3:22d8:b92a:ddfa]) by smtp.gmail.com with ESMTPSA id 30sm9923521pgo.7.2021.06.07.21.42.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 21:42:05 -0700 (PDT) From: =?utf-8?q?Maciej_=C5=BBenczykowski?= To: =?utf-8?q?Maciej_=C5=BBenczykowski?= Cc: Linux USB Mailing List , Felipe Balbi , Greg Kroah-Hartman Subject: [PATCH] usb: fix various gadget panics on 10gbps cabling Date: Mon, 7 Jun 2021 21:42:01 -0700 Message-Id: <20210608044201.3898589-1-zenczykowski@gmail.com> X-Mailer: git-send-email 2.32.0.rc1.229.g3e70b5a671-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Maciej Żenczykowski Cc: Felipe Balbi Cc: Greg Kroah-Hartman Signed-off-by: Maciej Żenczykowski --- drivers/usb/gadget/config.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/gadget/config.c b/drivers/usb/gadget/config.c index 8bb25773b61e..d624f9f57f34 100644 --- a/drivers/usb/gadget/config.c +++ b/drivers/usb/gadget/config.c @@ -164,6 +164,10 @@ int usb_assign_descriptors(struct usb_function *f, { struct usb_gadget *g = f->config->cdev->gadget; + /* In most cases this is good enough as a default */ + if (!ssp) + ssp = ss; + if (fs) { f->fs_descriptors = usb_copy_descriptors(fs); if (!f->fs_descriptors)