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

Commit 6d653272 authored by stalel's avatar stalel
Browse files

msm: rndis_ipa: change network stack notification sequence



This commit changes the order of network stack queue operations.
The network start notification is changed to occur only after
the driver internal state is updated.
Without this change the network stack will start transmitting
data before the internal state is changed which will cause
these packets to be dropped on transmit path due to incorrect
internal state.

Change-Id: I336a1c40cf8913f7f31ab26b54fb05263b544b74
Signed-off-by: default avatarTalel Shenhar <tatias@codeaurora.org>
parent cac2a5e0
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -720,25 +720,28 @@ int rndis_ipa_pipe_connect_notify(u32 usb_to_ipa_hdl,
	}
	RNDIS_IPA_DEBUG("end-points configured\n");

	netif_stop_queue(rndis_ipa_ctx->net);
	RNDIS_IPA_DEBUG("netif_stop_queue() was called");

	netif_carrier_on(rndis_ipa_ctx->net);
	if (!netif_carrier_ok(rndis_ipa_ctx->net)) {
		RNDIS_IPA_ERROR("netif_carrier_ok error\n");
		result = -EBUSY;
		goto fail;
	}
	RNDIS_IPA_DEBUG("carrier_on notified\n");
	RNDIS_IPA_DEBUG("netif_carrier_on() was called\n");

	rndis_ipa_ctx->state = next_state;
	RNDIS_IPA_STATE_DEBUG(rndis_ipa_ctx);

	if (next_state == RNDIS_IPA_CONNECTED_AND_UP) {
		netif_start_queue(rndis_ipa_ctx->net);
		RNDIS_IPA_DEBUG("queue started, NETDEV is operational\n");
		RNDIS_IPA_DEBUG("netif_start_queue() was called\n");
	}  else {
		RNDIS_IPA_DEBUG("queue shall be started after open()\n");
	}
	pr_info("RNDIS_IPA NetDev pipes were connected");

	rndis_ipa_ctx->state = next_state;
	RNDIS_IPA_STATE_DEBUG(rndis_ipa_ctx);

	RNDIS_IPA_LOG_EXIT();

fail:
@@ -773,6 +776,9 @@ static int rndis_ipa_open(struct net_device *net)
		return -EPERM;
	}

	rndis_ipa_ctx->state = next_state;
	RNDIS_IPA_STATE_DEBUG(rndis_ipa_ctx);

	if (next_state == RNDIS_IPA_CONNECTED_AND_UP) {
		netif_start_queue(net);
		RNDIS_IPA_DEBUG("queue started\n");
@@ -780,9 +786,6 @@ static int rndis_ipa_open(struct net_device *net)
		RNDIS_IPA_DEBUG("queue shall be started after connect()\n");
	}

	rndis_ipa_ctx->state = next_state;
	RNDIS_IPA_STATE_DEBUG(rndis_ipa_ctx);

	pr_info("RNDIS_IPA NetDev was opened");

	RNDIS_IPA_LOG_EXIT();