FROMGIT: usb: dwc3: set pm runtime active before resume common
For device mode, if PM runtime autosuspend feature enabled, the runtime power status of dwc3 may be suspended when run dwc3_resume(), and dwc3 gadget would not be configured in dwc3_gadget_run_stop(). It would cause gadget connected failed if USB cable has been plugged before PM resume. So move forward pm_runtime_set_active() to fix it. Bug: 300024866 Change-Id: I53d07c7bfb86d4ae8d60e07096dff0fd68e30eff Signed-off-by: Frank Wang <frank.wang@rock-chips.com> Link: https://lore.kernel.org/r/20231206065939.16958-1-frank.wang@rock-chips.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 68c26fe58182f5af56bfa577d1cc0c949740baab https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
This commit is contained in:
parent
df1cdb0a70
commit
36248a15a7
1 changed files with 7 additions and 4 deletions
|
|
@ -2235,12 +2235,15 @@ static int dwc3_resume(struct device *dev)
|
|||
|
||||
pinctrl_pm_select_default_state(dev);
|
||||
|
||||
ret = dwc3_resume_common(dwc, PMSG_RESUME);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
pm_runtime_disable(dev);
|
||||
pm_runtime_set_active(dev);
|
||||
|
||||
ret = dwc3_resume_common(dwc, PMSG_RESUME);
|
||||
if (ret) {
|
||||
pm_runtime_set_suspended(dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
pm_runtime_enable(dev);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue