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

Commit afff6067 authored by Stephen Boyd's avatar Stephen Boyd Committed by Peter Chen
Browse files

usb: chipidea: Drop lock across event_notify during gadget stop



The CI_HDRC_CONTROLLER_STOPPED_EVENT may want to call sleeping
APIs similar to how _gadget_stop_activity() may. Let's drop the
lock across the event so that glue drivers can make sleeping
calls.

Cc: Peter Chen <peter.chen@nxp.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
parent ed04f19f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1793,10 +1793,10 @@ static int ci_udc_stop(struct usb_gadget *gadget)

	if (ci->vbus_active) {
		hw_device_state(ci, 0);
		spin_unlock_irqrestore(&ci->lock, flags);
		if (ci->platdata->notify_event)
			ci->platdata->notify_event(ci,
			CI_HDRC_CONTROLLER_STOPPED_EVENT);
		spin_unlock_irqrestore(&ci->lock, flags);
		_gadget_stop_activity(&ci->gadget);
		spin_lock_irqsave(&ci->lock, flags);
		pm_runtime_put(&ci->gadget.dev);