lkml.org 
[lkml]   [2008]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] USB: fix deadlock in HCD code
On Wed, 21 May 2008, Oliver Neukum wrote:

> Am Mittwoch 21 Mai 2008 15:36:49 schrieb Jiri Kosina:
> > On Wed, 21 May 2008, Oliver Neukum wrote:
> >
> > > This turns out not to be the case. Interrupts are disabled.
> >
> > You're right, this callchain can't cause the deadlock indeed. I'll go
> > through the other possibilities.

The functions you are worried about (usb_hcd_link_urb_to_ep and
usb_hcd_unlink_urb_from_ep) are documented as requiring that interrupts
be disabled by their callers. This patch isn't needed.

(Of course, other patches may be needed to insure that the callers do
indeed disable interrupts. But I'm not aware of any such need.)

> usb_hcd_flush_endpoint() is an obvious case.

It's not obvious to me. Where does usb_hcd_flush_endpoint() acquire
hcd_urb_list_lock with interrupts enabled?

> Used in the suspend code.
> Your patch is indeed correct, but I fear there might be a second bug caused
> by wrong calling conditions.

The problem in the Novell bugzilla entry was caused by the fact that
the OHCI irq routine was invoked with interrupts enabled, owing to a
missing IRQF_DISABLED flag. That bug has already been fixed in 2.6.25.

Alan Stern



\
 
 \ /
  Last update: 2008-05-21 16:17    [W:0.051 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site