]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00221164 usb: device: fix calling mutex at atomic environment
authorPeter Chen <peter.chen@freescale.com>
Thu, 23 Aug 2012 02:49:12 +0000 (10:49 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:17 +0000 (08:35 +0200)
Move spin_unlock_irqrestore to avoid calling mutex at atomic
environment, as dr_wake_up_enable will call mutex_lock

Signed-off-by: Peter Chen <peter.chen@freescale.com>
drivers/usb/gadget/arcotg_udc.c

index bab3ec92a6b72eca75a0cbbe5fd2528cbefdb519..b6b6190b4da1231f4242136f28157c315657b5d1 100755 (executable)
@@ -2206,9 +2206,9 @@ static void fsl_gadget_disconnect_event(struct work_struct *work)
                fsl_writel(tmp | (OTGSC_B_SESSION_VALID_IRQ_EN),
                                &dr_regs->otgsc);
        udc->stopped = 1;
+       spin_unlock_irqrestore(&udc->lock, flags);
        /* enable wake up */
        dr_wake_up_enable(udc, true);
-       spin_unlock_irqrestore(&udc->lock, flags);
        /* close USB PHY clock */
        dr_phy_low_power_mode(udc, true);
        /* close dr controller clock */