msm: ipa4: Fix to exit from tasklet after processing max packet

If TX packets processing continuously in tasklet other softIrqs
are not able to run on that core which is leading to watchdog
bark. For avoiding these scenarios exit from tasklet after
reaching max TX limit.

Change-Id: Ia5a8f20776b5cfdcb296311d72ffc48eda4970cf
Signed-off-by: Jagadeesh Ponduru <quic_jponduru@quicinc.com>
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c b/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c
index 56ddeb9..748d31d 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c
@@ -102,6 +102,8 @@
 
 #define IPA_QMAP_ID_BYTE 0
 
+#define IPA_TX_MAX_DESC (20)
+
 #define IPA_MEM_ALLOC_RETRY 5
 
 static int ipa3_tx_switch_to_intr_mode(struct ipa3_sys_context *sys);
@@ -408,6 +410,7 @@
 	struct ipa3_sys_context *sys;
 	struct ipa3_tx_pkt_wrapper *this_pkt;
 	bool xmit_done = false;
+	unsigned int max_tx_pkt = 0;
 
 	sys = (struct ipa3_sys_context *)data;
 	spin_lock_bh(&sys->spinlock);
@@ -419,9 +422,17 @@
 			spin_unlock_bh(&sys->spinlock);
 			ipa3_write_done_common(sys, this_pkt);
 			spin_lock_bh(&sys->spinlock);
+			max_tx_pkt++;
 			if (xmit_done)
 				break;
 		}
+		/* If TX packets processing continuously in tasklet other
+		 * softirqs are not able to run on that core which is leading
+		 * to watchdog bark. For avoiding these scenarios exit from
+		 * tasklet after reaching max limit.
+		 */
+		 if (max_tx_pkt == IPA_TX_MAX_DESC)
+			 break;
 	}
 	spin_unlock_bh(&sys->spinlock);
 }