From patchwork Tue Jul 17 20:10:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10530517 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 16B15600D0 for ; Tue, 17 Jul 2018 20:10:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07007298B1 for ; Tue, 17 Jul 2018 20:10:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF4FA298C5; Tue, 17 Jul 2018 20:10:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9771F298BD for ; Tue, 17 Jul 2018 20:10:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730821AbeGQUox (ORCPT ); Tue, 17 Jul 2018 16:44:53 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:43394 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729759AbeGQUox (ORCPT ); Tue, 17 Jul 2018 16:44:53 -0400 Received: by mail-pl0-f68.google.com with SMTP id o7-v6so929141plk.10 for ; Tue, 17 Jul 2018 13:10:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=iFlZqAusiuiptPYJ+n9BZOWxMu3viScTErMsKjpysc0=; b=fEAbbkjRlVSifUuWZQyUvCVOLkBAOuCc85YBlRLRQwswqJdYl6AM1xIGAaCSq3TwGT XFBXNiG7+p5IJLFvS3r9aekU+uh+5wzGAQFWee364eD2nN/fqK4+9ynxLTIv55vzT1RQ aQhNFF9JT4rwl7geB3Kc4QRmUmy3UybLib7/g= 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; bh=iFlZqAusiuiptPYJ+n9BZOWxMu3viScTErMsKjpysc0=; b=ECbf5J070LBYEFxchrJlwzHO1bbODPh+W/CTDJAxROja9CY6cA1ScdJD6i7dB/BP9I VIWimxJ5Yq9E3SIJtLaXvg3YMIv+sIFif3v3ofi4FAwH67tk8gmn9inKQR8x0ultt2as 8BKIRabEwFFSeDwsE0mHsNLSsymQ0aEc4xzYVR2BqFyANDlUxMgy8kP9sKiZqJO9BICu I4rslR4GQ+aItsbSVUF8eA0gWbxxd85J2ilj5jvs96LOafgYQkwP3j0VYcQ0qo51lLBP Qlv1qIP2JLyMzqaozu+h6GGJCdcyZw01muMakh3eBCdT2Le4vUDLs9g+UfAm5zkZTtJY 5A3w== X-Gm-Message-State: AOUpUlFT9ZlYdjjhS2wzdt91KtU20Tp7B9G7aCmBSpYzYwq7xVhrI872 U1WsXm5Q+JfJORJZPYVCJDPZxg== X-Google-Smtp-Source: AAOMgpeA9pVCbKvSdEsWcZOAz8fa8ki2BgdpaaVQSfaDXyTNA7HDKc5C7ycLU8r4MHji0w6ikpslqQ== X-Received: by 2002:a17:902:a5:: with SMTP id a34-v6mr3052317pla.60.1531858239019; Tue, 17 Jul 2018 13:10:39 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:0:1000:1501:38e4:86fe:ec0c:4007]) by smtp.gmail.com with ESMTPSA id d26-v6sm4532746pfl.159.2018.07.17.13.10.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jul 2018 13:10:38 -0700 (PDT) From: Douglas Anderson To: Minas Harutyunyan , Greg Kroah-Hartman , Felipe Balbi Cc: dmitry.torokhov@gmail.com, Douglas Anderson , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] usb: dwc2: host: do not delay retries after successful transfer Date: Tue, 17 Jul 2018 13:10:10 -0700 Message-Id: <20180717201010.175491-1-dianders@chromium.org> X-Mailer: git-send-email 2.18.0.203.gfac676dfb9-goog Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dmitry Torokhov When handling split transactions we should not be delaying retrying SSPLIT/CSPLIT after we successfully communicate with the device, so let's reset dtd->num_naks counter when handling XFERCOMPL. Fixes: 38d2b5fb75c1 ("usb: dwc2: host: Don't retry NAKed transactions right away") Signed-off-by: Dmitry Torokhov Signed-off-by: Douglas Anderson --- Changes in v2: - Move clearing num_naks to the start to avoid use after free drivers/usb/dwc2/hcd_intr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c index 8ce10caf3e19..4e1953b2955e 100644 --- a/drivers/usb/dwc2/hcd_intr.c +++ b/drivers/usb/dwc2/hcd_intr.c @@ -994,6 +994,8 @@ static void dwc2_hc_xfercomp_intr(struct dwc2_hsotg *hsotg, int pipe_type; int urb_xfer_done; + qtd->num_naks = 0; + if (dbg_hc(chan)) dev_vdbg(hsotg->dev, "--Host Channel %d Interrupt: Transfer Complete--\n",