From patchwork Thu Jan 6 15:02:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Bisson X-Patchwork-Id: 1576148 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=boundarydevices.com header.i=@boundarydevices.com header.a=rsa-sha256 header.s=google header.b=RpqU1nWU; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JV8js1NT9z9t0k for ; Fri, 7 Jan 2022 02:03:13 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D587683542; Thu, 6 Jan 2022 16:03:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=boundarydevices.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=boundarydevices.com header.i=@boundarydevices.com header.b="RpqU1nWU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F0D7283615; Thu, 6 Jan 2022 16:03:04 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3039883592 for ; Thu, 6 Jan 2022 16:02:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=boundarydevices.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=gary.bisson@boundarydevices.com Received: by mail-pf1-x42a.google.com with SMTP id m1so2752402pfk.8 for ; Thu, 06 Jan 2022 07:02:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boundarydevices.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ux5ym1Q14HCmttTyGiEN7l+/p9erCmm/yqNCS5ooqU8=; b=RpqU1nWUMjtijcSnlHT/Mv4+3Vnf48jGovvQWuu2OwcJHFETGZFF0DaTuf9cXyPzLr bo5xkPUFIrbZ9JNMWOID8Tpnta6JoCFnlaNlO21v5W/ugbte0gbTrVZLYe8qtzlKOlOH NnZtKYh+uzy8N4WZGKSlp384KqduopBV7AC9Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ux5ym1Q14HCmttTyGiEN7l+/p9erCmm/yqNCS5ooqU8=; b=qQaUE8u0A456+EhdthJUti063SjGiaRLMG5JmIAo0Sb87qnstqdVPyCd8oi9/xh0Vu WpLKLjjtMIFvtj+wtRt4Fp0BHzgzF+hEgAYnsgCTqfKn5xRUgniNCodWLBP4RIZfeTdb VLptC9wofpuv6HsiVUE0OZXfoTm78uIJ+gGzcNuPgB4w4qWO1m7gdd3EagwLhdxWA5So 3zQ/Uz1YAp+NKZ6f1i0YEsgIGoTUr72ccw69zk1P+8Dd1NGQ8SnCnz0gm9iILlQ7N2bJ ucokpTVSmXLYIrjYLSt40M7Sy49V2nRlv/S6SLLhk6kW3Y5MYn3NnH7KbqxnSjGftC3F XBAw== X-Gm-Message-State: AOAM5325zpfOb0xFAe1H0w2VPPYmf4bGzTmrz9a06E6Cjk3D56kZwPGQ RVLzto5qsclywSg7/z0WZYvAfx2hopRRrQ== X-Google-Smtp-Source: ABdhPJz95ZHXyqk3fZ0TI6JJ+b6il/KTISaeBvLxqfr0lPQEhbAV4aF9bfEPnbEARaEgPTl08D4JdQ== X-Received: by 2002:a63:4186:: with SMTP id o128mr52356696pga.450.1641481376864; Thu, 06 Jan 2022 07:02:56 -0800 (PST) Received: from localhost.localdomain (lfbn-idf1-1-1088-186.w82-125.abo.wanadoo.fr. [82.125.191.186]) by smtp.gmail.com with ESMTPSA id f125sm2847684pfa.28.2022.01.06.07.02.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 07:02:56 -0800 (PST) From: Gary Bisson To: u-boot@lists.denx.de Cc: lukma@denx.de, marex@denx.de, peter.chen@nxp.com, jun.li@nxp.com, peng.fan@nxp.com, narmstrong@baylibre.com, Gary Bisson Subject: [PATCH] usb: gadget: dwc2_udc_otg: set ep's desc during enable/disable Date: Thu, 6 Jan 2022 16:02:08 +0100 Message-Id: <20220106150208.1316946-1-gary.bisson@boundarydevices.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Fastboot support has been broken on platforms using dwc2 controller since the gadget gets its max packet size from it. This patch is the equivalent of 723fd5668ff which fixed the same issue but for the chipidea controller. Fixes: 27c9141b111 ("usb: gadget: fastboot: use correct max packet size") Signed-off-by: Gary Bisson Reviewed-by: Neil Armstrong Tested-by: Mattijs Korpershoek --- drivers/usb/gadget/dwc2_udc_otg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c index 2f318144421..fb10884755b 100644 --- a/drivers/usb/gadget/dwc2_udc_otg.c +++ b/drivers/usb/gadget/dwc2_udc_otg.c @@ -655,6 +655,7 @@ static int dwc2_ep_enable(struct usb_ep *_ep, return -ESHUTDOWN; } + _ep->desc = desc; ep->stopped = 0; ep->desc = desc; ep->pio_irqs = 0; @@ -695,6 +696,7 @@ static int dwc2_ep_disable(struct usb_ep *_ep) /* Nuke all pending requests */ nuke(ep, -ESHUTDOWN); + _ep->desc = NULL; ep->desc = 0; ep->stopped = 1;