Commit a46f2b4
committed
usb: dwc3: rockchip: fix usb peripheral connection fail
This patch fix the issue that usb peripheral fails to connect
to PC after resume from deep sleep. In my test case, I use a
rk3399 sapphire excavator board, and test usb as follows:
- Let the system enter deep sleep without usb connection.
- During deep sleep, connect the Type-C0 of rk3399 with PC usb port.
- Press power key to wakeup system, and check if the PC can detect usb.
Without this patch, the usb enumeration often fail with the
error log "dwc3 fe800000.dwc3: failed to enable ep0out". It's
because that after system resume, the dwc3 pm resume and dwc3
pm runtime resume are running asynchronously. If dwc3 runtime
resume before pm resume, the dwc3_resume_common() maybe called
twice, and cause ep enable failure.
This patch use the suspend flag of dev to wait until the dwc3
core resume from PM suspend successfully before do dwc3 pm
runtime resume.
Change-Id: I6a67ad636630699569e16346ac167b785b800f85
Signed-off-by: William Wu <william.wu@rock-chips.com>1 parent 690646e commit a46f2b4
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
411 | | - | |
| 411 | + | |
| 412 | + | |
412 | 413 | | |
413 | 414 | | |
414 | 415 | | |
| |||
442 | 443 | | |
443 | 444 | | |
444 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
445 | 456 | | |
446 | 457 | | |
447 | 458 | | |
| |||
574 | 585 | | |
575 | 586 | | |
576 | 587 | | |
577 | | - | |
578 | 588 | | |
579 | 589 | | |
580 | 590 | | |
| |||
0 commit comments