]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
usb: gadget: pch_udc: Fix disconnect issue
authorTomoya MORINAGA <tomoya.rohm@gmail.com>
Thu, 12 Jan 2012 02:27:05 +0000 (11:27 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 22 Apr 2012 22:39:17 +0000 (15:39 -0700)
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>
drivers/usb/gadget/pch_udc.c

index 2d567ba473ea65e1d7617b759bf00c9573f82265..5070c2bd7271ce2d1622fbfe743746e098070083 100644 (file)
@@ -2336,8 +2336,11 @@ static void pch_udc_svc_ur_interrupt(struct pch_udc_dev *dev)
                /* Complete request queue */
                empty_req_queue(ep);
        }
-       if (dev->driver && dev->driver->disconnect)
+       if (dev->driver && dev->driver->disconnect) {
+               spin_unlock(&dev->lock);
                dev->driver->disconnect(&dev->gadget);
+               spin_lock(&dev->lock);
+       }
 }
 
 /**