瀏覽代碼

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>
Baolin Wang 9 年之前
父節點
當前提交
da1410be21
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      drivers/usb/dwc3/gadget.c

+ 3 - 0
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]);