Skip to content

usb: dwc2: Fix Hibernation issues.

Artur Petrosyan linux-usb lkml oe-kbuild oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest15 patches 15 repliesIn review

Changes in v2 from the cover letter

Updated bellow patches. Moved duplicated error checking *if* conditions from innermost to outside if.
1. usb: dwc2: Add exit hibernation mode before removing drive
2. usb: dwc2: Allow exit hibernation in urb enqueue

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15usb: dwc2: Update exit hibernation when port reset is asserteddrivers/usb/dwc2/hcd.c+11 -60 replies
1/15usb: dwc2: Update exit hibernation when port reset is asserteddrivers/usb/dwc2/hcd.c+11 -61 reply
2/15usb: dwc2: Reset DEVADDR after exiting gadget hibernation.drivers/usb/dwc2/gadget.c+4 -00 replies
2/15usb: dwc2: Reset DEVADDR after exiting gadget hibernation.drivers/usb/dwc2/gadget.c+4 -00 replies
3/15usb: dwc2: Fix host mode hibernation exit with remote wakeup flow.drivers/usb/dwc2/hcd.c+9 -10 replies
3/15usb: dwc2: Fix host mode hibernation exit with remote wakeup flow.drivers/usb/dwc2/hcd.c+9 -11 reply
4/15usb: dwc2: Fix hibernation between host and device modes.drivers/usb/dwc2/core_intr.c+83 -710 replies
4/15usb: dwc2: Fix hibernation between host and device modes.drivers/usb/dwc2/core_intr.c+83 -710 replies
5/15usb: dwc2: Allow exiting hibernation from gpwrdn rst detectdrivers/usb/dwc2/core_intr.c+18 -50 replies
5/15usb: dwc2: Allow exiting hibernation from gpwrdn rst detectdrivers/usb/dwc2/core_intr.c+18 -50 replies
6/15usb: dwc2: Clear fifo_map when resetting core.drivers/usb/dwc2/core.c drivers/usb/dwc2/core.h+19 -00 replies
6/15usb: dwc2: Clear fifo_map when resetting core.drivers/usb/dwc2/core.c drivers/usb/dwc2/core.h+19 -00 replies
7/15usb: dwc2: Clear GINTSTS_RESTOREDONE bit after restore is generated.drivers/usb/dwc2/core.c+6 -00 replies
7/15usb: dwc2: Clear GINTSTS_RESTOREDONE bit after restore is generated.drivers/usb/dwc2/core.c+6 -00 replies
8/15usb: dwc2: Move enter hibernation to dwc2_port_suspend() functiondrivers/usb/dwc2/hcd.c+14 -40 replies
8/15usb: dwc2: Move enter hibernation to dwc2_port_suspend() functiondrivers/usb/dwc2/hcd.c+14 -41 reply
9/15usb: dwc2: Move exit hibernation to dwc2_port_resume() functiondrivers/usb/dwc2/hcd.c+7 -60 replies
9/15usb: dwc2: Move exit hibernation to dwc2_port_resume() functiondrivers/usb/dwc2/hcd.c+7 -61 reply
10/15usb: dwc2: Allow exit hibernation in urb enqueuedrivers/usb/dwc2/hcd.c+17 -03 replies
10/15usb: dwc2: Allow exit hibernation in urb enqueuedrivers/usb/dwc2/hcd.c+14 -01 reply
11/15usb: dwc2: Add hibernation entering flow by system suspenddrivers/usb/dwc2/hcd.c+10 -00 replies
11/15usb: dwc2: Add hibernation entering flow by system suspenddrivers/usb/dwc2/hcd.c+10 -01 reply
12/15usb: dwc2: Add hibernation exiting flow by system resumedrivers/usb/dwc2/hcd.c+10 -00 replies
12/15usb: dwc2: Add hibernation exiting flow by system resumedrivers/usb/dwc2/hcd.c+10 -01 reply
13/15usb: dwc2: Add exit hibernation mode before removing drivedrivers/usb/dwc2/platform.c+16 -03 replies
13/15usb: dwc2: Add exit hibernation mode before removing drivedrivers/usb/dwc2/platform.c+15 -01 reply
14/15usb: dwc2: Update dwc2_handle_usb_suspend_intr function.drivers/usb/dwc2/core_intr.c+7 -50 replies
14/15usb: dwc2: Update dwc2_handle_usb_suspend_intr function.drivers/usb/dwc2/core_intr.c+7 -50 replies
15/15usb: dwc2: Get rid of useless error checks in suspend interruptdrivers/usb/dwc2/core.c drivers/usb/dwc2/core_intr.c+7 -140 replies
15/15usb: dwc2: Get rid of useless error checks in suspend interruptdrivers/usb/dwc2/core.c drivers/usb/dwc2/core_intr.c+7 -141 reply

