From patchwork Wed Jan 22 22:26:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 182923 Delivered-To: patches@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp31756ile; Wed, 22 Jan 2020 14:26:51 -0800 (PST) X-Received: by 2002:a17:902:a50a:: with SMTP id s10mr12997528plq.136.1579732011087; Wed, 22 Jan 2020 14:26:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579732011; cv=none; d=google.com; s=arc-20160816; b=cTrQ/NP6mzCpIyD3+uTJHeCftkdSuS5yZl6szHHAUjsBGBUKzonsotAacYcC8QYma1 gTH3jK/O8y7gAYZnKfNW+hOl8SCyLjIdCdxCIAMDGE1Qlm5KdWlrLIq9oRHgcV21+mmz j36xUzLyLyJ735PGt3mid9zfe6cPFhv4JtJJU8wArX+ISDT3P+QKltQP0uRJN1dTsoWj e/EPUH0FGJXqGrW5a68zDKf8YveJB8iFo2scnyipYepb1DFKKk/Gbqz3GJA7HREEXOr1 MJ39GPeBwA+bkp4pjoRDNDT5TPRctrDFE9JWOLj1aIwoumL8vQmWQ8BTvPtdoMehuoxW 54ug== 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=cxNVjgQGWzacnqlCZNmJQJkdYDIqlJE10RKfm1uE9mM=; b=nHRbG6X0/8uddsVZjQ81kTUPY5tBHHVBh1LbTuWzQzqIFgGOLoDsgls6dPCfv96GRa 7eTwiIfWsvr0HLwwOEWygdw70mg332+p7/E6rXg1sKQJOc9r9JfyKJBl7mBs7XEGd2q3 p53SEwPOjX1opko6r0nIFoQHzz6C1qnd4w8v/lzJZHJYsvDuf55SmgpIuvyxYvXS9hgC r5ogZ4PA0tYDc36cxbmInHaXPDZPVVip8FJ+KvOq84LN6trBsPYZ+vAE8MokYyFk8CbF cnoniOOFNDwEkCQvtTttXRGIQlF3Xcj6OFJBOCSZrjlWz8xw5FCO6OcNZ+d6zzfWfFR4 CUBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pOv4DwOm; 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 e18sor5165142pjt.9.2020.01.22.14.26.50 for (Google Transport Security); Wed, 22 Jan 2020 14:26:51 -0800 (PST) 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=pOv4DwOm; 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=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=rixtiB/qYBjLwQuP2JT9Ytjl8SxZ1DF2uWYIdx7aC6FIJBlZe/8I1YFICAK9B2c4kc aVG8Bg3gzNciItIRDpKLkDtmYH13OJaa0iFHzIUZ9slolXkVgUQf4duaixiXAmH82wLT hXq95VpEgK6ncM/kQN3iCllcoIWiEQwPODL5fGRpT1ApwENydsT4TMFkZQ9tt+F2Vf+w Priy0e2CjUnbWOzxfhTH80UbAItnTlQ5DQS5Ea2wWLXhjTurN6RHlAt7GEyfNctDuUKA MJ2iPtKDQkjZB8vaYh51L1wJ2Re7yt56QPo6tvr6e3j9vqV80oY2rv8egOaI3iLerzfK r9wA== X-Gm-Message-State: APjAAAXOI9ratuV/uo90I+QzBx029dPwadiUUr/jl8ZAfgt/ez7TMnqy aD3gvDAMC7aUFu0iS/Cc7luvtwHO X-Google-Smtp-Source: APXvYqwTOHRjwf4d8GAH3/wqyQXJ/KEyA6qmWmh3w2qWEbuYZc+PmC1vhzKke3graUr1g49XLUJdlw== X-Received: by 2002:a17:90a:d0c5:: with SMTP id y5mr808414pjw.126.1579732010599; Wed, 22 Jan 2020 14:26:50 -0800 (PST) Return-Path: 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 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