summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrinivas Girigowda <sgirigow@qca.qualcomm.com>2013-12-18 16:07:00 -0800
committerAkash Patel <c_akashp@qca.qualcomm.com>2014-03-19 13:16:44 -0700
commit359bbf64ea057e1ab2bce4535a19f0a96d8d7db3 (patch)
tree69c9016e95e26b4973e4d0c6dc0830e7d4c09393
parent361575a83b6eb4ea102c3d35b2e609c36832928c (diff)
wlan: Serialize enter/exit bmps in hdd_smeRoamCallback
hdd_smeRoamCallback gets called in the MC_Thread context and invoking wlan_hdd_enter and exit bmps function is causing a deadlock. In other words the MC_Thread will be blocked waiting for the MC_Thread to perform some work and subsequently unblock the MC_Thread The fix is to call SME function to post a command to the PMC queue (MC_Thread) and there by unblocking the caller immediately and process the command later when scheduled. Change-Id: I31f9fef2662506df2b5fb92ddbc3423b0439181e CRs-Fixed: 589921
-rw-r--r--CORE/HDD/src/wlan_hdd_assoc.c37
1 files changed, 32 insertions, 5 deletions
diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c
index 4039d7f56d1d..ff18df1d98e5 100644
--- a/CORE/HDD/src/wlan_hdd_assoc.c
+++ b/CORE/HDD/src/wlan_hdd_assoc.c
@@ -2652,6 +2652,35 @@ eHalStatus hdd_RoamTdlsStatusUpdateHandler(hdd_adapter_t *pAdapter,
}
#endif
+static void iw_full_power_cbfn (void *pContext, eHalStatus status)
+{
+ hdd_adapter_t *pAdapter = (hdd_adapter_t *)pContext;
+ hdd_context_t *pHddCtx = NULL;
+ int ret;
+
+ if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic))
+ {
+ hddLog(VOS_TRACE_LEVEL_ERROR,
+ "%s: Bad param, pAdapter [%p]",
+ __func__, pAdapter);
+ return;
+ }
+
+ pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
+ ret = wlan_hdd_validate_context(pHddCtx);
+ if (0 != ret)
+ {
+ hddLog(VOS_TRACE_LEVEL_ERROR,
+ "%s: HDD context is not valid (%d)", __func__, ret);
+ return;
+ }
+
+ if (pHddCtx->cfg_ini->fIsBmpsEnabled)
+ {
+ sme_RequestBmps(WLAN_HDD_GET_HAL_CTX(pAdapter), NULL, NULL);
+ }
+}
+
eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, tANI_U32 roamId,
eRoamCmdStatus roamStatus, eCsrRoamResult roamResult )
{
@@ -2897,11 +2926,9 @@ eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, tANI_U3
{
hddLog( LOGE, FL("Not expected: device is already in BMPS mode, Exit & Enter BMPS again!"));
- /* put the device into full power */
- wlan_hdd_enter_bmps(pAdapter, DRIVER_POWER_MODE_ACTIVE);
-
- /* put the device back into BMPS */
- wlan_hdd_enter_bmps(pAdapter, DRIVER_POWER_MODE_AUTO);
+ sme_RequestFullPower(WLAN_HDD_GET_HAL_CTX(pAdapter),
+ iw_full_power_cbfn, pAdapter,
+ eSME_FULL_PWR_NEEDED_BY_HDD);
}
}
halStatus = hdd_RoamSetKeyCompleteHandler( pAdapter, pRoamInfo, roamId, roamStatus, roamResult );