You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
usb: dwc2: fix dwc2 resume failed when device is connected
Current code if the device is connected and do _dwc2_hcd_resume(),
it will goto unlock and exit this function, cause some dwc2
controllers that does not support Partial Power Down mode resume
failed and perform the following error log:
usb 2-1: reset high-speed USB device number 2 using dwc2
usb 2-1: device descriptor read/64, error -110
usb 2-1: device descriptor read/64, error -110
Fixes: c74c26f6e3 ("usb: dwc2: Fix partial power down exiting by
system resume")
Change-Id: I34d449f1286c8122883aedcd830f2744f1a2267d
Signed-off-by: Jianwei Zheng <jianwei.zheng@rock-chips.com>
This commit is contained in:
@@ -4447,20 +4447,19 @@ static int _dwc2_hcd_resume(struct usb_hcd *hcd)
|
||||
if (hsotg->lx_state != DWC2_L2)
|
||||
goto unlock;
|
||||
|
||||
hprt0 = dwc2_read_hprt0(hsotg);
|
||||
|
||||
/*
|
||||
* Added port connection status checking which prevents exiting from
|
||||
* Partial Power Down mode from _dwc2_hcd_resume() if not in Partial
|
||||
* Power Down mode.
|
||||
*/
|
||||
if (hprt0 & HPRT0_CONNSTS) {
|
||||
hsotg->lx_state = DWC2_L0;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
switch (hsotg->params.power_down) {
|
||||
case DWC2_POWER_DOWN_PARAM_PARTIAL:
|
||||
hprt0 = dwc2_read_hprt0(hsotg);
|
||||
/*
|
||||
* Added port connection status checking which prevents exiting from
|
||||
* Partial Power Down mode from _dwc2_hcd_resume() if not in Partial
|
||||
* Power Down mode.
|
||||
*/
|
||||
if (hprt0 & HPRT0_CONNSTS) {
|
||||
hsotg->lx_state = DWC2_L0;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
ret = dwc2_exit_partial_power_down(hsotg, 0, true);
|
||||
if (ret)
|
||||
dev_err(hsotg->dev,
|
||||
|
||||
Reference in New Issue
Block a user