Received: by 2002:a17:90a:2044:0:0:0:0 with SMTP id n62csp1127703pjc; Thu, 9 May 2019 14:25:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzH/QVkoW6KowbNQmppV0X8zbBXJvJm7OfU8x9Gq+irCO1dwQYaNT+miPBNf3OVgrEvprgL X-Received: by 2002:a62:544:: with SMTP id 65mr8548493pff.46.1557437109005; Thu, 09 May 2019 14:25:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557437108; cv=none; d=google.com; s=arc-20160816; b=NXfCWeiDzLPIEjXow7VEjXlnd21jGWvFvoJnB1+C+17NKEIPsKd/1vV2LPd+bq3eeU GPc3tP1lmvEzC0pqCXnelWJCMmLJgvFK/Gv5mnWR/Aph1FVE9KApKpow1c7+eMPwIEOS KKmvSc61sa0znJN7NFLwB6bgNp1bFhP01r3CETav8Ssubue5dj0DkMPzdisN7p26xFZ7 lORvALiqeYKwCfwRXPMhJNBe2bBhhf+yoVpE2A56PPcOnw14AoFVOq0ZCecsAa5+aRV5 qDCOfpAPdRHT61nvlJz6x3KR9+UUx99ZVGHFC7zE8LxTJKvOnAE9IKNg6VL1rt4ENJEa OqYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=CR9C9z5AdFq92j3t78GsabgrWeXl10dvuT3JtPOaD1A=; b=ZfzXmWsPeUwCI4gfAyGsnB78CDaU+d4ypKEgERl6D77qBHK9cozahQAdDOWUoEwRgB G0coQf091AaL+rRg8wge+l0QOhA5x15oWYwMQq4qiaaqkhUYX9vk7X0zgfbWo6azEbPe vgQrG84gTX3ePPtdnpO6sBEY4h4y6sErjdeeSaA+lFP4bPwUocw0jcYsG0t7qN09zPYH qFbyvS9aOPgXi9b+4a9uiTyMNOqWXVbTVJeJl0Hcn8J9WUykGqMIJldSjWam2bqDT5fM RisfSvwRd7wgXt2ckKiqiFj/KIv19NRS2meslet25/0rJXS6wW07PH7G90A0wCWkOha7 7L0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ntoALUF/"; 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 t10si4623448pgv.533.2019.05.09.14.24.51; Thu, 09 May 2019 14:25:08 -0700 (PDT) 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="ntoALUF/"; 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 S1726903AbfEIVX7 (ORCPT + 99 others); Thu, 9 May 2019 17:23:59 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:40895 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726682AbfEIVX7 (ORCPT ); Thu, 9 May 2019 17:23:59 -0400 Received: by mail-wm1-f65.google.com with SMTP id h11so4855243wmb.5 for ; Thu, 09 May 2019 14:23:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CR9C9z5AdFq92j3t78GsabgrWeXl10dvuT3JtPOaD1A=; b=ntoALUF/JU3ofU0TKIgWzSKb9pRV9bI8FWErlamPKlSm0SQ6RANs6nELfUnpyo+NEP UXG2Lp+1PyrZvrTLSrUwkosUXKh1sjT/utTSeMfdNZsVIPxzB3KiLC0PlQIz0kg4SZZ0 psG61f7nG8pSWv59IY6sh35d0gl3WkSIBbROPfL1pMeqctf/EGhvs1ELqqPR7vMXT6+3 y/ZEID3goR73Vg1ouVMu7BqPbUe8vT1cGu/CMOnSFY6GEFvJVzcHQYRxYiZ1DkDmpQaK mIe6gFHtIWZVlfUsbhXt/vTWhzOzKKpdjWjjhfN3JDlvUSRDkeO2cisdRxvsm7KJ+CpS ClPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CR9C9z5AdFq92j3t78GsabgrWeXl10dvuT3JtPOaD1A=; b=T40Zo9K2ASdH1iG0LKDMDPJvd48M5UpnB3QqFuRi8nCTPquFipI24fPCa72B1ghP/2 xDXqp3AeWcgLOqFDQmU+d/mWgIHt6dIZLfrQFoAAb3dgswGfzW2xDZyYjNM47soLPkKD CeaKzu2OPKKubr3PEZbS790k+cCPleBT5nQi4bHoQergJZyJkJk5mJW7+FhZGcKPlBCU 9wnwk57Km1zvrG5KldceqTVJq37Qn4X08l7mNOvxKh5UPFjZ2zn4KmcPa6zh/4O6VQqK TsOBkaGwaNVzqBvXWrzBBrihnj4CAV+vR4NLfAY2rHBIA4wTCtBJRt6qmHyO3N8Np7th pHTw== X-Gm-Message-State: APjAAAXoN+27IExo47MZ63iTP2oQXNTPfFpoQO7+IccwvtiPT8LecWUm JDY6WMVPwj5Mn7/mbyViNfZYHvQnqBL16d/EDfxL1hhLuVU= X-Received: by 2002:a7b:cb81:: with SMTP id m1mr4642556wmi.9.1557437036779; Thu, 09 May 2019 14:23:56 -0700 (PDT) MIME-Version: 1.0 References: <7caebeb2-ea96-2276-3078-1e53f09ce227@collabora.com> In-Reply-To: From: John Stultz Date: Thu, 9 May 2019 14:23:44 -0700 Message-ID: Subject: Re: [REGRESSION] usb: gadget: f_fs: Allow scatter-gather buffers To: Andrzej Pietrasiewicz Cc: Felipe Balbi , "Yang, Fei" , Bjorn Andersson , Chen Yu , lkml , Linux USB List , Amit Pundir , Marek Szyprowski , "kernel@collabora.com" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 9, 2019 at 11:25 AM John Stultz wrote: > > On Thu, May 9, 2019 at 7:02 AM Andrzej Pietrasiewicz > wrote: > > > > Hi John, > > W dniu 08.05.2019 o 04:18, John Stultz pisze: > > > Since commit 772a7a724f69 ("usb: gadget: f_fs: Allow scatter-gather > > > buffers"), I've been seeing trouble with adb transfers in Android on > > > HiKey960, HiKey and now Dragonboard 845c. > > > > > > Sometimes things crash, but often the transfers just stop w/o any > > > obvious error messages. > > > > > > Initially I thought it was an issue with the HiKey960 dwc3 usb patches > > > being upstreamed, and was using the following hack workaround: > > > https://git.linaro.org/people/john.stultz/android-dev.git/commit/?h=dev/hikey960-5.1&id=dcdadaaec9db7a7b78ea9b838dd1453359a2f388 > > > > > > Then dwc2 added sg support, and I ended up having to revert it to get > > > by on HiKey: > > > https://git.linaro.org/people/john.stultz/android-dev.git/commit/?h=dev/hikey-5.1&id=6e91b4c7bd1e94bdd835263403c53e85a677b848 > > > > > > (See thread here: https://lkml.org/lkml/2019/3/8/765) > > > > So the thread says there are problems at boot, but here you mention about > > adb transfers, which must obviously be happening after the board has booted. > > Do you experience problems at boot or not? > > > > If a crash happens, what is in the log? > > So, yes. Sorry, I am maybe muddling two issues (though they both seem > to be tied to f_fs sg). On dwc2, with the current code, we often (but > not always) crash as soon as adb starts up in the boot process. Thus > I'm running with a revert of "usb: dwc2: gadget: Add scatter-gather > mode" to get by. > > As for example crashes, there is a crash in the thread linked above > (https://lkml.org/lkml/2019/3/8/765) and also the one I sent yesterday > when testing with your zlp patch. Let me know if you're looking for > something more specific. > > One thing I didn't do, but I should is run w/ the zlp + your > memset/kzalloc patch. See if that helps get dwc2 further along at > least. I'll test that shortly here and get back to you. Ok. Apologies for earlier confusion. So the kzalloc/memset fix you sent for f_fs.c does seem to avoid the crash on bootup I was seeing w/ HiKey/dwc2 (previously I had only tested it on HiKey960/dwc3). However with that patch, I still see tranfer problems with adb, unless I comment out setting sg_supported in dwc2/gadget.c (in the same fashion I have to with HiKey960/dwc3). The dwc2 zlp patch doesn't seem to affect things much either way in my testing. But maybe I'm just not tripping on that issue yet. So yes, the kzalloc/memset patch is a clear improvement, as it avoids the bootup crash on dwc2, and seems like it should go in. However, there is still the outstanding issue w/ functionfs sg support stalling on larger transfers. thanks -john