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

Commit 61d8040e authored by Maya Erez's avatar Maya Erez
Browse files

usb: dwc3: Do not set half-full elastic buffer



On some platforms setting of half-full elastic buffer will cause data
corruption and hence we need to avoid this setting.
Disable the usage of the default setting of half-full elastic buffer
towards SolvNet Case 8000626044.

Change-Id: I113c6e0602e057496d5e84fc2f6a3f59d12efc98
Signed-off-by: default avatarMaya Erez <merez@codeaurora.org>
parent be057e1d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@ Required properties:
Optional properties:
 - tx-fifo-resize: determines if the FIFO *has* to be reallocated.
 - host-only-mode: if present then dwc3 should be run in HOST only mode.
 - nominal-elastic-buffer: When set, the nominal elastic buffer setting
	is used. By default, the half-full setting is used.

This is usually a subnode to DWC3 glue to which it is connected.

+8 −3
Original line number Diff line number Diff line
@@ -442,9 +442,11 @@ static int dwc3_core_init(struct dwc3 *dwc)
	 * it results in high link errors and could cause SS mode transfer
	 * failure.
	 */
	if (!dwc->nominal_elastic_buffer) {
		reg = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0));
		reg &= ~DWC3_GUSB3PIPECTL_ELASTIC_BUF_MODE;
		dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg);
	}

	return 0;

@@ -626,6 +628,9 @@ static int dwc3_probe(struct platform_device *pdev)
		}
	}

	dwc->nominal_elastic_buffer = of_property_read_bool(node,
			"nominal-elastic-buffer");

	ret = dwc3_core_init(dwc);
	if (ret) {
		dev_err(dev, "failed to initialize core\n");
+2 −0
Original line number Diff line number Diff line
@@ -823,6 +823,8 @@ struct dwc3 {
	void (*notify_event) (struct dwc3 *, unsigned);
	int			tx_fifo_size;
	bool			tx_fifo_reduced;

	bool			nominal_elastic_buffer;
};

/* -------------------------------------------------------------------------- */