lkml.org 
[lkml]   [2012]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] usb hub: send clear_tt_buffer_complete events when canceling TT clear work
From
Hi Alan,

On Mon, Oct 1, 2012 at 8:48 PM, Alan Stern <stern@rowland.harvard.edu> wrote:
>
> On Mon, 1 Oct 2012, Alan Stern wrote:
>
> > On Mon, 1 Oct 2012, Octavian Purdila wrote:
> >
> > > There is a race condition in the USB hub code with regard to handling
> > > TT clear requests that can get the HCD driver in a deadlock. Usually
> > > when an TT clear request is scheduled it will be executed immediately:
> >
> > > However, if a suspend operation is triggered before hub_tt_work is
> > > scheduled, hub_quiesce will cancel the work without notifying the HCD
> > > driver:
> >
> > Ah, this is a very good point.
> >
> > > When the device will resume the EHCI driver will get stuck in
> > > ehci_endpoint_disable waiting for the tt_clearing flag to reset:
> >
> > > This patch notifies the HCD driver via clear_tt_buffer_complete
> > > when canceling TT clear work so that the EHCI driver has a chance to
> > > clear its tt_clearing flag.
> >
> > But I don't like the proposed fix. What we really need to do is avoid
> > suspending the device until the clear-tt-buffer operation is complete.
> > Can you write a patch to do that instead?
>
> Actually, it would be sufficient to avoid suspending the _hub_ until
> the clear-tt-buffer operation is complete. In short, hub_quiesce()
> should wait until all pending TT operations have finished. The
> cancel_work_sync() call should be replaced with flush_work_sync().
>

Good point, i will resend the patch. I will only be able to test the
fix tomorrow though, I don't have access to the setup that reproduces
the issue.

Thanks!
Tavi


\
 
 \ /
  Last update: 2012-10-03 08:01    [W:0.078 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site