Browse Source

MDM:IPA3: Fixes issue with RNDIS and ECM suspend path

PM resources are released even when there are outstanding
packets leading to data stall hence resources are released
only when there are no outstanding packets.

Change-Id: I630737edfc9cadea1d8a99bdb6bb6fcbe76615d8
Signed-off-by: sivakanth vaka <[email protected]>
Sivakanth vaka 4 years ago
parent
commit
00100fbf02

+ 4 - 1
drivers/platform/msm/ipa/ipa_clients/ecm_ipa.c

@@ -628,7 +628,8 @@ static netdev_tx_t ecm_ipa_start_xmit
 
 fail_tx_packet:
 out:
-	ipa_pm_deferred_deactivate(ecm_ipa_ctx->pm_hdl);
+	if (atomic_read(&ecm_ipa_ctx->outstanding_pkts) == 0)
+		ipa_pm_deferred_deactivate(ecm_ipa_ctx->pm_hdl);
 fail_pm_activate:
 	return status;
 }
@@ -1180,6 +1181,8 @@ static void ecm_ipa_tx_complete_notify
 		netif_wake_queue(ecm_ipa_ctx->net);
 	}
 
+	if (atomic_read(&ecm_ipa_ctx->outstanding_pkts) == 0)
+		ipa_pm_deferred_deactivate(ecm_ipa_ctx->pm_hdl);
 out:
 	dev_kfree_skb_any(skb);
 }

+ 7 - 1
drivers/platform/msm/ipa/ipa_clients/rndis_ipa.c

@@ -982,8 +982,10 @@ static netdev_tx_t rndis_ipa_start_xmit(struct sk_buff *skb,
 fail_tx_packet:
 	rndis_ipa_xmit_error(skb);
 out:
-	ipa_pm_deferred_deactivate(rndis_ipa_ctx->pm_hdl);
+	if (atomic_read(&rndis_ipa_ctx->outstanding_pkts) == 0)
+		ipa_pm_deferred_deactivate(rndis_ipa_ctx->pm_hdl);
 fail_pm_activate:
+
 	RNDIS_IPA_DEBUG
 		("packet Tx done - %s\n",
 		(status == NETDEV_TX_OK) ? "OK" : "FAIL");
@@ -1055,6 +1057,10 @@ static void rndis_ipa_tx_complete_notify(
 		RNDIS_IPA_DEBUG("send queue was awaken\n");
 	}
 
+	/*Release resource only when outstanding packets are zero*/
+	if (atomic_read(&rndis_ipa_ctx->outstanding_pkts) == 0)
+		ipa_pm_deferred_deactivate(rndis_ipa_ctx->pm_hdl);
+
 out:
 	dev_kfree_skb_any(skb);
 }