linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] usb: dwc3: gadget: Fix halt/clear_stall handling
@ 2020-09-03  1:42 Thinh Nguyen
  2020-09-03  1:42 ` [PATCH v2 1/2] usb: dwc3: gadget: Resume pending requests after CLEAR_STALL Thinh Nguyen
  2020-09-03  1:43 ` [PATCH v2 2/2] usb: dwc3: gadget: END_TRANSFER before CLEAR_STALL command Thinh Nguyen
  0 siblings, 2 replies; 3+ messages in thread
From: Thinh Nguyen @ 2020-09-03  1:42 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, Thinh Nguyen, linux-usb
  Cc: John Youn, stable

This series fixes a couple of driver issues handling ClearFeature(halt)
request:

1) A function driver often uses set_halt() to reject a class driver protocol
command. After set_halt(), the endpoint will be stalled. It can queue new
requests while the endpoint is stalled. However, dwc3 currently drops those
requests after CLEAR_STALL. The driver should only drop started requests. Keep
the pending requests in the pending list to resume and process them after the
host issues ClearFeature(Halt) to the endpoint.

2) DWC3 should issue CLEAR_STALL command _after_ END_TRANSFER command completes.

Changes in v2:
- Rebased on 5.9-rc3
- Remove a cleanup patch so this series can be merged to 5.9-rcX
- Account for wedged endpoint
- Account for CLEAR_FEATURE on stopped endpoints with pending requests
  (END_TRANSFER command won't be issued for stopped endpoints, so just kick
  pending request right after CLEAR_STALL)


Thinh Nguyen (2):
  usb: dwc3: gadget: Resume pending requests after CLEAR_STALL
  usb: dwc3: gadget: END_TRANSFER before CLEAR_STALL command

 drivers/usb/dwc3/core.h   |  1 +
 drivers/usb/dwc3/ep0.c    | 16 +++++++++++
 drivers/usb/dwc3/gadget.c | 56 ++++++++++++++++++++++++++++++---------
 drivers/usb/dwc3/gadget.h |  1 +
 4 files changed, 61 insertions(+), 13 deletions(-)


base-commit: f75aef392f869018f78cfedf3c320a6b3fcfda6b
-- 
2.28.0


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

end of thread, other threads:[~2020-09-03  1:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-03  1:42 [PATCH v2 0/2] usb: dwc3: gadget: Fix halt/clear_stall handling Thinh Nguyen
2020-09-03  1:42 ` [PATCH v2 1/2] usb: dwc3: gadget: Resume pending requests after CLEAR_STALL Thinh Nguyen
2020-09-03  1:43 ` [PATCH v2 2/2] usb: dwc3: gadget: END_TRANSFER before CLEAR_STALL command Thinh Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).