ID dig disconnect interrupt will happen and notify dwc3 controller
to remove hcd as soon as resume, and release root hub, but the hcd
has not resume, so there is a logic error and it may result in NULL
pointer, this patch forbid remove hcd when the state of hcd is suspend.
Change-Id: Ia5673848a23528cd053d75910c0fdbddf0927a40
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
DWC3_GCTL_PRTCAP(reg) == DWC3_GCTL_PRTCAP_OTG) {
hcd = dev_get_drvdata(&dwc->xhci->dev);
+ if (hcd->state == HC_STATE_SUSPENDED) {
+ dev_dbg(rockchip->dev, "USB suspended\n");
+ goto out;
+ }
+
if (hcd->state != HC_STATE_HALT) {
usb_remove_hcd(hcd->shared_hcd);
usb_remove_hcd(hcd);