Reviews trailers per patch

All 30 patches have a Reviewed-by or Acked-by.

PatchMinas Harutyunyan
1/15A-b
1/15A-b
2/15A-b A-b
2/15A-b A-b
3/15A-b
3/15A-b
4/15A-b A-b
4/15A-b A-b
5/15A-b A-b
5/15A-b A-b
6/15A-b A-b
6/15A-b A-b
7/15A-b A-b
7/15A-b A-b
8/15A-b
8/15A-b
9/15A-b
9/15A-b
10/15A-b
10/15A-b
11/15A-b
11/15A-b
12/15A-b
12/15A-b
13/15A-b
13/15A-b
14/15A-b A-b
14/15A-b A-b
15/15A-b
15/15A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/15] usb: dwc2: Fix Hibernation issues.

This patch set fixes and improves hibernation mode for dwc2 core. It adds support for the following cases
1. Hibernation entering/exiting flow by system suspend/resume.
2. Exiting hibernation mode before removing driver and urb enqueue.
3. Exiting hibernation from gpwrdn rst detect.

It updates the implementation of dwc2 entering and exiting hibernation mode when a port is suspended or resumed or reset asserted.

It fixes hibernation issues between host and device mode when core enters to hibernation in host mode and mode change happens. Also, a fix is introduced for remote wakeup flow.

The patch set also improves implementation of entering to hibernation from dwc2_handle_usb_suspend_intr() handler.

Changes since V1:
Updated bellow patches. Moved duplicated error checking *if* conditions from innermost to outside if.
1. usb: dwc2: Add exit hibernation mode before removing drive
2. usb: dwc2: Allow exit hibernation in urb enqueue

Fixed an uninitialized pointer variable which was reported by kernel test robot in "usb: dwc2: Add exit hibernation mode before removing drive" patch. After fixing added Reported-by tags for kernel test robot and Dan Carpenter.

Also removed some text from cover letter because I think that is why vger.kernel.org was rejecting it.

Artur Petrosyan (15):
usb: dwc2: Update exit hibernation when port reset is asserted
usb: dwc2: Reset DEVADDR after exiting gadget hibernation.
usb: dwc2: Fix host mode hibernation exit with remote wakeup flow.
usb: dwc2: Fix hibernation between host and device modes.
usb: dwc2: Allow exiting hibernation from gpwrdn rst detect
usb: dwc2: Clear fifo_map when resetting core.
usb: dwc2: Clear GINTSTS_RESTOREDONE bit after restore is generated.
usb: dwc2: Move enter hibernation to dwc2_port_suspend() function
usb: dwc2: Move exit hibernation to dwc2_port_resume() function
usb: dwc2: Allow exit hibernation in urb enqueue
usb: dwc2: Add hibernation entering flow by system suspend
usb: dwc2: Add hibernation exiting flow by system resume
usb: dwc2: Add exit hibernation mode before removing drive
usb: dwc2: Update dwc2_handle_usb_suspend_intr function.
usb: dwc2: Get rid of useless error checks in suspend interrupt

 drivers/usb/dwc2/core.c      |  25 ++++-
 drivers/usb/dwc2/core.h      |   3 +
 drivers/usb/dwc2/core_intr.c | 205 +++++++++++++++++++----------------
 drivers/usb/dwc2/gadget.c    |   4 +
 drivers/usb/dwc2/hcd.c       |  92 +++++++++++++---
 drivers/usb/dwc2/platform.c  |  15 +++
 6 files changed, 233 insertions(+), 111 deletions(-)

base-commit: 4b853c236c7b5161a2e444bd8b3c76fe5aa5ddcb

Signature · 1 line
2.25.1