Skip to content

Commit

Permalink
USB: musb: minor locking fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Brownell authored and Greg Kroah-Hartman committed Jan 7, 2009
1 parent 58e6602 commit 71783e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/musb/omap2430.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 71783e0

Please sign in to comment.