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

Commit 88c22583 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ecm_ipa: clear outstanding packets upon pipe disconnect"

parents 7e58060e 0e6db624
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;
@@ -1078,6 +1084,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) <
@@ -1087,6 +1100,7 @@ static void ecm_ipa_tx_complete_notify(void *priv,
		netif_wake_queue(ecm_ipa_ctx->net);
	}

out:
	dev_kfree_skb_any(skb);
	return;
}