Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2042119yba; Thu, 25 Apr 2019 09:41:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqx+cAA6RLYcC+0/n0p+KsX3zpwa93X1CoQ4zYHSkumwyv/Ogh3Xj8912fhobpC3CoWoLwjM X-Received: by 2002:a63:d10:: with SMTP id c16mr2775042pgl.156.1556210468318; Thu, 25 Apr 2019 09:41:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556210468; cv=none; d=google.com; s=arc-20160816; b=DnOiMxbbS2IhnD2HPivFaHBfCxFD0IraqmYpENj14Sp65xMIDq3jRtbKXpthiRivbV NvYltDZniygLKgh+6GVQa0rQP8Te/c8A/9CC7hWCFCpK/A8XQ5bP1MpNMvqwTHZaXDh0 zEJB2k536p26F60k3ApD1BrkroS+n0qO8ao7lkl2IEG27GrDkKCzyZGdFX1J0T8wUx25 nIJ5Y46pbZAPzi4W2Fj2OAwTRGvzoyYwYIRdx6SOmjKi898Bq4ye592cUmfUiToMMf8U BKshi5sPi0vx8S4izsOYODz31vgLdEerav3hBlZTvjtOoOkxFYd+wNU3GND5j9dZEdpB /Q8Q== 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=faM1InmyeOdb2yNMEACfdEXFAtAUUsb1+rlhyP3bugc=; b=e8weLL2MpVca3T1olybmdC8q6yvDQnNh+50rtNDmsHoPzSedvzeerUeSp8swYiPKuQ jUeUr6Y0lT5BPb+gVDywFq57oj/8UUK4R1RR3lTrlV90qzyKzntZeWAYX+sGqnq64lJM GAS3UBp6QabLDMJ/nJlYufxklDLDt7BIssMG768hz+TqPdV39vjhmppYuO8XcfQmP5GK jq8It6ErvBHGNUGum7ZgkFG8YtCPEKjSrH3N1AQKamXMNmSCPVcTjPmjCFHGgOTPa4PX S0JoIcnx1BVcJ/Di0zRkj06P0mPMY5j4FvUqQEFwe0oDFLMfSiyuVnavd8PF7SOO5MZZ KKlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yd3nwLI+; 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 w126si24613059pfw.53.2019.04.25.09.40.53; Thu, 25 Apr 2019 09:41: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=Yd3nwLI+; 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 S1727798AbfDYQTt (ORCPT + 99 others); Thu, 25 Apr 2019 12:19:49 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:55133 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726534AbfDYQTt (ORCPT ); Thu, 25 Apr 2019 12:19:49 -0400 Received: by mail-wm1-f67.google.com with SMTP id c1so47203wml.4 for ; Thu, 25 Apr 2019 09:19:47 -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=faM1InmyeOdb2yNMEACfdEXFAtAUUsb1+rlhyP3bugc=; b=Yd3nwLI+kZOG8X4b6oe9d3qrLLkersbOpxgr+x7IsZG0C52uVDN644i4saM905Elyr NYIonG0wPyQyUALJL21nz8xWokjOLp1GrUmTUNFw91/mbIi1O/hMxadSPzntw1oD7El6 N8qiKyIYUlomYDDwyK20kYpIFyU/K+l4GObI+I9n3gJkwj2Cvq2xUF6AqK7weJFVfHlC rcSIiprkdo847l0UKs970UA/J3mTWRLU9YNv/e7DDSUYmlUTqx83jLXurRpivp9hf31J FzFDJLwzQr1abTHpMvZhYpG6LOY6yr72YnK3ONSBeLDHdxCUIIDhn0X2W/lLfLEV8tWl 5yIQ== 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=faM1InmyeOdb2yNMEACfdEXFAtAUUsb1+rlhyP3bugc=; b=jb3AAGVQrubPN9/bk4AeoEOYMXilVvjwWzh/8byUTVkBAacAaW5JMQjy4Po9u3lWXv 9IAIQ3ZISjYgjN3KG/zs6SxckYOA9NMno2Bukk44esnpVgjUkUGd1cKsmXlijXvRKefh YgcYadcea/2h8oWi2JAyuFj1XIjPKsSf4ugyGHDB8rRTaicty4LMC21GzShAVfvfiwxo UQbq5z/eaH8QB3KgIGNJvDNlgwOX//eqd1zsYM/butQueZd+cDsimbIhUN8+0rPYzO+8 YiqrdXHuYIohDJLdZ9dOct/pRyYe2qJd4wTk8srurg26OSfBFyUQe7bmQFF2zqjhlYN7 jwzA== X-Gm-Message-State: APjAAAW5m0UTuUXGAZ3HFR0KuFtl4KmyrI21Uwo27VQbE29G79/2FCzq 5Y9NQaJhFod5w4/3atR0pn7V+OUZFdxGwSTgJ23OMg== X-Received: by 2002:a7b:c00b:: with SMTP id c11mr3964532wmb.23.1556209186700; Thu, 25 Apr 2019 09:19:46 -0700 (PDT) MIME-Version: 1.0 References: <1553059940-127038-1-git-send-email-fei.yang@intel.com> <20190424165052.GF21916@kroah.com> <02E7334B1630744CBDC55DA8586225837F82FB35@ORSMSX102.amr.corp.intel.com> In-Reply-To: <02E7334B1630744CBDC55DA8586225837F82FB35@ORSMSX102.amr.corp.intel.com> From: John Stultz Date: Thu, 25 Apr 2019 09:19:34 -0700 Message-ID: Subject: Re: [PATCH V2] usb: gadget: f_fs: don't free buffer prematurely To: "Yang, Fei" Cc: Greg KH , Felipe Balbi , "andrzej.p@collabora.com" , Vincent Pelletier , Linux USB List , lkml , Josh Gao , Alistair Strachan , "Shen, JingX" , Alan Stern 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, Apr 25, 2019 at 9:01 AM Yang, Fei wrote: > > > On Wed, Apr 24, 2019 at 9:50 AM Greg KH wrote: > > > > > > On Tue, Apr 02, 2019 at 10:26:51AM +0700, John Stultz wrote: > > > > On Wed, Mar 20, 2019 at 11:21 AM John Stultz wrote: > > > > > On Wed, Mar 20, 2019 at 9:40 AM John Stultz wrote: > > > > > > On Tue, Mar 19, 2019 at 10:32 PM wrote: > > > > > > Elsewhere it seems the ffs driver takes effort to drop any locks > > > > > > before calling usb_ep_dequeue(), so this seems like that should > > > > > > be addressed, but it also seems like recent change to the dwc3 > > > > > > driver has been made to avoid sleeping in that path (see fec9095bdef4 ("usb: > > > > > > dwc3: gadget: remove wait_end_transfer")), which may be why I'm > > > > > > not seeing the problem with mainline (and your patch here, of coarse). > > > > > > But that also doesn't clarify if its still a potential issue w/ > > > > > > non-dwc3 platforms. > > > > > > > > > > Felipe: Given Alan's point, does it make sense to mark the commits > > > > > that remove the possible sleep from wait_event_lock_irq() in > > > > > dwc3_gadget_ep_dequeue() for -stable? > > > > > > > > > > Against 4.19.30, the following set manages to cherry-pick cleanly: > > > > > git cherry-pick 1a22ec643580626f439c8583edafdcc73798f2fb > > > > > git cherry-pick 09fe1f8d7e2f461275b1cdd832f2cfa5e9be346d > > > > > git cherry-pick c3acd59014148470dc58519870fbc779785b4bf7 > > > > > git cherry-pick 7746a8dfb3f9c91b3a0b63a1d5c2664410e6498d > > > > > git cherry-pick d5443bbf5fc8f8389cce146b1fc2987cdd229d12 > > > > > git cherry-pick d4f1afe5e896c18ae01099a85dab5e1a198bd2a8 > > > > > git cherry-pick fec9095bdef4e7c988adb603d0d4f92ee735d4a1 > > > > > # To get things building, revert modified -stable fix git revert > > > > > 25ad17d #pick actual upstream fix replacing the previous git > > > > > cherry-pick bd6742249b9ca918565e4e3abaa06665e587f4b5 > > > > > > > > > > (Though I'm always a bit hesitant with -stable backports on > > > > > subsystems I don't know well. So I'm not sure if this set is fully > > > > > correct.) > > > > > > > > > > This set seems to avoid the crash on reboot I was seeing. > > > > > > > > > > And of course, I'm sure getting that set backported to 4.14 and > > > > > 4.9 (and maybe even 4.4, I need to check) will be less clean. > > > > > > > > Also, I just wanted to follow up on this as well. Does the above > > > > set of cherry-picks look ok to others for 4.19-stable? Does anyone > > > > have suggestions on how they'd like to see backports to 4.14, 4.9 and 4.4? > > > > > > If they are ok, can someone send me the commits as a series of > > > patches, as doing the above really doesn't help much :) > > > > Yea, so I'm happy to send that set to you for 4.19, assuming Felipe or someone else OKs it. > > I'm still at a bit of a loss for what to do for older (4.14/4.9/4.4) -stable kernels, as its going to be difficult to backport those. > > The patch mentioned in the title of this thread doesn't apply to older kernels. The kernel panic was introduced in 5.0-rcX. Right. On older kernels there was a separate issue that seems to be dwc3 specific that was biting me in a similar way. That's what the sha list above references. thanks -john