Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp395228ybb; Sat, 28 Mar 2020 01:29:38 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsd0X9dI9f0m4FX8RiNnx/4vHIogwfvtmacPOhHbIO1FiyOf3vVlrxuDhMYp+CSm1dcSKrc X-Received: by 2002:aca:a9d4:: with SMTP id s203mr1861334oie.106.1585384178035; Sat, 28 Mar 2020 01:29:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585384178; cv=none; d=google.com; s=arc-20160816; b=dO8YPf81B2C+qcTqLv6R7bw8E4dTwB2oR4OJ9d9GTbGfBwCzSsuXBY4BNoNd4XIrRX Twt5k5EcNo/jr/86EsmcjEQPq84gLsmppTHPpT3jbPWWJm+/cMNR0GSjxV/mi/NQEBJp tGE/rKfyLMjx98z2GiXGk4GjhbbzkpkNiVbmlno+H1jZ1eyk8QZP/4ko44aX5ygvPMXK Vh3GMkwbuh6AXrAPUXx30h+rdNHcVjYHHPP+sEpek9ENG3YBxvTAvzq+/2Wq3N67Hm/E r/R0uUjxzWsr0fRFRgdo5Pi0EgmEf9tmvUe1XyjHmzW1baRQfWPLJ+vFFaQ1r938sVI5 Jxpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=kUuQzPOK0FDsYyqkv2vYZA3Ue/aoYacm6ACiG7IOKZo=; b=kZXjtGQqK6E5CN/XFnU70x6yBvrLo2/f4UEEyrESH2wgANtfamHXzT73AV/x0+52su pxxiZNWR9//Xw2Xx+mQQgRRJAPPf3f/xlEv5ap1owdJtXYQMshkqvAyG0Af6KmFWSPgb mRq/87H5eS3AOyW8rHp1oeJP+ypUIvw4yPGc/douRW8+JvnxkA1tq0QnzIOUYAFC8btu 5HYIs1bJjNpmQmtTKYuHsdNpTeec/zkx5Rr0Mp+99rKifX69roESqF41N8QksZXtxc2V mSoEWs4gofEEimRLxnNavwxOCcTQiE065U2hqf3Ra0mOPCaCXpPK+2ZKpfkc7s7DORfw a2FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=D3ovAOvg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z204si3571687oiz.133.2020.03.28.01.29.24; Sat, 28 Mar 2020 01:29:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=D3ovAOvg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726282AbgC1I16 (ORCPT + 99 others); Sat, 28 Mar 2020 04:27:58 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:45338 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725937AbgC1I16 (ORCPT ); Sat, 28 Mar 2020 04:27:58 -0400 Received: by mail-lf1-f68.google.com with SMTP id v4so9765340lfo.12; Sat, 28 Mar 2020 01:27:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=kUuQzPOK0FDsYyqkv2vYZA3Ue/aoYacm6ACiG7IOKZo=; b=D3ovAOvgBPe1CBTNw3mm9a3KZ5CXPEA+l4jXGk7Th35AJzgeDqNkIuGm+rxRnjPUSF M4oEtFRfmz3NVWJ9dOOxo1Ka4WSvdLi35rEbwxQC/lT9fmBxRJ7hc5pekk7ZmyAVHm/b IdUMYN59IJrHO/+xsBROIf05zeqd1lDE6Alw3gKtOsI3+bJOzdQwVtn2MoKySl8Bdx7z 1x2Q0xEMI7nalpj3fcIjeDm0mfMKRUAA16YIulw3f3ESbmmS3z2/YO0EDNkzrTaEJQJe MHFu5qGfNadhjHU8YUBIHrLduCG8wIHlQ2p8NJ0RMH9mXwrcnz7W/gO5AnK/4SVkZGKS hUcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :date:message-id:mime-version; bh=kUuQzPOK0FDsYyqkv2vYZA3Ue/aoYacm6ACiG7IOKZo=; b=NIlR0uCug2kghEe09Xs6cAnCTLnE+ntQvGyF19xkavIyNIlOveZXjpzlJg+I4svZ6m SS3Vur8NhOEG1qCdwDoxWjoWGrnM3665Alb3kxHdyAJK8j/oCykmuargE74OVQ//BxrP HvFe538wj69WZpwOgiUq/uo6btKx20vABFgYTwIAGtQ234ZPCkfPe1pMyB02U9+QA0ej YAzHI58aHo/NPF9+IiyCOFlRbJKCa/XG7L7E4dwx9KJwmV1aFmzzb5ULoWZbx7QCbc1i 3SuHl3bzGPa9CBku7wZPrM9oVADBzxv4keZ6+HBHURfLx+O4FSuTvLVtU+8FMQRKIpPu ZbJg== X-Gm-Message-State: AGi0PuYQ2dzySgNKmWR/iNK2V+xJ1Mk5afr4tJeP5EOVncQIGbA/kzVv jR0kDYpydIb3JKDX1sNfrVNneW0D/FJkng== X-Received: by 2002:a19:f606:: with SMTP id x6mr2094056lfe.44.1585384075257; Sat, 28 Mar 2020 01:27:55 -0700 (PDT) Received: from saruman (91-155-214-58.elisa-laajakaista.fi. [91.155.214.58]) by smtp.gmail.com with ESMTPSA id n7sm4030919lfi.5.2020.03.28.01.27.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 28 Mar 2020 01:27:54 -0700 (PDT) From: Felipe Balbi To: Michael Grzeschik , lars@metafoo.de, alexandru.Ardelean@analog.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, bigeasy@linutronix.de, m.olbrich@pengutronix.de, kernel@pengutronix.de Subject: Re: [PATCH] usb: dwc3: gadget: don't dequeue requests on already disabled endpoints In-Reply-To: <20200327084302.606-1-m.grzeschik@pengutronix.de> References: <20200327084302.606-1-m.grzeschik@pengutronix.de> Date: Sat, 28 Mar 2020 10:27:49 +0200 Message-ID: <875zeokhoa.fsf@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Michael Grzeschik writes: > dwc3_gadget_ep_disable gets called before the last request gets > dequeued. > > In __dwc3_gadget_ep_disable all started, pending and cancelled > lists for this endpoint will call dwc3_gadget_giveback in > dwc3_remove_requests. > > After that no list containing the afterwards dequed request, > therefor it is not necessary to run the dequeue routine. > > Signed-off-by: Michael Grzeschik > --- > @Lars-Peter Clausen: > > This patch addresses the case that not queued requests get dequeued. > The only case that this happens seems on disabling the gadget. > > drivers/usb/dwc3/gadget.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > index 9a6f741d1db0dc..5d4fa8d6c93e49 100644 > --- a/drivers/usb/dwc3/gadget.c > +++ b/drivers/usb/dwc3/gadget.c > @@ -1609,6 +1609,9 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep, >=20=20 > trace_dwc3_ep_dequeue(req); >=20=20 > + if (!(dep->flags & DWC3_EP_ENABLED)) > + return 0; which driver is trying to call dequeue after the endpoint is disabled? Got some tracepoints of the problem happening? =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEElLzh7wn96CXwjh2IzL64meEamQYFAl5/CoYACgkQzL64meEa mQY47A/9F0MvaAz3S1tMcdQ9GJzZkykuDn0kwTsSU8Q03UGPUlJlD99/JvfdpFtU uqdQMdgQf6NTxQvsE5GPyjkP0nVp8EwUEV+YdeM4hHLumSUEwHtYipQpSVkyUkVK fpj6wP3Nt0z9OgLtJYAS4PR6nbd14MF7nAejWHO0hNkEjX01i7+KTtOyebyIVTQn +FkA21J5g5rRyuacjWTc+X+YeCxxCcEFOP8SmdBPOAjeFCH63A5HQKb42BZgXb6o KkKKClpWX1oq52jB6vukgN9dMqkpC/0OlfP+eXI/sfkNN8115Z2/oZvAt3fiww2F vYcWSN9PF+Ce5rL/8Y130LHuSABEJ/bg7QD1cM82HRjSkkjzuhh3cbqJAm8dQEPM 19UgTemKsFY813EhyO0xZehh7AZ7OaqQihv/1ZjYxF6Y9+PuZkrw82I/TX52BeBx MUaBzTkBxpkyUJUoiQpi5n2lcnsntqjaS0tRgQWgd9+mvkipVn/YfT0tqT7fyRvC Nh6z5miQxKOUov8XRKWxseEk3PhuUdLsjgBBs4xmMy8/C74TGERTh0g/mV2iRq8i /7r2sRoG8EvMQ0M4ABfH8Bsgmv+eSmpLVLQM8JcjgaoZeKp+V2O1MM1oJLabot7o 3y//MzQhRQyNhKqUac4syozGE/Bc+0Ox3SxErjR/N3N/W+073GY= =0Q4s -----END PGP SIGNATURE----- --=-=-=--