Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cefab302 authored by Mayank Rana's avatar Mayank Rana
Browse files

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: default avatarMayank Rana <mrana@codeaurora.org>
parent 520de144
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -226,9 +226,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;
		}

@@ -237,8 +249,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);