Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp275320yba; Wed, 8 May 2019 20:27:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdmnRCJ8TzZ6zY+AVBY1Wib/paVVm0PA3RZq5Dlztov375Vj3eHhwzyLcDOzOqaembh8gy X-Received: by 2002:a63:2d41:: with SMTP id t62mr2547640pgt.113.1557372443577; Wed, 08 May 2019 20:27:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557372443; cv=none; d=google.com; s=arc-20160816; b=JjUOTbpgeOIW57mvdiMzcveld9erY584doPaud7fvybYpugaCk2j7qYQfMeVthDJOS S/2l5S4YZ0LJfSISv3xQiHyD89na2kao8CNIVG0W3t8yn3rnP2Q6KxHhpm4Ofk5S0UTt lo3HhyZaZtKFg6WxaxUnzAtsLttN9izp/ep5ydJEE9sBZKxuXe4H2RyI1doSSJgo+KCk +8pPsrzINrQv2lrPb0lhtPoqbl5F4QNUWXuRAe8Efg7KVKRI5rx6npHmzJ3m4SGdJY7C Yt0Y3yOuheJsnFP1e2ZjfYWmaz5D8OiNVFfRZYxcydr4LFP0v2bL0DKeMrRWaiohh9dC RB/Q== 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=lRhRc+8pG5xCFTlPPF8IH5Jn8EJcWR+taQ45d02yZww=; b=YRLsrVr9TQOCjHl4ZIxiiLAt33UA4iH6Xk9ZuoKu0aV6Qax93s5w77rJtgHSB4KChP ky9DwRHgDuXg44PEIhq/XHeKyi3yCvhykx2V5WPkzdZ3MNe3Vj3w3ivoKkszV8WkmRvp 2Q1mLJcgAFwXILUEAPsJndf/5UKfgnVYv+ws9T5If186l1Hl58Ata/iGcaIDvsPtzASt mqRY6epPe1bb+pu2aoe7MXCaOLSOfXhHQyOl363RzYtIzwTJx/GdO4Ym4cjw/kXffbpN DXO91Y887r+gAGX5q7whlkElLV/8fs1CflR6ymfn2f/jLDmlxHH26sM97aCCIMZzHAPY ax4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ge+Pjvx3; 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 o15si1472155pgh.181.2019.05.08.20.27.05; Wed, 08 May 2019 20:27:23 -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=Ge+Pjvx3; 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 S1726597AbfEID0N (ORCPT + 99 others); Wed, 8 May 2019 23:26:13 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:34417 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726251AbfEID0M (ORCPT ); Wed, 8 May 2019 23:26:12 -0400 Received: by mail-wr1-f68.google.com with SMTP id f7so783095wrq.1 for ; Wed, 08 May 2019 20:26:11 -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=lRhRc+8pG5xCFTlPPF8IH5Jn8EJcWR+taQ45d02yZww=; b=Ge+Pjvx3g4sMxcB8INSQA8PNEWybLExQ+5MUy+EJX2Ni9nrkR5JxNznOE6+q30QnsC 1U5+RQwNnumYj+vpNrx19iK+ntOAKV8hoFvrCvVtw7fbS10Cb045l2xHPhXvRhck6Au/ HZNuIJH++2TqxiXkI0y8J1fceqH8otIZSGPA8F6XbgbRbF6EonFPymw+94sf4FQYAyGV IBp+4kcUO2C9T53N3d+UkGcgfa8Sr3eDkv15sXU/9Vw1GgGg/7mbPaOLQtuR/cBEeHwK AfUYO1Qu0JQZ2gQDyDdnkn2Zsl+ofJNcwGxHzxTMUZe5gi+bIrMWCrpfBCkyByZgHy1v wibA== 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=lRhRc+8pG5xCFTlPPF8IH5Jn8EJcWR+taQ45d02yZww=; b=Jk7aKrqF0rX941Uo2N7myaSIFr3aGmrKu/x4PESho49YXuYtL/lG9Zr9r3r7zT5VzX LGw+0/mdkItoKPdfS2JuWE+tDsExG/C7r2b14DaF57Juv5Kx7TMoeavNcJekIeqJ+kJt y2yvduFoiXHBBUSRnFGzbPcuvQ/58JEKrp1oYqDV7V5GzjKLfU2p6czbJ6wknf4i4EtZ uf4m5+9B+hb1qJlWDylJ2WZr/DiFhzcCIxkqmuPLjpIQli2BG5eyVPf8ukcQx7QcmWeT jaydw8Q9qziGFmxyA/pmh7/A3kUXVjgIbOmJK6VwEryPR87dGVfg7LobfyVfsMZuRwli wRfg== X-Gm-Message-State: APjAAAVpINomD93OXyndLZ3ZIk4iIcimg2Ta50MNiSnuqloDT6WiZbSY CC6xPIVbNBWRFAO5vHftc8RK3S8oWB6pcay/zzTZnA== X-Received: by 2002:a5d:50c2:: with SMTP id f2mr916900wrt.253.1557372370271; Wed, 08 May 2019 20:26:10 -0700 (PDT) MIME-Version: 1.0 References: <5d58059c-1b10-665f-983b-a1d018a30d1f@gmail.com> In-Reply-To: <5d58059c-1b10-665f-983b-a1d018a30d1f@gmail.com> From: John Stultz Date: Wed, 8 May 2019 20:25:58 -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 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 Wed, May 8, 2019 at 12:01 AM Andrzej Pietrasiewicz wrote: > > Hi John, > > += Marek > > 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) > > > > And now I've reproduced the same issue (with the same dwc3 workaround) > > on the already upstream code for Dragonboard 845c. > > > > Fei Yang has also reached out and mentioned he was seeing similar > > problems with the f_fs sg support. > > > > Andrzej: Do you have any ideas or suggestions on this? I'm happy to > > test or run any debug patches, if it would help narrow the issue down. > > > > There is a patch: > > https://www.spinics.net/lists/linux-usb/msg178536.html > https://www.spinics.net/lists/linux-usb/msg179653.html > > which fixes a subtle bug, but hasn't been applied yet. > So, the "fix zlp handling" doesn't seem to changes things on hikey w/ the dwc2 hardware. I still see the following crash right away: 13.571611] functionfs read size 512 > requested size 24, splitting request into multiple reads. [ 13.571773] ------------[ cut here ]------------ [ 13.585205] kernel BUG at mm/slub.c:3944! [ 13.589215] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [ 13.594698] Modules linked in: [ 13.597754] Process adbd (pid: 408, stack limit = 0x000000001b71cb6b) [ 13.604197] CPU: 0 PID: 408 Comm: adbd Not tainted 5.1.0-06623-g27dc6c9 #168 [ 13.611243] Hardware name: HiKey Development Board (DT) [ 13.616465] pstate: 40400005 (nZcv daif +PAN -UAO) [ 13.621266] pc : kfree+0x210/0x258 [ 13.624672] lr : ffs_epfile_io.isra.12+0xf8/0x6b8 [ 13.629371] sp : ffffff8011b63b50 [ 13.632682] x29: ffffff8011b63b50 x28: ffffffc06b918e00 [ 13.637993] x27: ffffffc0703af138 x26: 00000000000001e8 [ 13.643303] x25: ffffff8011b63c98 x24: ffffffc074c3e800 [ 13.648613] x23: ffffffc074affa00 x22: ffffff80114b9000 [ 13.653923] x21: ffffff80108b19b0 x20: ffffff8011c2d000 [ 13.659233] x19: ffffffbf00470b40 x18: 0000000000000000 [ 13.664542] x17: 0000000000000000 x16: ffffffc06b918e00 [ 13.669851] x15: 0000000000000000 x14: 0000000000000000 [ 13.675160] x13: 0000000000000000 x12: 0000000000000000 [ 13.680469] x11: 0000000000000000 x10: 0000000000000000 [ 13.685779] x9 : 0000000000000000 x8 : 00000073d8dd6150 [ 13.691088] x7 : 00000073d8dd6598 x6 : 0000007280805113 [ 13.696398] x5 : 0000007280805113 x4 : 0000000000000000 [ 13.701707] x3 : ffffffc0703af100 x2 : 0000000000000000 [ 13.707020] x1 : ffffffbf00470b48 x0 : ffffffbf00470b48 [ 13.712334] Call trace: [ 13.714784] kfree+0x210/0x258 [ 13.717837] ffs_epfile_io.isra.12+0xf8/0x6b8 [ 13.722191] ffs_epfile_read_iter+0xb4/0x188 [ 13.726459] new_sync_read+0xf4/0x190 [ 13.730118] __vfs_read+0x2c/0x40 [ 13.733430] vfs_read+0x8c/0x148 [ 13.736654] ksys_read+0x64/0xf0 [ 13.739878] __arm64_sys_read+0x14/0x20 [ 13.743715] el0_svc_common.constprop.0+0xa8/0x100 [ 13.748504] el0_svc_handler+0x28/0x78 [ 13.752250] el0_svc+0x8/0xc [ 13.755132] Code: f9400260 378000a0 f9400660 37000060 (d4210000) [ 13.761225] ---[ end trace 0220b13deaa73ab7 ]--- [ 13.783381] Kernel panic - not syncing: Fatal exception [ 13.788616] SMP: stopping secondary CPUs [ 13.792814] Kernel Offset: disabled [ 13.796301] CPU features: 0x002,24002004 [ 13.800219] Memory Limit: none [ 13.820708] Rebooting in 5 seconds.. thanks -john