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

Commit 84b7664d authored by Bar Weiner's avatar Bar Weiner
Browse files

usb: bam: ZLT issue workaround



IPA sends ZLT when using aggregation, and USB3.0 DBM is not able
to handle properly those ZLT for all cases.

Therefore, we need to eliminate ZLT on USB side by using max threshold
in BAM, so that the USB bam will get notifications only when EOT flag
is set in the descriptor FIFO.

Change-Id: I5866d755fa34eeaab51ad7fe5f9a8b2006bbc5fe
Signed-off-by: default avatarBar Weiner <bweiner@codeaurora.org>
parent 76ccdc74
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -275,6 +275,9 @@ Optional properties :
- qcom,ignore-core-reset-ack: If present then BAM ignores ACK from USB core
	    while performing PIPE RESET
- qcom,disable-clk-gating: If present then disable BAM clock gating.
- qcom,usb-bam-override-threshold: If present then the default 512 byte threshold
		is overriden. This threshold configures the threshold value for Read/Write
		event generation by the BAM towards another BAM.

Example USB BAM controller device node:

+3 −0
Original line number Diff line number Diff line
@@ -157,6 +157,8 @@ struct usb_bam_pipe_connect {
 *                         private memory.
 * @ignore_core_reset_ack: BAM can ignore ACK from USB core during PIPE RESET
 * @disable_clk_gating: Disable clock gating
 * @override_threshold: Override the default threshold value for Read/Write
 *                         event generation by the BAM towards another BAM.
 */
struct msm_usb_bam_platform_data {
	struct usb_bam_pipe_connect *connections;
@@ -166,6 +168,7 @@ struct msm_usb_bam_platform_data {
	bool ignore_core_reset_ack;
	bool reset_on_connect[MAX_BAMS];
	bool disable_clk_gating;
	u32 override_threshold;
};

#ifdef CONFIG_USB_BAM
+11 −2
Original line number Diff line number Diff line
@@ -2409,6 +2409,7 @@ static struct msm_usb_bam_platform_data *usb_bam_dt_to_pdata(
	bool reset_bam;
	u32 bam;
	u32 addr;
	u32 threshold;

	ctx.max_connections = 0;
	pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
@@ -2437,6 +2438,14 @@ static struct msm_usb_bam_platform_data *usb_bam_dt_to_pdata(
	pdata->disable_clk_gating = of_property_read_bool(node,
		"qcom,disable-clk-gating");

	rc = of_property_read_u32(node, "qcom,usb-bam-override-threshold",
			&threshold);
	if (rc)
		pdata->override_threshold = USB_THRESHOLD;
	else
		pdata->override_threshold = threshold;


	for_each_child_of_node(pdev->dev.of_node, node)
		ctx.max_connections++;

@@ -2612,8 +2621,8 @@ static int usb_bam_init(int bam_idx)
	props->virt_addr = usb_virt_addr;
	props->virt_size = resource_size(res);
	props->irq = irq;
	props->summing_threshold = USB_THRESHOLD;
	props->event_threshold = USB_THRESHOLD;
	props->summing_threshold = pdata->override_threshold;
	props->event_threshold = pdata->override_threshold;
	props->num_pipes = pdata->usb_bam_num_pipes;
	props->callback = usb_bam_sps_events;
	props->user = bam_enable_strings[bam_idx];