]> git.baikalelectronics.ru Git - kernel.git/commit
USB: gadget: cdc-acm deadlock fix
authorDavid Brownell <dbrownell@users.sourceforge.net>
Wed, 12 Nov 2008 19:35:13 +0000 (11:35 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 13 Nov 2008 22:45:06 +0000 (14:45 -0800)
commitca008f1bb57fc8f1c918c8a79a1b1dbab6d6ba2e
tree8b6399e374401dea2ee7e170a39b596c62605f88
parent16be909c1d5ca8bcc41ac76f0bdac78db58e4336
USB: gadget: cdc-acm deadlock fix

This fixes a deadlock appearing with some USB peripheral drivers
when running CDC ACM gadget code.

The newish (2.6.27) CDC ACM event notification mechanism sends
messages (IN to the host) which are short enough to fit in most
FIFOs.  That means that with some peripheral controller drivers
(evidently not the ones used to verify the notification code!!)
the completion callback can be issued before queue() returns.

The deadlock would come because the completion callback and the
event-issuing code shared a spinlock.  Fix is trivial:  drop
that lock while queueing the message.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/f_acm.c