Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2931945ybk; Mon, 18 May 2020 11:24:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQklVCYezP6J2kcYtKCRRHUftiTmP/Y99oY55194dcITP4s2w2mnZLQxIUP0OoiS02hTtJ X-Received: by 2002:a50:afa3:: with SMTP id h32mr15181621edd.63.1589826278164; Mon, 18 May 2020 11:24:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589826278; cv=none; d=google.com; s=arc-20160816; b=IlssjAeYFNWtxvnpWCOtbK+UhQmJLEEKQt2x2FM4SRj4K4x1f/wjYafcLPk3rdJtb/ xpuTaW2YHfrLKHxZDQVAyEL71KnMhLPJEpBB2TiHWavvhgAmx6umZIbwFNE/dFJl/sy4 T0EmHlFJ8H1Q1Rj4Z9HrkgzsF0g0s0dVUhs+R/DtnWSXrEDr9nmSmax6Jhu5lKfMjhRc /HqG25+KImuwaxyubZXqNdYQBlCgIvvEl6YjZeKpUROjUbI9KyRKRv2gkxIUBV0g9emy gfwRg4k2/RBiku+1vOgmSpFCNYPM+cY/De5m3ah1GIq5RnIqYPTImbUzpycHE1SjDCgr ssnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gTWEWUXKcLl+WW4YmNeJca7ro8hRp9dHbctv4cB+UHU=; b=pXD5Qx0H/h7w40yXerp6058ELG6Klob0pqVvrRRV5ZsMVpfbKoNA+6e5AtQkBF0DEu 98R4Au71DVtfRP64dQ/+uyh14nfZizeCsEd8SPHkRR/6RG+2MfXFDdlHa5p7xOLH9JGE HEqGA4hCdl22DisWMNnR5NllJJfPe7a7msksDuErtbeaghhqepUcR4FXSOPF/IognX89 HqIDzmJ/Il7Qb93vQAHpB21UAHEAi4dbf8WO5g8cu67dh2fGcaRMDDshhw0cbrQISXEs agl/vnM+nOhDnz2fdO06G96lLOCUKiIW0oEMmgAKsn+pnZHda/A/aJYfCONE0es6rU+s JidQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=d7gvwFDN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u20si4141840edo.434.2020.05.18.11.24.15; Mon, 18 May 2020 11:24:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=d7gvwFDN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387754AbgERST4 (ORCPT + 99 others); Mon, 18 May 2020 14:19:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:57610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731158AbgERRxd (ORCPT ); Mon, 18 May 2020 13:53:33 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 95A11207C4; Mon, 18 May 2020 17:53:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589824413; bh=ZsJn7yzuxpLIcnmErC2GkQPXYoeEaR6UqPbjZR5fag4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d7gvwFDN15uaK6L6tqI6KrQ9lJ8It6/JLke38W7VdwHJmRCn4FF1qZdAc3Q1qPjfm tpHZCQZqrQWszAFMMB431WVETyvt6xtKR3WRiN7MEC4+g5BvRv7QAZhVr9jpqTBeS6 koBeK4hzm3Hk0vj6fQoDCw95gv+pU6mmfcIu1fJo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, YongQin Liu , Anurag Kumar Vulisha , Yang Fei , Thinh Nguyen , Tejas Joglekar , Andrzej Pietrasiewicz , Jack Pham , Josh Gao , Todd Kjos , Felipe Balbi , linux-usb@vger.kernel.org, John Stultz Subject: [PATCH 4.19 67/80] dwc3: Remove check for HWO flag in dwc3_gadget_ep_reclaim_trb_sg() Date: Mon, 18 May 2020 19:37:25 +0200 Message-Id: <20200518173503.872586878@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200518173450.097837707@linuxfoundation.org> References: <20200518173450.097837707@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: John Stultz commit 00e21763f2c8cab21b7befa52996d1b18bde5c42 upstream. 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 Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/gadget.c | 3 --- 1 file changed, 3 deletions(-) --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2279,9 +2279,6 @@ static int dwc3_gadget_ep_reclaim_trb_sg 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--;