All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Fix controller halt and endxfer timeout issues
@ 2022-07-13  0:35 Wesley Cheng
  2022-07-13  0:35 ` [PATCH v2 1/5] usb: dwc3: Do not service EP0 and conndone events if soft disconnected Wesley Cheng
                   ` (4 more replies)
  0 siblings, 5 replies; 23+ messages in thread
From: Wesley Cheng @ 2022-07-13  0:35 UTC (permalink / raw)
  To: balbi, gregkh
  Cc: linux-kernel, linux-usb, quic_jackp, Thinh.Nguyen, Wesley Cheng

Changes in v2:
- Moved msleep() to before reading status register for halted state
- Fixed kernel bot errors
- Clearing DEP flags in __dwc3_stop_active_transfers()
- Added Suggested-by tags and link references to previous discussions

This patch series addresses some issues seen while testing with the latest
soft disconnect implementation where EP events are allowed to process while
the controller halt is occurring.

#1
Since routines can now interweave, we can see that the soft disconnect can
occur while conndone is being serviced.  This leads to a controller halt
timeout, as the soft disconnect clears the DEP flags, for which conndone
interrupt handler will issue a __dwc3_ep_enable(ep0), that leads to
re-issuing the set ep config command for every endpoint.

#2
Function drivers can ask for a delayed_status phase, while it processes the
received SETUP packet.  This can lead to large delays when handling the
soft disconnect routine.  To improve the timing, forcefully send the status
phase, as we are going to disconnect from the host.

#3
Ensure that local interrupts are left enabled, so that EP0 events can be
processed while the soft disconnect/dequeue is happening.

#4
Modify the DWC3_EP_DELAY_STOP flag management so that if these flags were set
before soft disconnect, that the disconnect routine will be able to properly
issue the endxfer command.

#5
Since EP0 events can occur during controller halt, it may increase the time
needed for the controller to fully stop.

Wesley Cheng (5):
  usb: dwc3: Do not service EP0 and conndone events if soft disconnected
  usb: dwc3: gadget: Force sending delayed status during soft disconnect
  usb: dwc3: gadget: Adjust IRQ management during soft
    disconnect/connect
  usb: dwc3: Allow end transfer commands to be sent during soft
    disconnect
  usb: dwc3: gadget: Increase DWC3 controller halt timeout

 drivers/usb/dwc3/ep0.c    |  9 +++++----
 drivers/usb/dwc3/gadget.c | 33 +++++++++++++++++++++++----------
 2 files changed, 28 insertions(+), 14 deletions(-)


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2022-07-22 19:59 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-13  0:35 [PATCH v2 0/5] Fix controller halt and endxfer timeout issues Wesley Cheng
2022-07-13  0:35 ` [PATCH v2 1/5] usb: dwc3: Do not service EP0 and conndone events if soft disconnected Wesley Cheng
2022-07-13  0:35 ` [PATCH v2 2/5] usb: dwc3: gadget: Force sending delayed status during soft disconnect Wesley Cheng
2022-07-13  0:35 ` [PATCH v2 3/5] usb: dwc3: gadget: Adjust IRQ management during soft disconnect/connect Wesley Cheng
2022-07-14 17:38   ` Thinh Nguyen
2022-07-14 17:41     ` Wesley Cheng
2022-07-15 11:45       ` gregkh
2022-07-20 18:50     ` Wesley Cheng
2022-07-21  0:26       ` Thinh Nguyen
2022-07-13  0:35 ` [PATCH v2 4/5] usb: dwc3: Allow end transfer commands to be sent during soft disconnect Wesley Cheng
2022-07-21 22:08   ` Thinh Nguyen
2022-07-21 22:13     ` Wesley Cheng
2022-07-21 22:20       ` Thinh Nguyen
2022-07-21 22:40         ` Wesley Cheng
2022-07-22  0:00           ` Thinh Nguyen
2022-07-22  0:04             ` Wesley Cheng
2022-07-22  2:27               ` Wesley Cheng
2022-07-22 19:59                 ` Thinh Nguyen
2022-07-13  0:35 ` [PATCH v2 5/5] usb: dwc3: gadget: Increase DWC3 controller halt timeout Wesley Cheng
2022-07-13  2:56   ` Jack Pham
2022-07-13 11:40     ` John Keeping
2022-07-13 21:53       ` Jack Pham
2022-07-14  0:56         ` Thinh Nguyen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.