From 00bdab1c2be2ea8efd5582d566c940fa170365ec Mon Sep 17 00:00:00 2001 From: Yun Park Date: Mon, 19 Oct 2015 15:28:03 -0700 Subject: qcacld: IPA uC: return EPERM for IPA RM CONS REQ only during unloading Change to return -EINPROGRESS if WLAN unable to grant IPA CONS resource due to IPA resource loading is in progress. Return -EPERM only if WLAN unable to grant IPA CONS resource due to IPA resource unloading is in progress. Change-Id: Iea4d804d3f81b086e723230fb8eddc7d9561d7d1 CRs-Fixed: 926880 --- CORE/HDD/src/wlan_hdd_ipa.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/CORE/HDD/src/wlan_hdd_ipa.c b/CORE/HDD/src/wlan_hdd_ipa.c index 1008af4c3f26..705cb23b6413 100644 --- a/CORE/HDD/src/wlan_hdd_ipa.c +++ b/CORE/HDD/src/wlan_hdd_ipa.c @@ -2240,16 +2240,24 @@ static int hdd_ipa_rm_cons_release(void) static int hdd_ipa_rm_cons_request(void) { + int ret = 0; + #ifdef IPA_UC_OFFLOAD - if ((ghdd_ipa->resource_loading) || (ghdd_ipa->resource_unloading)) { + if (ghdd_ipa->resource_loading) { HDD_IPA_LOG(VOS_TRACE_LEVEL_FATAL, - "%s: ipa resource loading/unloading in progress", + "%s: ipa resource loading in progress", __func__); ghdd_ipa->pending_cons_req = VOS_TRUE; - return -EPERM; + ret= -EINPROGRESS; + } else if (ghdd_ipa->resource_unloading) { + HDD_IPA_LOG(VOS_TRACE_LEVEL_FATAL, + "%s: ipa resource unloading in progress", + __func__); + ghdd_ipa->pending_cons_req = VOS_TRUE; + ret = -EPERM; } #endif /* IPA_UC_OFFLOAD */ - return 0; + return ret; } int hdd_ipa_set_perf_level(hdd_context_t *hdd_ctx, uint64_t tx_packets, -- cgit v1.2.3