From 874f714a03d88ba6a55c8308dcc691e0badbedd2 Mon Sep 17 00:00:00 2001 From: Yeshwanth Sriram Guntuka Date: Wed, 10 Jun 2020 12:43:41 +0530 Subject: [PATCH] qcacmn: Schedule oom_allocation work for SRNG based CE On nbuf allocation failure in hif_post_recv_buffers_for_pipe for the last buffer in the CE destination ring, oom_allocation work is not getting scheduled since there is a mismatch between the recv_buffers_needed and the num_entries - 1 of the destination ring. Fix is to schedule the oom_allocation work for srng based CE with appropriate check of recv_buffers_needed and destination ring num_entries. Change-Id: Ie20d5b21358a401e60776db8a3a8a8644279f1fe CRs-Fixed: 2705475 --- hif/src/ce/ce_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hif/src/ce/ce_main.c b/hif/src/ce/ce_main.c index d0f6fdf69ff8..3be4655b8287 100644 --- a/hif/src/ce/ce_main.c +++ b/hif/src/ce/ce_main.c @@ -2454,7 +2454,9 @@ static void hif_post_recv_buffers_failure(struct HIF_CE_pipe_info *pipe_info, * there is no trigger to refill the ce and we will * eventually crash */ - if (bufs_needed_tmp == CE_state->dest_ring->nentries - 1) + if (bufs_needed_tmp == CE_state->dest_ring->nentries - 1 || + (ce_srng_based(scn) && + bufs_needed_tmp == CE_state->dest_ring->nentries - 2)) qdf_sched_work(scn->qdf_dev, &CE_state->oom_allocation_work); }