Skip to content

Commit

Permalink
usb: dwc3: gadget: release spin lock during gadget resume
Browse files Browse the repository at this point in the history
It's a requirement that we release controller's lock
while calling gadget API function pointers. This
patch just fixes that long standing bug.

Signed-off-by: Jiebing Li <jiebing.li@intel.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
  • Loading branch information
Jiebing Li authored and Felipe Balbi committed Mar 29, 2016
1 parent f59dcab commit ad14d4e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -2487,7 +2487,11 @@ static void dwc3_gadget_wakeup_interrupt(struct dwc3 *dwc)
* implemented.
*/

dwc->gadget_driver->resume(&dwc->gadget);
if (dwc->gadget_driver && dwc->gadget_driver->resume) {
spin_unlock(&dwc->lock);
dwc->gadget_driver->resume(&dwc->gadget);
spin_lock(&dwc->lock);
}
}

static void dwc3_gadget_linksts_change_interrupt(struct dwc3 *dwc,
Expand Down

0 comments on commit ad14d4e

Please sign in to comment.