diff options
author | Robert Jarzmik <[email protected]> | 2010-01-27 18:38:03 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2010-03-02 14:54:47 -0800 |
commit | 5e23e90f33888769ffe253663cc5f3ea0bb6da49 (patch) | |
tree | 9a59d36fdaaecea5eb7fa2d39c655032dc6920a2 /lib/string_helpers.c | |
parent | fb088e335d78f866be2e56eac6d500112a96aa11 (diff) |
USB: pxa27x_udc: Fix deadlocks on request queueing
As reported by Antonio, there are cases where the ep->lock
can be taken twice, triggering a deadlock.
The typical sequence is :
irq_handler
\
-> gadget.complete()
\
-> pxa27x_udc.pxa_ep_queue() : ep->lock is taken
\
-> gadget.complete()
\
-> pxa27x_udc.pxa_ep_queue() : ep->lock is taken
==> *deadlock*
The patch fixes this by :
- releasing the lock each time gadget.complete() is called
- adding a check in handle_ep() to detect a recursive call,
in which case the function becomes on no-op.
The patch is still not good enough for ep0. For this unique
endpoint, another well thought over patch will be needed.
Reported-by: Antonio Ospite <[email protected]>
Tested-by: Antonio Ospite <[email protected]>
Signed-off-by: Robert Jarzmik <[email protected]>
Cc: David Brownell <[email protected]>
Cc: Eric Miao <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'lib/string_helpers.c')
0 files changed, 0 insertions, 0 deletions