usb: dwc2: fix USB bus repeatedly suspending and resuming

When system wakeup, It will call _dwc2_hcd_resume function and the
port_suspend_change flag will be set to 1 in _dwc2_hcd_resume function.
But in current code, the autosuspend delay for hub is set to zero and
this will cause a strange phenomenon where the USB bus will repeatedly
suspending and resuming.

Considering that setting the port_suspend_change to 1 is only applicable
for partial power mode, there is no need to set port_suspend_change to
1 when DWC2 IP not support partial power mode.

Fixes: c74c26f6e3 ("usb: dwc2: Fix partial power down exiting by
system resume")
Change-Id: Ia57bfb8502cb55a5d9375a5ad609ac4104ff8acb
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Jianwei Zheng <jianwei.zheng@rock-chips.com>
This commit is contained in:
Jianwei Zheng
2024-07-23 18:07:40 +08:00
committed by Tao Huang
parent d036e8956b
commit 78999d6007

View File

@@ -4503,7 +4503,8 @@ static int _dwc2_hcd_resume(struct usb_hcd *hcd)
}
/* Change Root port status, as port status change occurred after resume.*/
hsotg->flags.b.port_suspend_change = 1;
if (hsotg->params.power_down == DWC2_POWER_DOWN_PARAM_PARTIAL)
hsotg->flags.b.port_suspend_change = 1;
/*
* Enable power if not already done.