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

Commit 2c557540 authored by Tony Lindgren's avatar Tony Lindgren Committed by Greg Kroah-Hartman
Browse files

usb: musb: Fix locking errors for host only mode



If we have USB gadgets disabled and USB_MUSB_HOST set, we get
errors "possible irq lock inverssion dependency detected"
errors during boot.

Let's fix the issue by adding start_musb flag and start
the controller after we're out of the spinlock protected
section.

Reported-by: default avatarLadislav Michl <ladis@linux-mips.org>
Tested-by: default avatarLadislav Michl <ladis@linux-mips.org>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarBin Liu <b-liu@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3fa2a81e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -290,6 +290,7 @@ int musb_hub_control(
	u32		temp;
	int		retval = 0;
	unsigned long	flags;
	bool		start_musb = false;

	spin_lock_irqsave(&musb->lock, flags);

@@ -390,7 +391,7 @@ int musb_hub_control(
			 * logic relating to VBUS power-up.
			 */
			if (!hcd->self.is_b_host && musb_has_gadget(musb))
				musb_start(musb);
				start_musb = true;
			break;
		case USB_PORT_FEAT_RESET:
			musb_port_reset(musb, true);
@@ -451,5 +452,9 @@ int musb_hub_control(
		retval = -EPIPE;
	}
	spin_unlock_irqrestore(&musb->lock, flags);

	if (start_musb)
		musb_start(musb);

	return retval;
}