diff options
author | Tomoya MORINAGA <tomoya.rohm@gmail.com> | 2012-01-11 21:27:05 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-22 19:21:42 -0400 |
commit | 21c7c5809c9d11ad3c1cdba9f0935b97ae4ccdd3 (patch) | |
tree | 5ed61a1430dd47202f2605e2a0823545dd4da1fa | |
parent | a1fdbba66d5a3a7ec0cc78ac8c1f19d99d37454e (diff) |
usb: gadget: pch_udc: Fix disconnect issue
commit c50a3bff0edb0acd49d8033a12ea4668e09a31ad upstream.
ISSUE:
When the driver notifies a gadget of a disconnect event, a system
rarely freezes.
CAUSE:
When the driver calls dev->driver->disconnect(), it is not calling
spin_unlock().
Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/gadget/pch_udc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/gadget/pch_udc.c b/drivers/usb/gadget/pch_udc.c index 68dbcc3e4cc..2b731f3efab 100644 --- a/drivers/usb/gadget/pch_udc.c +++ b/drivers/usb/gadget/pch_udc.c | |||
@@ -2338,8 +2338,11 @@ static void pch_udc_svc_ur_interrupt(struct pch_udc_dev *dev) | |||
2338 | /* Complete request queue */ | 2338 | /* Complete request queue */ |
2339 | empty_req_queue(ep); | 2339 | empty_req_queue(ep); |
2340 | } | 2340 | } |
2341 | if (dev->driver && dev->driver->disconnect) | 2341 | if (dev->driver && dev->driver->disconnect) { |
2342 | spin_unlock(&dev->lock); | ||
2342 | dev->driver->disconnect(&dev->gadget); | 2343 | dev->driver->disconnect(&dev->gadget); |
2344 | spin_lock(&dev->lock); | ||
2345 | } | ||
2343 | } | 2346 | } |
2344 | 2347 | ||
2345 | /** | 2348 | /** |