gadget methods should be called without
spinlocks held.

Reported-by: Alexey Khoroshilov <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
---
 drivers/usb/gadget/udc/pch_udc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/gadget/udc/pch_udc.c b/drivers/usb/gadget/udc/pch_udc.c
index e5f4c5274298..3181fc9c1c49 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)
-- 
2.5.0.GIT

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to