linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Felipe Balbi <balbi@kernel.org>
Cc: Peter Chen <peter.chen@kernel.org>,
	Jack Pham <jackp@codeaurora.org>,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH 1/1] usb: dwc3: core: fix kernel panic when do reboot
Date: Fri, 11 Jun 2021 15:30:15 +0200	[thread overview]
Message-ID: <YMNlZ1gg0kuSyaEG@kroah.com> (raw)
In-Reply-To: <87lf7gzg9d.fsf@kernel.org>

On Fri, Jun 11, 2021 at 04:23:58PM +0300, Felipe Balbi wrote:
> Peter Chen <peter.chen@kernel.org> writes:
> 
> > On 21-06-10 08:36:57, Greg Kroah-Hartman wrote:
> >> On Thu, Jun 10, 2021 at 10:00:47AM +0800, Peter Chen wrote:
> >> > On 21-06-09 11:42:53, Greg Kroah-Hartman wrote:
> >> > > On Wed, Jun 09, 2021 at 11:01:07AM +0200, Greg Kroah-Hartman wrote:
> >> > > > On Tue, Jun 08, 2021 at 09:50:01AM -0700, Jack Pham wrote:
> >> > > > > Hi Peter,
> >> > > > > 
> >> > > > > On Tue, Jun 08, 2021 at 06:56:56PM +0800, Peter Chen wrote:
> >> > > > > > When do system reboot, it calls dwc3_shutdown and the whole debugfs
> >> > > > > > for dwc3 has removed first, when the gadget tries to do deinit, and
> >> > > > > > remove debugfs for its endpoints, it meets NULL pointer dereference
> >> > > > > > issue when call debugfs_lookup. Fix it by removing the whole dwc3
> >> > > > > > debugfs later than dwc3_drd_exit.
> >> > > > > 
> >> > > > > Ouch, thanks for catching this! I think in your previous reply[1] you
> >> > > > > did warn about the debugfs_remove_recursive() getting called twice, but
> >> > > > > it seems here the issue is due to the debugfs_lookup() getting called on
> >> > > > > a stale dwc->root pointer after it was already removed.
> >> > > > 
> >> > > > We can also fix this by getting rid of that "root" pointer as it's
> >> > > > useless (we can look it up if we need it.)  I'll send a patch later to
> >> > > > do that, as it's a good idea to do anyway, and is independant of this
> >> > > > fix.
> >> > > 
> >> > > Now sent:
> >> > > 	https://lore.kernel.org/r/20210609093924.3293230-1-gregkh@linuxfoundation.org
> >> > 
> >> > Hi Felipe,
> >> > 
> >> > With Greg above patch, this issue is fixed indirectly. I don't think my patch is
> >> > needed, do you think so?
> >> 
> >> Which patch is "your patch" here?
> >> 
> >
> > The patch in this thread.
> 
> This one, Greg:
> https://lore.kernel.org/r/20210609093924.3293230-1-gregkh@linuxfoundation.org
> 
> Now that we have that, I don't think $subject is required.

I don't think it's needed to revert, it's all "safer" this way...

thanks,

greg k-h

      reply	other threads:[~2021-06-11 13:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 10:56 [PATCH 1/1] usb: dwc3: core: fix kernel panic when do reboot Peter Chen
2021-06-08 13:37 ` Andy Shevchenko
2021-06-08 16:50 ` Jack Pham
2021-06-09  9:01   ` Greg Kroah-Hartman
2021-06-09  9:42     ` Greg Kroah-Hartman
2021-06-10  2:00       ` Peter Chen
2021-06-10  6:36         ` Greg Kroah-Hartman
2021-06-10 13:58           ` Peter Chen
2021-06-11 13:23             ` Felipe Balbi
2021-06-11 13:30               ` Greg Kroah-Hartman [this message]

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=YMNlZ1gg0kuSyaEG@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=balbi@kernel.org \
    --cc=jackp@codeaurora.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.chen@kernel.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).