linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] usb: gadget: Add support for disabling U1 and U2 entries
@ 2019-05-08  7:54 Anurag Kumar Vulisha
  2019-05-08  7:54 ` [PATCH v2 1/3] doc: dt: bindings: usb: dwc3: Update entries for disabling U1 and U2 Anurag Kumar Vulisha
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Anurag Kumar Vulisha @ 2019-05-08  7:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Felipe Balbi,
	Thinh Nguyen, Claus H. Stovgaard
  Cc: linux-usb, devicetree, linux-kernel, v.anuragkumar, Anurag Kumar Vulisha

Gadget applications may have a requirement to disable the U1 and U2
entry based on the usecase. Below are few usecases where the disabling
U1/U2 entries may be possible.

Usecase 1:
When combining dwc3 with an redriver for a USB Type-C device solution, it
sometimes have problems with leaving U1/U2 for certain hosts, resulting in
link training errors and reconnects. For this U1/U2 state entries may be
avoided.

Usecase 2:
When performing performance benchmarking on mass storage gadget the
U1 and U2 entries can be disabled.

Usecase 3:
When periodic transfers like ISOC transfers are used with bInterval
of 1 which doesn't require the link to enter into U1 or U2 state entry
(since ping is issued from host for every uframe interval). In this
case the U1 and U2 entry can be disabled.

Disablement of U1/U2 can be done by setting U1DevExitLat and U2DevExitLat
values to 0 in the BOS descriptor. Host on seeing 0 value for U1DevExitLat
and U2DevExitLat, it doesn't send SET_SEL requests to the gadget. There
may be some hosts which may send SET_SEL requests even after seeing 0 in
the UxDevExitLat of BOS descriptor. To aviod U1/U2 entries for these type
of hosts, dwc3 controller can be programmed to reject those U1/U2 requests
by not enabling ACCEPTUxENA bits in DCTL register.

This patch series updates the same.

Changes in v2:
	1. As suggested by Thinh Nguyen changed the "snps,dis_u1_entry_quirk"
	   to "snps,dis-u1-entry-quirk"
	2. Merged the changes done by Claus H. Stovgaard in ep0.c for rejecting
	   U1/U2 requests into this patch. Changes done by Claus can be found
	   here https://marc.info/?l=linux-kernel&m=155722068820568&w=2

Anurag Kumar Vulisha (3):
  doc: dt: bindings: usb: dwc3: Update entries for disabling U1 and U2
  usb: gadget: send usb_gadget as an argument in get_config_params
  usb: dwc3: gadget: Add support for disabling U1 and U2 entries

 Documentation/devicetree/bindings/usb/dwc3.txt |  2 ++
 drivers/usb/dwc3/core.c                        |  4 ++++
 drivers/usb/dwc3/core.h                        |  4 ++++
 drivers/usb/dwc3/ep0.c                         |  9 ++++++++-
 drivers/usb/dwc3/gadget.c                      | 19 +++++++++++++++++++
 drivers/usb/dwc3/gadget.h                      |  6 ++++++
 drivers/usb/gadget/composite.c                 |  2 +-
 include/linux/usb/gadget.h                     |  3 ++-
 8 files changed, 46 insertions(+), 3 deletions(-)

-- 
2.1.1


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

end of thread, other threads:[~2019-05-14 21:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-08  7:54 [PATCH v2 0/3] usb: gadget: Add support for disabling U1 and U2 entries Anurag Kumar Vulisha
2019-05-08  7:54 ` [PATCH v2 1/3] doc: dt: bindings: usb: dwc3: Update entries for disabling U1 and U2 Anurag Kumar Vulisha
2019-05-08  7:54 ` [PATCH v2 2/3] usb: gadget: send usb_gadget as an argument in get_config_params Anurag Kumar Vulisha
2019-05-08  7:54 ` [PATCH v2 3/3] usb: dwc3: gadget: Add support for disabling U1 and U2 entries Anurag Kumar Vulisha
2019-05-08 19:33   ` Thinh Nguyen
2019-05-09  7:33     ` Anurag Kumar Vulisha
2019-05-09 23:59       ` Thinh Nguyen
2019-05-10  6:58         ` Anurag Kumar Vulisha
2019-05-11  1:48           ` Thinh Nguyen
2019-05-13 14:15             ` Anurag Kumar Vulisha
2019-05-14 21:40               ` 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).