Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5309745ybl; Wed, 22 Jan 2020 14:28:24 -0800 (PST) X-Google-Smtp-Source: APXvYqyzXFmXXBqCnzwHv4qkmrOKGWtA41RNl0KzDXWpwDwgUlQlo70Ys75alUSZ4AVedJ3gcnA3 X-Received: by 2002:aca:cf58:: with SMTP id f85mr8499562oig.6.1579732104320; Wed, 22 Jan 2020 14:28:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579732104; cv=none; d=google.com; s=arc-20160816; b=MtByTpcw6xeQGl9ze8ZBeg1048z9RbEK0RSR9orl6v8EEr9iX6qjWOpkowKv+4Vyh1 REGFwZWfPuZsz1Iu40r+AXEmpqwH1vbfMFE/mCG8L6W57NfsGXlEnDwh2ezyzxdkarEh FLn/iqJUhomuTD6kQLVZEw5m7ODzuGxOelNlRK9NK3Bm680EtQu2sC/Hy5FZrs2BPLFW 6p6dtKmtpY9hn02mwKrVw/lRjZ6HKpyEQOedkCK7c4O3F35cKYtdgd0idbBVuGYt8gT1 j9Pf2b4pdToB+XJtKzVfbjOB+lfkFodNekFFBcvdjxf0juaDg7nKgTgITVc/8G+n85Kc fvDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=cxNVjgQGWzacnqlCZNmJQJkdYDIqlJE10RKfm1uE9mM=; b=Y+colNfsCAqm7uEAf3M/GuPuW1vP5XeDEVeV7Wd4+8Ivli7sU3sH/5eSNbU6EzDmgG oH6ciNjneQOeRus59rVypgHpHG9mqRUlDPpDOmcDdIq0t0UYNZi84hYEI57u4yO6Kpcy IMUA9sYUD+xDedvBiB2ZVUqNIEQK2x3JORWcmTXKR/fzcafiYaOVFQ8QqNO0VXt42NNC x155WWefMc4TWK6CgQP4ubHivVDRm2NGMDWIal1ClMV/RgRzXZOvfb/RAy2SWG9bIOEX qBOAjfNanRKP6uj5iGEa+gA+nGn6+fUjnnqG5QnSxeS8cQ+Nt+Nghvt2mtxx3LD9M1UZ EPew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pOv4DwOm; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t1si62842otq.322.2020.01.22.14.28.11; Wed, 22 Jan 2020 14:28:24 -0800 (PST) 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=pass header.i=@linaro.org header.s=google header.b=pOv4DwOm; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727453AbgAVW0v (ORCPT + 99 others); Wed, 22 Jan 2020 17:26:51 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:39623 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726061AbgAVW0v (ORCPT ); Wed, 22 Jan 2020 17:26:51 -0500 Received: by mail-pl1-f194.google.com with SMTP id g6so422964plp.6 for ; Wed, 22 Jan 2020 14:26:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=cxNVjgQGWzacnqlCZNmJQJkdYDIqlJE10RKfm1uE9mM=; b=pOv4DwOm5vOgZ+PrlXxtrPOfWsAyaYxbfU0ipKfrLvdyaCWIZfNb3Tng6PIcTsdm0L ptJZCs9pnIt/C29i4j2b84lpo9l50BBU61Ouw2z41al6f33wRE/NdYF2iVzvLlb/6xBZ e/xmNQSI16yFl3/XernW55vcPqz8JpeiVTq4YKG9NOrD+4+pJOVyk3xoMA6jnIJwjKQi 4fs9zHCqRJAdjI2c5RirLb7u0ddIDol/VF//LhFEDDx4xDKLymEfbLlMjiDFaBI99kEV pnIxClfbDRiNjxCEHchG1D9XUAl32oxJRBRlSd5OAx/ZLJUOQgaJYg1KXShxMTVer1kH x8EA== 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=cxNVjgQGWzacnqlCZNmJQJkdYDIqlJE10RKfm1uE9mM=; b=jd6/IByoCg37otfMPGDc2ryNYm+58MuFTS5t+4Ii97ha+KS2li7GAVocoZ7tBl8nck KkHOlMK7HnxxUeqDH8PhnOlt4PyP1OnCN7kJtHDzE93LAlHVIwy+jACBdsW1ZRnaoe4T L7d6Xwb1V9qmQsCbPrBG7tYzXa/uSHSbzFkPBLPSkMa5xqOgATK6URCAL6I8Nl9Xgu96 WetxDzRyz4yxnzUBuVozt2IuD7V+O1j2dhaHcn4b3Muxp4hcG8VUUIlnC45Mg3CFtHyl TEL+qNZPwb30DyfBnXk46ZXM1jXd9mwWajbxUa5Xopwo/bWva+RFMkTChhuIWtxyMVSd JDgw== X-Gm-Message-State: APjAAAUUmKq0f16Ax9RkJ9N0YGTDBxf0EwluyJCyNU8OCVy011T1U3rV 4WRUe8vsMTve5xrJAKVqyRJz/4g79w0= X-Received: by 2002:a17:90a:d0c5:: with SMTP id y5mr808414pjw.126.1579732010599; Wed, 22 Jan 2020 14:26:50 -0800 (PST) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id a28sm47793509pfh.119.2020.01.22.14.26.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jan 2020 14:26:50 -0800 (PST) From: John Stultz To: lkml Cc: John Stultz , Felipe Balbi , Yang Fei , Thinh Nguyen , Tejas Joglekar , Andrzej Pietrasiewicz , Jack Pham , Todd Kjos , Greg KH , Linux USB List , stable Subject: [RFC][PATCH 0/2] Avoiding DWC3 transfer stalls/hangs when using adb over f_fs Date: Wed, 22 Jan 2020 22:26:43 +0000 Message-Id: <20200122222645.38805-1-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey all, I wanted to send these out for comment and thoughts. Since ~4.20, when the functionfs gadget enabled scatter-gather support, we have seen problems with adb connections stalling and stopping to function on hardware with dwc3 usb controllers. Specifically, HiKey960, Dragonboard 845c, and Pixel3 devices. Initally the workaround we used was to simply disable scatter gather support on the dwc3 by commenting out the "dwc->gadget.sg_supported = true;" line. After working with Fei Yang, who was seeing similar trouble on Intel dwc3 based hardare, Thinh Nguyen mentioned that a fix had already been found and pointed me to one of Anurag's patches. This solved the issue on HiKey960 and I sent it out to the list but didn't get any feedback. Additional testing with the Dragonboard 845c found that that first fix was not sufficient, and so I've sat on the fix thinking something deeper was amiss and went back to the hack of disabling sg_supported on all dwc3 platforms. In the following months Fei's continued and repeated efforts didn't seem to get enough review to result in a fix, and they've since moved on to other work. Recently, I found that folks at qcom have seen similer issues and pointed me to the second patch in this series, which does seem to resolve the issue on the Dragonboard 845c, but not the HiKey960 on its own. So I wanted to send these patches out for comment. There's clearly a number of folks seeing broken behavior for ahwile on dwc3 hardware, and we're all seeemingly working around it in our own ways, so either those individual fixes need to get upstream or we need to figure out some deeper solution to the issue. So I wanted to send these two out for review and feedback. thanks -john Cc: Felipe Balbi Cc: Yang Fei Cc: Thinh Nguyen Cc: Tejas Joglekar Cc: Andrzej Pietrasiewicz Cc: Jack Pham Cc: Todd Kjos Cc: Greg KH Cc: Linux USB List Cc: stable Anurag Kumar Vulisha (2): usb: dwc3: gadget: Check for IOC/LST bit in both event->status and TRB->ctrl fields usb: dwc3: gadget: Correct the logic for finding last SG entry drivers/usb/dwc3/gadget.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.17.1