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

Commit ba0235ef authored by Sridhar Ancha's avatar Sridhar Ancha Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa: Fix to polling mode



When IPA clock is enabled, suspend bit is cleared
and if pipe is non-empty EOT is posted internally.
At the same time, there is a possibility that SPS
driver posts EOT. This can result into incorrect
state of polling state and switch to intr mode is
tried repeatedly. Make a change to check if we are
in intr mode already in addition to the polling state.

Change-Id: I1af08605f7d2d234b0e5a4e3c8928db6cff5c7b4
Acked-by: default avatarChaitanya Pratapa <cpratapa@qti.qualcomm.com>
Signed-off-by: default avatarSridhar Ancha <sancha@codeaurora.org>
parent fbfdd7c9
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -820,16 +820,23 @@ static void ipa_rx_switch_to_intr_mode(struct ipa_sys_context *sys)
		return;
	}

	if (!atomic_read(&sys->curr_polling_state)) {
		IPAERR("already in intr mode\n");
		goto fail;
	}

	ret = sps_get_config(sys->ep->ep_hdl, &sys->ep->connect);
	if (ret) {
		IPAERR("sps_get_config() failed %d\n", ret);
		goto fail;
	}

	if (!atomic_read(&sys->curr_polling_state) &&
		((sys->ep->connect.options & SPS_O_EOT) == SPS_O_EOT)) {
		IPADBG("already in intr mode\n");
		return;
	}

	if (!atomic_read(&sys->curr_polling_state)) {
		IPAERR("already in intr mode\n");
		goto fail;
	}

	sys->event.options = SPS_O_EOT;
	ret = sps_register_event(sys->ep->ep_hdl, &sys->event);
	if (ret) {
+13 −5
Original line number Diff line number Diff line
@@ -861,12 +861,11 @@ static void ipa3_rx_switch_to_intr_mode(struct ipa3_sys_context *sys)
{
	int ret;

	if (ipa3_ctx->transport_prototype == IPA_TRANSPORT_TYPE_GSI) {
		if (!atomic_read(&sys->curr_polling_state)) {
			IPAERR("already in intr mode\n");
			goto fail;
		}

	if (ipa3_ctx->transport_prototype == IPA_TRANSPORT_TYPE_GSI) {
		atomic_set(&sys->curr_polling_state, 0);
		ipa3_dec_release_wakelock();
		ret = gsi_config_channel_mode(sys->ep->gsi_chan_hdl,
@@ -881,6 +880,15 @@ static void ipa3_rx_switch_to_intr_mode(struct ipa3_sys_context *sys)
			IPAERR("sps_get_config() failed %d\n", ret);
			goto fail;
		}
		if (!atomic_read(&sys->curr_polling_state) &&
			((sys->ep->connect.options & SPS_O_EOT) == SPS_O_EOT)) {
			IPADBG("already in intr mode\n");
			return;
		}
		if (!atomic_read(&sys->curr_polling_state)) {
			IPAERR("already in intr mode\n");
			goto fail;
		}
		sys->event.options = SPS_O_EOT;
		ret = sps_register_event(sys->ep->ep_hdl, &sys->event);
		if (ret) {