diff options
author | Baolin Wang <baolin.wang@linaro.org> | 2016-06-20 16:19:48 +0800 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-06-21 10:44:37 +0300 |
commit | da1410be21bfedd16740aee6d772e669cf4e852f (patch) | |
tree | 32b30a2faf52ab032a15734b2848a78bb1121cdf /drivers/usb | |
parent | 0e146028eebf989e86d3fe9385b76434e954c84e (diff) | |
download | linux-da1410be21bfedd16740aee6d772e669cf4e852f.tar.gz linux-da1410be21bfedd16740aee6d772e669cf4e852f.tar.bz2 linux-da1410be21bfedd16740aee6d772e669cf4e852f.zip |
usb: dwc3: gadget: Add the suspend state checking when stopping gadget
It will be crash to stop gadget when the dwc3 device had been into suspend
state, thus we need to check if the dwc3 device had been into suspend state
when UDC try to stop gadget.
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index b1fec36f4764..b9bc646511ce 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1803,6 +1803,9 @@ err0: static void __dwc3_gadget_stop(struct dwc3 *dwc) { + if (pm_runtime_suspended(dwc->dev)) + return; + dwc3_gadget_disable_irq(dwc); __dwc3_gadget_ep_disable(dwc->eps[0]); __dwc3_gadget_ep_disable(dwc->eps[1]); |