From patchwork Thu Apr 23 22:08:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 185746 Delivered-To: patches@linaro.org Received: by 2002:a92:3d9a:0:0:0:0:0 with SMTP id k26csp2597942ilf; Thu, 23 Apr 2020 15:08:53 -0700 (PDT) X-Received: by 2002:a5d:9c02:: with SMTP id 2mr5797694ioe.67.1587679732952; Thu, 23 Apr 2020 15:08:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587679732; cv=none; d=google.com; s=arc-20160816; b=K1rmxl7p5T7iSEnwAdVhHwrQeA1slGqPm/QE5F9k9kXRWVhtzViBKK62UgAa5xr/J5 G/6EJOIk6IRfZAIy5D7wpSa96P5sFnuzA2hynFAoGIEStBkouetOIBOxNd0Zqg+TPMa7 5/nw62XBjFRv0iwZbvhz8P9lpgLl2mgHEYrN3T3FkTCvVp7yNqvzFltkTQw/2sDBX/rj HRDuR6rRmODHSdoXKfxg5I5pRlAIwuCd5CeZcD0z9BcEfoj94lqUHC9c5lHzqp+wmBUG 8fHa/BIMgAgMt9maBiirvnkUJrWg/sfB+qIqnelmFH/8n7sOvl/WZQWu/K4sX9hnDirL TYjA== 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=K+G1+PwcxmC0bvv5uLFnP0XXhpkYqmxl+rnFEl1fK8A=; b=br8pqlszoe2mBm/gYfy500GoWCtzqYfjYdoCN/YqJUIauFK7H3h3fatQkzJJ2sfDg/ jtg+hVlENXiSVWf/esV+nuImQ4dH9GeNY0my7Nqjv3T4JCtjKbANk6+9Y2YMTsr2AbW1 MXMSMm0zJ5owhM9s+tvrIjJG6p+Jm39OGxl9ObpQUsZztBngYlUVDOMa24UdEFHJLrQJ kGXvMZbPokqtHLfIb0NImtlCCY/sNJYEfI16aiH0xQ8PKKjsFFVJlU58bmgtT0aOrTmJ o0fXq56jxZIRHVbY3xrH2ocAApAJHKZLrLNSCPP5+Y/akiVdoY8PfVXenhenBKMHp20j dQkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WeOsBTln; 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 a6sor3656366ilb.49.2020.04.23.15.08.52 for (Google Transport Security); Thu, 23 Apr 2020 15:08:52 -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=WeOsBTln; 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=K+G1+PwcxmC0bvv5uLFnP0XXhpkYqmxl+rnFEl1fK8A=; b=WeOsBTlnQVcOYjpFrAaEbz1epw7feyrZ0p5/Sa6bxXiY8ldrYM9ZkzONoQya4gEFs1 Q4Us8hURFg1+V3oKL+NWnt/Md/Thi5B7Ofo3O94kbqIQwXIAI4W+EeLWptzA+hMC4N78 7Nzbp9NgFGvENhouCup125LTWM1eq9tki9C6YIV6eHcDHYVHwqEZu9nb3kEQaVX8Xc20 8doajEHxdZHjw49cDGCdad4vd/B+c6OWcXD9ndsM5SMTjyajQS06X3OEUAPx3VH7nTzN iy7UJKWlr2Pv1c7Lsdx8y7nWgP5osu9nJAoxITmnagIx8LKoBDjMdcddJb3r1fCukAUc HxUw== 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=K+G1+PwcxmC0bvv5uLFnP0XXhpkYqmxl+rnFEl1fK8A=; b=CW3gvmZy1F/O/3sYgGa5uM21u0U0i+bvNCy+96xIaMIYq87fT86hNX+6GMLDAJQazm fVbr3jVsL2OZK66gsQ8K5QDTlOEIltW8UDufuOEQJ+UPIsIhnpOr4daiqKE8PNkPpNKG 2TwFm+MNhGHf1mPBN8LVfM8mrFjwojDV7zM/Tu/vD2JBeTaRDuO8riBh4GxTgVsN+mEO PXmurLtRptdlQDChcniBogG+P4slu5OE7weqrMRMP8NK1r4R1O11abeaRvWp5w+Wg3UE MHOg6AymLLfdo7MIUrjbS6mpjB75JAWS0zrnzZjmUqj73wENttYvM06spB2UQtIyrfiK SShA== X-Gm-Message-State: AGi0Pua2bCJXl5DvP95ufAXyzQMbPWHE0VlpHrYxjb3t0WjcFWWqWDlu jqzJoeJObJ2623UP9NOu8yaYaWTv X-Google-Smtp-Source: APiQypKkBkWpwqblD+K39cLu1g6jy24+PyuNlzBZwjmaGnW8igHIOEUeQ2x5RitUQ/Re3M0rwrBxow== X-Received: by 2002:a63:1d4c:: with SMTP id d12mr6033739pgm.247.1587679732448; Thu, 23 Apr 2020 15:08:52 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id t6sm3540270pfh.98.2020.04.23.15.08.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Apr 2020 15:08:51 -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: [PATCH] dwc3: Remove check for HWO flag in dwc3_gadget_ep_reclaim_trb_sg() Date: Thu, 23 Apr 2020 22:08:49 +0000 Message-Id: <20200423220849.30280-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 4d3c79d90a6e..2a26d33520ce 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2457,9 +2457,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--;