USB: musb: minor locking fix
authorDavid Brownell <dbrownell@users.sourceforge.net>
Mon, 24 Nov 2008 11:06:49 +0000 (13:06 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 7 Jan 2009 17:59:59 +0000 (09:59 -0800)
Minor locking fix for musb_hdrc on OMAP3 and OMAP2430:
don't read DEVCTL without holding the spinlock, since
an IRQ could come in and corrupt things.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/musb/omap2430.c

index 52988a403b5c59b75bbea578dd53145c49893d23..901dffdf23b105da687e53ee076ca35ce806bc29 100644 (file)
@@ -58,10 +58,10 @@ static void musb_do_idle(unsigned long _musb)
 #endif
        u8      devctl;
 
-       devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
-
        spin_lock_irqsave(&musb->lock, flags);
 
+       devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
+
        switch (musb->xceiv.state) {
        case OTG_STATE_A_WAIT_BCON:
                devctl &= ~MUSB_DEVCTL_SESSION;