From 56e4ab58b7d850c6fbb84c641fb69567be7e4d68 Mon Sep 17 00:00:00 2001 From: Michael Adisumarta Date: Tue, 12 Jan 2021 21:16:10 -0800 Subject: [PATCH] msm: ipa3: immediately return after rx_len is cached. This is to avoid race condition. Change-Id: I5d86081025508a25f669eca82c8750306e2c6fc3 Signed-off-by: Michael Adisumarta --- drivers/platform/msm/ipa/ipa_v3/ipa_dp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c b/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c index ba494d5ef406..0935d6cca621 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c @@ -2484,9 +2484,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, @@ -2591,9 +2593,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,