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

Commit d87d4104 authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: Use mult as 3 for GSI related USB IN endpoint always" into msm-4.8

parents b83798c9 cefab302
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);