Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71783e0d authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman
Browse files

USB: musb: minor locking fix



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: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 58e66026
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -58,10 +58,10 @@ static void musb_do_idle(unsigned long _musb)
#endif
#endif
	u8	devctl;
	u8	devctl;


	devctl = musb_readb(musb->mregs, MUSB_DEVCTL);

	spin_lock_irqsave(&musb->lock, flags);
	spin_lock_irqsave(&musb->lock, flags);


	devctl = musb_readb(musb->mregs, MUSB_DEVCTL);

	switch (musb->xceiv.state) {
	switch (musb->xceiv.state) {
	case OTG_STATE_A_WAIT_BCON:
	case OTG_STATE_A_WAIT_BCON:
		devctl &= ~MUSB_DEVCTL_SESSION;
		devctl &= ~MUSB_DEVCTL_SESSION;