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

Commit cb2579bc authored by Ravinder Konka's avatar Ravinder Konka
Browse files

msm: ipa: adjust the RX replenish threshold for APPS_LAN_CONS pipe



Replenish threshold of APPS_LAN_CONS pipe will not be updated as
IPA WM values are updated only after Uc is loaded. Make changes to
update the relenish threshold after WM values are updated.

Change-Id: I2d4324c906f3cb6df5e59042e0922cf7fdef9813
Acked-by: default avatarChaitanya Pratapa <cpratapa@qti.qualcomm.com>
Acked-by: default avatarDavid Arinzon <darinzon@qti.qualcomm.com>
Signed-off-by: default avatarRavinder Konka <rkonka@codeaurora.org>
Signed-off-by: default avatarSivan Reinstein <sivanr@codeaurora.org>
parent 45f1dede
Loading
Loading
Loading
Loading
+36 −0
Original line number Diff line number Diff line
@@ -899,6 +899,36 @@ static void switch_to_intr_rx_work_func(struct work_struct *work)
	ipa_handle_rx(sys);
}

/**
 * ipa_update_repl_threshold()- Update the repl_threshold for the client.
 *
 * Return value: None.
 */
void ipa_update_repl_threshold(enum ipa_client_type ipa_client)
{
	int ep_idx;
	struct ipa_ep_context *ep;

	/* Check if ep is valid. */
	ep_idx = ipa2_get_ep_mapping(ipa_client);
	if (ep_idx == -1) {
		IPADBG("Invalid IPA client\n");
		return;
	}

	ep = &ipa_ctx->ep[ep_idx];
	if (!ep->valid) {
		IPADBG("EP not valid/Not applicable for client.\n");
		return;
	}
	/*
	 * Determine how many buffers/descriptors remaining will
	 * cause to drop below the yellow WM bar.
	 */
	ep->rx_replenish_threshold = ipa_get_sys_yellow_wm()
					/ ep->sys->rx_buff_sz;
}

/**
 * ipa2_setup_sys_pipe() - Setup an IPA end-point in system-BAM mode and perform
 * IPA EP configuration
@@ -1081,6 +1111,12 @@ int ipa2_setup_sys_pipe(struct ipa_sys_connect_params *sys_in, u32 *clnt_hdl)
		 */
		ep->rx_replenish_threshold = ipa_get_sys_yellow_wm()
						/ ep->sys->rx_buff_sz;
		/* Only when the WAN pipes are setup, actual threshold will
		 * be read from the register. So update LAN_CONS ep again with
		 * right value.
		 */
		if (sys_in->client == IPA_CLIENT_APPS_WAN_CONS)
			ipa_update_repl_threshold(IPA_CLIENT_APPS_LAN_CONS);
	} else {
		ep->connect.mode = SPS_MODE_DEST;
		ep->connect.source = SPS_DEV_HANDLE_MEM;
+1 −3
Original line number Diff line number Diff line
@@ -1939,7 +1939,5 @@ struct device *ipa2_get_dma_dev(void);
int ipa2_release_wdi_mapping(u32 num_buffers, struct ipa_wdi_buffer_info *info);
int ipa2_create_wdi_mapping(u32 num_buffers, struct ipa_wdi_buffer_info *info);
void ipa_suspend_apps_pipes(bool suspend);



void ipa_update_repl_threshold(enum ipa_client_type ipa_client);
#endif /* _IPA_I_H_ */