Re: [PATCH] hid: usbhid: fix possible deadlock in __usbhid_submit_report

From
Alan Stern <stern@rowland.harvard.edu>
Date
2012-04-21 17:31:21
Reply to
Ming Lei, 2012-04-21
On Sat, 21 Apr 2012, Ming Lei wrote:
quoted
quoted
Think about what happens if the URB being unlinked hasn't been
presented to the hardware yet. �Once it has been removed from the HCD's
internal lists, there's no reason not to give it back right away. �And
there's no natural time to give it back later.
Now. The question is not when, but from which context.
The context should be uniform, so that the requirements
for locking should also be uniform.
How about always scheduling a tasklet to run what usb_unlink_urb does?
just implement usb_unlink_urb as something like
tasklet_schedule(unlink_tasklet).

Then we can have a uniform lock requirement and no changes are involved
on host controller drivers.
The return values would not be correct.

On the other hand, usbnet could call usb_unlink_urb from within a 
tasklet.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thread (5 messages) 5 messages, 3 authors, last reply 2012-04-22
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help