diff options
author | Mayank Rana <mrana@codeaurora.org> | 2016-06-14 16:45:24 -0700 |
---|---|---|
committer | Kyle Yan <kyan@codeaurora.org> | 2016-06-21 15:15:25 -0700 |
commit | 15fb7f86a0ee51b05ccc9542e7d0e8b7a72f0f03 (patch) | |
tree | 647a259de14138da91955a9008ed711c71583aa9 /drivers/usb/dwc3/gadget.c | |
parent | bf40e26c898ddb9b868c9f9b024adf18014bd464 (diff) |
usb: gadget: Use mult as 3 for GSI related USB IN endpoint always
Interfaces like MBIM or ECM is having multiple data interfaces.
In this case, SET_CONFIG() happens before set_alt with data interface 1.
Due to this, TXFIFO of GSI IN endpoint is not resized causing low
throughput in DL direction. Fix this issue by using mult as 3 for
GSI related USB IN endpoint irrespective of super-speed or high-speed
mode.
CRs-Fixed: 1025031
Change-Id: I10de98ae57284699af3abcd90bafac63ba03844e
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 506a1a500f63..76d39a6fb68c 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -203,9 +203,21 @@ int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc) int mult = 1; int tmp; + tmp = max_packet + mdwidth; + /* + * Interfaces like MBIM or ECM is having multiple data + * interfaces. SET_CONFIG() happens before set_alt with + * data interface 1 which results into calling this API + * before GSI endpoint enabled. This results no txfifo + * resize with GSI endpoint causing low throughput. Hence + * use mult as 3 for GSI IN endpoint always irrespective + * USB speed. + */ + if (dep->endpoint.ep_type == EP_TYPE_GSI) + mult = 3; + if (!(dep->flags & DWC3_EP_ENABLED)) { dev_dbg(dwc->dev, "ep%dIn not enabled", num); - tmp = max_packet + mdwidth; goto resize_fifo; } @@ -214,8 +226,8 @@ int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc) || usb_endpoint_xfer_isoc(dep->endpoint.desc)) mult = 3; - tmp = mult * (max_packet + mdwidth); resize_fifo: + tmp *= mult; tmp += mdwidth; fifo_size = DIV_ROUND_UP(tmp, mdwidth); |