From cc43b53e87ddab41631c812e501a33e9003ab833 Mon Sep 17 00:00:00 2001 From: jiad Date: Thu, 4 Apr 2019 11:11:19 +0800 Subject: [PATCH] qcacmn: Allocate IPA TX skb buffers with srng unlocked On low memory system, skb allocation failures are observed in dp_tx_ipa_uc_attach during driver loading phase. Per kernel memory team analysis, failures are caused by large amount of atomic allocations. Currently when allocating IPA TX skbs, srng spinlock is first grabbed and then skb buffers are being requested, which makes skb allocation happen in atomic context. Fix is to make skb allocations with srng unlocked since it is safe for race conditions during driver loading time. This ensures skb allocations in process context. Change-Id: I1624276c087c8247d672fb7cea5daded07ab93a3 CRs-Fixed: 2426489 --- dp/wifi3.0/dp_ipa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dp/wifi3.0/dp_ipa.c b/dp/wifi3.0/dp_ipa.c index 73cfe998f2..6435eaa7bf 100644 --- a/dp/wifi3.0/dp_ipa.c +++ b/dp/wifi3.0/dp_ipa.c @@ -234,7 +234,7 @@ static int dp_tx_ipa_uc_attach(struct dp_soc *soc, struct dp_pdev *pdev) return -ENOMEM; } - hal_srng_access_start(soc->hal_soc, (void *)wbm_srng); + hal_srng_access_start_unlocked(soc->hal_soc, (void *)wbm_srng); /* * Allocate Tx buffers as many as possible @@ -276,7 +276,7 @@ static int dp_tx_ipa_uc_attach(struct dp_soc *soc, struct dp_pdev *pdev) __dp_ipa_handle_buf_smmu_mapping(soc, nbuf, true); } - hal_srng_access_end(soc->hal_soc, wbm_srng); + hal_srng_access_end_unlocked(soc->hal_soc, wbm_srng); soc->ipa_uc_tx_rsc.alloc_tx_buf_cnt = tx_buffer_count;