From patchwork Mon May 4 23:12:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 186165 Delivered-To: patches@linaro.org Received: by 2002:a92:8d81:0:0:0:0:0 with SMTP id w1csp568695ill; Mon, 4 May 2020 16:12:19 -0700 (PDT) X-Received: by 2002:a63:88c7:: with SMTP id l190mr541596pgd.156.1588633939153; Mon, 04 May 2020 16:12:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588633939; cv=none; d=google.com; s=arc-20160816; b=N0jU3KfDa33LGlDToVCyRonHwIiHey1kKE+SP0MlPO5yIFZFQ8DuedbcFmxqLZP+In lY3p3eQZhxp0zcFqUycp4APJo8s4rJ6XHriVudfvLqyWzvV6WSb+RBN1b1rRH14JawnH xcJg56ZDkoTlqjcXMcTlCWM5T/4Ws6FuippEKx9gM7ii0eaU0xlC3M9r9SKMGvyEt9il oFh1724trshI2dZIAkJ8LPbPnxh/WaMGvIOqcUISbH4TDsNp/1MFm0ky200pg21DF4c4 Ql06yZ1a2EJONRurWtKXjyugp4Wa/coojxuHSg9v4g4pQ8eFH4oiqXPYwss+yc72FNnz AAyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=h46EDReUv1S1ATBaSl4X6yKFbL5PQevboB9D//kDD+k=; b=jcilTOmtYxPWbo9g+FtXhZLhwiThTf95TjmBvXSuFcXW2PrNZUa40OZWr3Nm/l5Nvb bUkmjJvAX5qO8AO8A5LuD1a8/MMqSRdob706kf4Dzi8QaHwZGdFvUk/TIbGLcdJo9kmL 8TRT6fwZ7aRl4PgfhPIj+FBCQSZnSFzbbT9X7eeA9h/KRsmlJ4abTwwmHOsvyR/CBHEF Fhu1qWAEL4r0GpSnK9YDVLdV2fBSi8Owar/9L/fp+Fu6Li/FYhGknZKt/0l2Z8ugcsJ6 HGgti1W1d7klsprjV35Pi+4WYlh23vvOhQCaaiiJPYHPYJa/RhEHsBWuasVKjrqFRmew AA9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xyaliD4O; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id w5sor654396pgb.35.2020.05.04.16.12.19 for (Google Transport Security); Mon, 04 May 2020 16:12:19 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xyaliD4O; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=h46EDReUv1S1ATBaSl4X6yKFbL5PQevboB9D//kDD+k=; b=xyaliD4Ok584TZG1EfQuKvA1CS0QaaSTFLv5YqnxSu7oVan9VyIOvVgszhDFsUZOgO lBRSEAaRfnsKPVy2d3fw02VbY3jbDVUHlWqijiJYRPQI080Ay0+Sw1rYmrSFGyg+nSW4 CtGwL9HBGfWLPCWkjtl5xDyQF7wiK1kN+rdJbOT5oVe/arvGK5ZL/BWX32qlg34nl/c1 awrQ0EJvv2BUZr6hJ2An4niDAHtO42d8bEcOtD1MjDPLtFiGcpsvSHfmcgESc/kI41Ov JnzTQcwT6ZKTvYjcsZ8kayOkEdjXzxqrD7BbrKmHKwx+HAYxsv74RGvrjPi8k9QnnLLk hfZQ== 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=h46EDReUv1S1ATBaSl4X6yKFbL5PQevboB9D//kDD+k=; b=NOEFrqAxo1wlYTV/knlLTAhfVCMKcwf8d2jxBbbP/SF1UezhuKUPA0/SpF5BMJfaJx zgqTV5aka1BdfIa+jgnyqoLGgzjcgRBx+pqR3cds4G1QFiYUpZ7m5TcMhunkIuraPIfY aVYUIFGKxOsIeshnYc4EYhSg8yVC7RhV0rzUobZXSc7k1+sdmnq5aJjjAYXlTDjianr3 YqPBpCjuUUTaKoxt9+nlU8kNPBe4ExtqCN8I0E+JW5uUBXnDUXDq5rGv9Jp13o74roZ+ xtbudOLiqsmIv1e1FWjJE2x78EOWE4OGGU755jm4uRraiNh63R1p1NnFZ6iySrPjh3ZZ jIbQ== X-Gm-Message-State: AGi0Pubsxh2/5TXlzwC8KWnbSigzjTtPNZurB7XYPYNzeZjuCwISb3Ih qQ2XegJ/81ck/Cbi3tJj6nPumtugYXgg5g== X-Google-Smtp-Source: APiQypKQgSB/Vffht7a4qUOaNUPHx8aJxH7d+fFEHtLffIrJKk+EXWHLsxzHL/CzPeeFIQX4QXtylw== X-Received: by 2002:a63:ff42:: with SMTP id s2mr534731pgk.410.1588633938678; Mon, 04 May 2020 16:12:18 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id e196sm160964pfh.43.2020.05.04.16.12.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 16:12:18 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , YongQin Liu , Anurag Kumar Vulisha , Yang Fei , Thinh Nguyen , Tejas Joglekar , Andrzej Pietrasiewicz , Jack Pham , Josh Gao , Todd Kjos , Felipe Balbi , Greg Kroah-Hartman , linux-usb@vger.kernel.org, stable@vger.kernel.org Subject: [RESEND][PATCH] dwc3: Remove check for HWO flag in dwc3_gadget_ep_reclaim_trb_sg() Date: Mon, 4 May 2020 23:12:15 +0000 Message-Id: <20200504231215.55956-1-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 The check for the HWO flag in dwc3_gadget_ep_reclaim_trb_sg() causes us to break out of the loop before we call dwc3_gadget_ep_reclaim_completed_trb(), which is what likely should be clearing the HWO flag. This can cause odd behavior where we never reclaim all the trbs in the sg list, so we never call giveback on a usb req, and that will causes transfer stalls. This effectively resovles the adb stalls seen on HiKey960 after userland changes started only using AIO in adbd. Cc: YongQin Liu Cc: Anurag Kumar Vulisha Cc: Yang Fei Cc: Thinh Nguyen Cc: Tejas Joglekar Cc: Andrzej Pietrasiewicz Cc: Jack Pham Cc: Josh Gao Cc: Todd Kjos Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Cc: stable@vger.kernel.org #4.20+ Signed-off-by: John Stultz --- drivers/usb/dwc3/gadget.c | 3 --- 1 file changed, 3 deletions(-) -- 2.17.1 diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 00746c2848c0..585cb3deea7a 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2483,9 +2483,6 @@ static int dwc3_gadget_ep_reclaim_trb_sg(struct dwc3_ep *dep, for_each_sg(sg, s, pending, i) { trb = &dep->trb_pool[dep->trb_dequeue]; - if (trb->ctrl & DWC3_TRB_CTRL_HWO) - break; - req->sg = sg_next(s); req->num_pending_sgs--;