stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Mathias Nyman <mathias.nyman@linux.intel.com>
Cc: Oliver Neukum <oneukum@suse.com>,
	linux-usb@vger.kernel.org, Gavin Shan <gwshan@linux.vnet.ibm.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH 2/2] drivers/usb: Delete XHCI command timer if necessary
Date: Wed, 12 Aug 2015 09:18:57 -0700	[thread overview]
Message-ID: <20150812161857.GA29595@kroah.com> (raw)
In-Reply-To: <55CB2626.3060000@linux.intel.com>

On Wed, Aug 12, 2015 at 01:55:34PM +0300, Mathias Nyman wrote:
> On 11.08.2015 11:15, Oliver Neukum wrote:
> > On Mon, 2015-08-03 at 16:07 +0300, Mathias Nyman wrote:
> >> From: Gavin Shan <gwshan@linux.vnet.ibm.com>
> >>
> >> When xhci_mem_cleanup() is called, it's possible that the command
> >> timer isn't initialized and scheduled. For those cases, to delete
> >> the command timer causes soft-lockup as below stack dump shows.
> >>
> >> The patch avoids deleting the command timer if it's not scheduled
> >> with the help of timer_pending().
> > 
> > Are you sure this is safe? timer_pending() will not show you that
> > the timer function is running. It looks like you introduced a race
> > between timeout and cleanup.
> > 
> 
> Looking at it in more detail you're right.
> 
> Fortunately this can only happen in cases where xhci is already hosed
> (no command response for 5 seconds), and we are at the same time
> anyway about to remove xhci.
> 
> Doesn't this mean that all cases with
> if (timer_pending(&timer))
> 	del_timer_sync(&timer)
> 
> is just basically the same as a plain del_timer(&timer)?
> 
> Anyways, turns out that the error path in xhci initialization code can end up calling
> del_timer_sync() before timer is initialized. This should be fixed by re-arranging
> some code in xhci initialization instead.
> 
> Greg, should this be reverted in rc7?
> I think that the possible side effect of this patch is still lesser the original
> issue.     

Just fix it "right" in a new patch.

thanks,

greg k-h

      parent reply	other threads:[~2015-08-12 16:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1438607269-8977-1-git-send-email-mathias.nyman@linux.intel.com>
2015-08-03 13:07 ` [PATCH 1/2] xhci: fix off by one error in TRB DMA address boundary check Mathias Nyman
2015-08-03 13:07 ` [PATCH 2/2] drivers/usb: Delete XHCI command timer if necessary Mathias Nyman
2015-08-11  8:15   ` Oliver Neukum
2015-08-12 10:55     ` Mathias Nyman
2015-08-12 13:08       ` Oliver Neukum
2015-08-12 16:18       ` Greg KH [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=20150812161857.GA29595@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=gwshan@linux.vnet.ibm.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    --cc=oneukum@suse.com \
    --cc=stable@vger.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).