stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Evan Green <evgreen@google.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: "He, Bo" <bo.he@intel.com>,
	Felipe Balbi <felipe.balbi@linux.intel.com>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Sam Protsenko <semen.protsenko@linaro.org>,
	Doug Anderson <dianders@chromium.org>,
	Stephen Boyd <swboyd@chromium.org>,
	Matthias Kaehlcke <mka@chromium.org>
Subject: Re: Backporting dwc3 gadget fixes
Date: Mon, 4 Feb 2019 13:13:53 -0800	[thread overview]
Message-ID: <CAE=gft5b6WxMt=gdVjEPMDpnZdVL+MLnhDmGKU4b0QGFryDmaA@mail.gmail.com> (raw)
In-Reply-To: <20190204091156.GD2015@kroah.com>

On Mon, Feb 4, 2019 at 1:12 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Tue, Jan 29, 2019 at 11:15:50AM -0800, Evan Green wrote:
> > On Tue, Jan 29, 2019 at 2:22 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> > >
> > > On Wed, Jan 23, 2019 at 10:46:52AM -0800, Evan Green wrote:
> > > > Hi Felipe,
> > > > Well, I've only tried on the one device that has a dwc3 controller.
> > > > Given that the bug was "scheduling while atomic", the stack trace
> > > > always had dwc3_gadget_ep_dequeue doing the sleeping, and it only
> > > > happened when I had a gadget plugged in, I felt pretty solid that this
> > > > was the same bug.
> > > >
> > > > Also, Matthias pointed out I was looking at an older series when I was
> > > > figuring out which patches went together. Check my work, but the
> > > > series seems to be here:
> > > > https://patchwork.kernel.org/project/linux-usb/list/?series=42875
> > > >
> > > > The first 3 patches are already backported. Then there were a couple
> > > > extra I had missed before. So the complete set would look like:
> > > >
> > > > d53701067f04 usb: dwc3: gadget: check if dep->frame_number is still valid
> > > > 3451f6affaef usb: dwc3: gadget: remove unnecessary dev_info()
> > > > 1517265228b4 usb: dwc3: trace: log ep commands in hex
> > > > 25abad6a0584 usb: dwc3: gadget: return errors from __dwc3_gadget_start_isoc()
> > > > fec9095bdef4e usb: dwc3: gadget: remove wait_end_transfer
> > > > d4f1afe5e896c usb: dwc3: gadget: move requests to cancelled_list
> > > > d5443bbf5fc8f usb: dwc3: gadget: introduce cancelled_list
> > > > 7746a8dfb3f9c usb: dwc3: gadget: extract dwc3_gadget_ep_skip_trbs()
> > > > c3acd59014148 usb: dwc3: gadget: use num_trbs when skipping TRBs on ->dequeue()
> > > > 09fe1f8d7e2f4 usb: dwc3: gadget: track number of TRBs per request
> > > > 1a22ec6435806 usb: dwc3: gadget: combine unaligned and zero flags
> > > >
> > > > Though perhaps only the stuff up through "move requests to
> > > > cancelled_list" is the important stuff... Felipe might be able to say
> > > > better.
> > >
> > > Can someone send me a correct list of exactly what patches to commit, to
> > > what kernel tree(s), and in what order?  Ideally you would have also
> > > tested them yourself...
> > >
> > > As it is, this "random list of commits" doesn't make me feel good about
> > > backporting.
> >
> > Ok here's my recommendation, in short form: cherry-pick
> > 1dbcd8d42c02..fec9095bdef4 to 4.19.
> >
> > Long form rationale below:
> > The series these fixes came from is this:
> > https://patchwork.kernel.org/project/linux-usb/list/?series=42875
> >
> > The first three are already in stable. I recommend picking the below
> > commits, which I've listed in git log order, so the apply order would
> > be bottom-up:
> > fec9095bdef4e usb: dwc3: gadget: remove wait_end_transfer
> > d4f1afe5e896c usb: dwc3: gadget: move requests to cancelled_list
> > d5443bbf5fc8f usb: dwc3: gadget: introduce cancelled_list
> > 7746a8dfb3f9c usb: dwc3: gadget: extract dwc3_gadget_ep_skip_trbs()
> > c3acd59014148 usb: dwc3: gadget: use num_trbs when skipping TRBs on ->dequeue()
> > 09fe1f8d7e2f4 usb: dwc3: gadget: track number of TRBs per request
> > 1a22ec6435806 usb: dwc3: gadget: combine unaligned and zero flags
>
> This first patch here, breaks the build on 4.20 and 4.19 :(
>
> So I don't know how you tested this.
>
> Can you provide me a full patch series, properly backported, that
> applies to 4.20.y and 4.19.y, so that I can get this in a tested format
> that can be applied properly?

Darn it. This worked 6 days ago. This commit came in and wrecked me:

commit 25ad17d692ad54c3c33b2a31e5ce2a82e38de14e
Author:     Jack Pham <jackp@codeaurora.org>
AuthorDate: Thu Jan 10 12:39:55 2019 -0800
Commit:     Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CommitDate: Thu Jan 31 08:14:42 2019 +0100

    usb: dwc3: gadget: Clear req->needs_extra_trb flag on cleanup

    commit bd6742249b9ca918565e4e3abaa06665e587f4b5 upstream.

So then the directions for 4.19 would be:
1) revert 25ad17d692ad
2) cherry-pick d92021f66063..fec9095bdef4
3) cherry-pick bd6742249b9c (which was the reverted commit, that now
applies without modification from upstream).

For 4.20, this would be revert 5eaf9833f5be, then cherry-pick same as
above. I've got trees where I've done this below:

https://chromium.googlesource.com/chromiumos/third_party/kernel/+log/refs/sandbox/evgreen/stable-4.19.y-dwc3-gadget
https://chromium.googlesource.com/chromiumos/third_party/kernel/+log/refs/sandbox/evgreen/stable-4.20.y-dwc3-gadget

The testing I've done on these trees is to do make allmodconfig and
ensure that they build cleanly. I was also able to test merging the
4.19 one into the ChromeOS tree and reboot while a gadget was
connected (which fixes the problem I was seeing before).

If you'd prefer I email out patches that do the same, I'm happy to do that too.
-Evan

  reply	other threads:[~2019-02-04 21:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-23  0:37 Backporting dwc3 gadget fixes Evan Green
2019-01-23  6:32 ` Felipe Balbi
2019-01-23  6:55   ` He, Bo
2019-01-23 18:46     ` Evan Green
2019-01-29 10:22       ` Greg KH
2019-01-29 19:15         ` Evan Green
2019-02-04  9:11           ` Greg KH
2019-02-04 21:13             ` Evan Green [this message]
2019-02-11 13:41               ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAE=gft5b6WxMt=gdVjEPMDpnZdVL+MLnhDmGKU4b0QGFryDmaA@mail.gmail.com' \
    --to=evgreen@google.com \
    --cc=bo.he@intel.com \
    --cc=dianders@chromium.org \
    --cc=felipe.balbi@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=mka@chromium.org \
    --cc=semen.protsenko@linaro.org \
    --cc=stable@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=swboyd@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).