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

Commit 0e6db624 authored by Talel Shenhar's avatar Talel Shenhar
Browse files

msm: ecm_ipa: clear outstanding packets upon pipe disconnect



This change clears the outstanding packets upon disconnect.
It is needed because after pipe disconnect no WRITE-DONE
events shall be sent from IPA driver so the netdev will
wait for packets that will never be acked.

Change-Id: Ic37afb10d371f4b1f9b2ad40b19f0e5992dafe86
Signed-off-by: default avatarTalel Shenhar <tatias@codeaurora.org>
parent f5b382b8
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -652,6 +652,7 @@ int ecm_ipa_disconnect(void *priv)
	struct ipa_ecm_msg *ecm_msg;
	struct ipa_msg_meta msg_meta;
	int retval;
	int outstanding_dropped_pkts;

	ECM_IPA_LOG_ENTRY();
	NULL_CHECK(ecm_ipa_ctx);
@@ -691,6 +692,11 @@ int ecm_ipa_disconnect(void *priv)
	netif_stop_queue(ecm_ipa_ctx->net);
	ECM_IPA_DEBUG("queue stopped\n");

	outstanding_dropped_pkts =
		atomic_read(&ecm_ipa_ctx->outstanding_pkts);
	ecm_ipa_ctx->net->stats.tx_errors += outstanding_dropped_pkts;
	atomic_set(&ecm_ipa_ctx->outstanding_pkts, 0);

	ECM_IPA_LOG_EXIT();

	return 0;
@@ -1065,6 +1071,13 @@ static void ecm_ipa_tx_complete_notify(void *priv,
		ECM_IPA_ERROR("unsupported event on Tx callback\n");
		return;
	}

	if (unlikely(ecm_ipa_ctx->state != ECM_IPA_CONNECTED_AND_UP)) {
		ECM_IPA_DEBUG("dropping Tx-complete pkt, state=%s",
			ecm_ipa_state_string(ecm_ipa_ctx->state));
		goto out;
	}

	atomic_dec(&ecm_ipa_ctx->outstanding_pkts);
	if (netif_queue_stopped(ecm_ipa_ctx->net) &&
		atomic_read(&ecm_ipa_ctx->outstanding_pkts) <
@@ -1074,6 +1087,7 @@ static void ecm_ipa_tx_complete_notify(void *priv,
		netif_wake_queue(ecm_ipa_ctx->net);
	}

out:
	dev_kfree_skb_any(skb);
	return;
}