USB: fsl_qe_udc: Fix recursive locking bug in ch9getstatus()
authorAnton Vorontsov <avorontsov@ru.mvista.com>
Thu, 25 Dec 2008 14:15:05 +0000 (17:15 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 9 Feb 2009 19:19:46 +0000 (11:19 -0800)
commita30551db66afa1b53a4fa7ceadddb7122bdcf491
treebbd4f0468a7417067bf7ebb5001368b01f8c7e90
parent94f341db3dd080851f918da37e84659ef760da26
USB: fsl_qe_udc: Fix recursive locking bug in ch9getstatus()

The call chain is this:

qe_udc_irq() <- grabs the udc->lock spinlock
rx_irq()
qe_ep0_rx()
ep0_setup_handle()
setup_received_handle()
ch9getstatus()
qe_ep_queue() <- tries to grab the udc->lock again

It seems unsafe to temporarily drop the lock in the ch9getstatus(),
so to fix that bug the lock-less __qe_ep_queue() function
implemented and used by the ch9getstatus().

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/fsl_qe_udc.c