aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2015-09-28 10:45:47 -0500
committerFelipe Balbi <balbi@ti.com>2015-09-28 11:24:29 -0500
commit9903b6bedd389a033a3da0308f220571c7f68e7a (patch)
tree9d555dc11f771c99bbca705b44ae759edff51da0
parent9caeb06ebd4687bc40a67d94facabb2d31c702ce (diff)
usb: gadget: pch-udc: fix lock
gadget methods should be called without spinlocks held. Reported-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--drivers/usb/gadget/udc/pch_udc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/gadget/udc/pch_udc.c b/drivers/usb/gadget/udc/pch_udc.c
index e5f4c52..3181fc9 100644
--- a/drivers/usb/gadget/udc/pch_udc.c
+++ b/drivers/usb/gadget/udc/pch_udc.c
@@ -2747,18 +2747,18 @@ static void pch_udc_dev_isr(struct pch_udc_dev *dev, u32 dev_intr)
if (dev_intr & UDC_DEVINT_US) {
if (dev->driver
&& dev->driver->suspend) {
- spin_lock(&dev->lock);
- dev->driver->suspend(&dev->gadget);
spin_unlock(&dev->lock);
+ dev->driver->suspend(&dev->gadget);
+ spin_lock(&dev->lock);
}
vbus = pch_vbus_gpio_get_value(dev);
if ((dev->vbus_session == 0)
&& (vbus != 1)) {
if (dev->driver && dev->driver->disconnect) {
- spin_lock(&dev->lock);
- dev->driver->disconnect(&dev->gadget);
spin_unlock(&dev->lock);
+ dev->driver->disconnect(&dev->gadget);
+ spin_lock(&dev->lock);
}
pch_udc_reconnect(dev);
} else if ((dev->vbus_session == 0)