usb: dwc3: gadget: fix the txfifo resize for isoc ep

The dwc3 driver sets the mult to 6 and alloc 0x307 * 8 Bytes
for each isoc ep txfifo. It aims to improve isoc ep throughput,
but it's wasteful.

This patch sets the mult to dep->endpoint.mult * 2 for each isoc
ep, it's enough to improve isoc ep throughput, and it can avoid
exceeding the total size of txfifo if multiple isoc eps are used
at the same time.

Change-Id: I01d77d19b85e5f5930ff94ef40714129afe10b54
Signed-off-by: William Wu <william.wu@rock-chips.com>
This commit is contained in:
William Wu
2020-07-14 18:38:19 +08:00
parent 50151fc7a3
commit 5d4fc6626d

View File

@@ -185,10 +185,14 @@ static int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc)
if (!(dep->flags & DWC3_EP_ENABLED))
continue;
if (usb_endpoint_xfer_bulk(dep->endpoint.desc))
if (usb_endpoint_xfer_bulk(dep->endpoint.desc)) {
mult = 3;
else if (usb_endpoint_xfer_isoc(dep->endpoint.desc))
mult = 6;
} else if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) {
if (dep->endpoint.mult > 0)
mult = dep->endpoint.mult * 2;
else
mult = 3;
}
/*
* REVISIT: the following assumes we will always have enough