Browse Source

msm: ipa3: immediately return after rx_len is cached.

This is to avoid race condition.

Change-Id: I5d86081025508a25f669eca82c8750306e2c6fc3
Signed-off-by: Michael Adisumarta <madisuma@codeaurora.org>
Michael Adisumarta 4 years ago
parent
commit
58a1818b19
1 changed files with 7 additions and 2 deletions
  1. 7 2
      drivers/platform/msm/ipa/ipa_v3/ipa_dp.c

+ 7 - 2
drivers/platform/msm/ipa/ipa_v3/ipa_dp.c

@@ -2483,9 +2483,11 @@ fail_dma_mapping:
 fail_skb_alloc:
 	kmem_cache_free(ipa3_ctx->rx_pkt_wrapper_cache, rx_pkt);
 fail_kmem_cache_alloc:
-	if (rx_len_cached == 0)
+	if (rx_len_cached == 0) {
 		queue_delayed_work(sys->wq, &sys->replenish_rx_work,
 				msecs_to_jiffies(1));
+		return;
+	}
 done:
 	/* only ring doorbell once here */
 	ret = gsi_queue_xfer(sys->ep->gsi_chan_hdl, idx,
@@ -2590,9 +2592,12 @@ fail_dma_mapping:
 	INIT_LIST_HEAD(&rx_pkt->link);
 	spin_unlock_bh(&sys->spinlock);
 fail_kmem_cache_alloc:
-	if (rx_len_cached == 0)
+	if (rx_len_cached == 0) {
 		queue_delayed_work(sys->wq, &sys->replenish_rx_work,
 		msecs_to_jiffies(1));
+		return;
+	}
+
 done:
 	/* only ring doorbell once here */
 	ret = gsi_queue_xfer(sys->ep->gsi_chan_hdl, idx,