diff options
| author | Kiran Kumar Lokere <klokere@qca.qualcomm.com> | 2014-03-11 14:51:53 -0700 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2014-03-14 10:34:12 -0700 |
| commit | c2c4418b207eb0717cfddb3c62e63aca0f389dcd (patch) | |
| tree | c2a7f4125f263da3089e938bcbff84cdf2186055 | |
| parent | 9d84d30fefc9314dd02e01722ec1aafbd2cef102 (diff) | |
qcacld: Fix the kernel warning reported in WLAN
Since mutex locks are used in a function which is protected with
spinlocks, observed the kernel warning about sleeping function.
Instead of using the spin lock protection, serializing the
function call to MC thread will avoid the race condition between
ack timeout and tx complete confirm for dis-assoc and deauth
frames.Ack timeout function does the clean up in MC thread
and tx complete does clean up in txrx workqueue context. When
tx complete and ack timeout happens at same time then race
condition occurs. To avoid the race condition, serializing the
limSendDisassocCnf function call to MC thread context.
Change-Id: I9e74ced2c70f737500e6e7912572aca5e76c533d
CRs-Fixed: 626936
| -rw-r--r-- | CORE/MAC/inc/aniGlobal.h | 3 | ||||
| -rw-r--r-- | CORE/MAC/src/include/sirParams.h | 3 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limApi.c | 21 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limProcessMessageQueue.c | 8 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c | 42 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limSendManagementFrames.c | 38 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limTypes.h | 4 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 52 | ||||
| -rw-r--r-- | CORE/WDA/inc/wlan_qct_wda.h | 2 |
9 files changed, 65 insertions, 108 deletions
diff --git a/CORE/MAC/inc/aniGlobal.h b/CORE/MAC/inc/aniGlobal.h index ed7d984b0d1a..1529b7b4950a 100644 --- a/CORE/MAC/inc/aniGlobal.h +++ b/CORE/MAC/inc/aniGlobal.h @@ -261,7 +261,6 @@ typedef struct sLimTimers typedef struct { void *pMlmDisassocReq; void *pMlmDeauthReq; - vos_spin_lock_t deauthDisassocInprogress; }tLimDisassocDeauthCnfReq; typedef struct sAniSirLim @@ -657,7 +656,7 @@ typedef struct sAniSirLim // admission control policy information tLimAdmitPolicyInfo admitPolicyInfo; - vos_spin_lock_t lkPeGlobalLock; + vos_lock_t lkPeGlobalLock; tANI_U8 disableLDPCWithTxbfAP; #ifdef FEATURE_WLAN_TDLS tANI_U8 gLimTDLSBufStaEnabled; diff --git a/CORE/MAC/src/include/sirParams.h b/CORE/MAC/src/include/sirParams.h index 9d41e7047ae7..cf952d6257cd 100644 --- a/CORE/MAC/src/include/sirParams.h +++ b/CORE/MAC/src/include/sirParams.h @@ -661,6 +661,9 @@ typedef struct sSirMbMsgP2p #define SIR_HAL_MODEM_POWER_STATE_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 254) +#define SIR_HAL_DISASSOC_TX_COMP (SIR_HAL_ITC_MSG_TYPES_BEGIN + 255) +#define SIR_HAL_DEAUTH_TX_COMP (SIR_HAL_ITC_MSG_TYPES_BEGIN + 256) + #define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF) // CFG message types diff --git a/CORE/MAC/src/pe/lim/limApi.c b/CORE/MAC/src/pe/lim/limApi.c index 850f84c9aa7b..754644abbdd1 100644 --- a/CORE/MAC/src/pe/lim/limApi.c +++ b/CORE/MAC/src/pe/lim/limApi.c @@ -1027,18 +1027,11 @@ tSirRetStatus peOpen(tpAniSirGlobal pMac, tMacOpenParameters *pMacOpenParam) pMac->lim.mgmtFrameSessionId = 0xff; pMac->lim.deferredMsgCnt = 0; - if( !VOS_IS_STATUS_SUCCESS( vos_spin_lock_init( &pMac->lim.lkPeGlobalLock ) ) ) + if( !VOS_IS_STATUS_SUCCESS( vos_lock_init( &pMac->lim.lkPeGlobalLock ) ) ) { PELOGE(limLog(pMac, LOGE, FL("pe lock init failed!"));) return eSIR_FAILURE; } - - if (!VOS_IS_STATUS_SUCCESS( - vos_spin_lock_init(&pMac->lim.limDisassocDeauthCnfReq.deauthDisassocInprogress))) - { - PELOGE(limLog(pMac, LOGE, FL("deauth/disassoc process lock init failed!"));) - return eSIR_FAILURE; - } pMac->lim.deauthMsgCnt = 0; return eSIR_SUCCESS; } @@ -1081,14 +1074,8 @@ tSirRetStatus peClose(tpAniSirGlobal pMac) */ vos_mem_free(pMac->pmm.gPmmTim.pTim); pMac->pmm.gPmmTim.pTim = NULL; - if( !VOS_IS_STATUS_SUCCESS( vos_spin_lock_destroy( &pMac->lim.lkPeGlobalLock ) ) ) - { - return eSIR_FAILURE; - } - if (!VOS_IS_STATUS_SUCCESS( - vos_spin_lock_destroy(&pMac->lim.limDisassocDeauthCnfReq.deauthDisassocInprogress))) + if( !VOS_IS_STATUS_SUCCESS( vos_lock_destroy( &pMac->lim.lkPeGlobalLock ) ) ) { - PELOGE(limLog(pMac, LOGE, FL("deauth/disassoc process lock destroy failed!"));) return eSIR_FAILURE; } return eSIR_SUCCESS; @@ -2384,7 +2371,7 @@ eHalStatus pe_AcquireGlobalLock( tAniSirLim *psPe) if(psPe) { - if( VOS_IS_STATUS_SUCCESS( vos_spin_lock_acquire( &psPe->lkPeGlobalLock) ) ) + if( VOS_IS_STATUS_SUCCESS( vos_lock_acquire( &psPe->lkPeGlobalLock) ) ) { status = eHAL_STATUS_SUCCESS; } @@ -2396,7 +2383,7 @@ eHalStatus pe_ReleaseGlobalLock( tAniSirLim *psPe) eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; if(psPe) { - if( VOS_IS_STATUS_SUCCESS( vos_spin_lock_release( &psPe->lkPeGlobalLock) ) ) + if( VOS_IS_STATUS_SUCCESS( vos_lock_release( &psPe->lkPeGlobalLock) ) ) { status = eHAL_STATUS_SUCCESS; } diff --git a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c index 381534be6bc2..663490708222 100644 --- a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c +++ b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c @@ -2086,6 +2086,14 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) limMsg->bodyptr = NULL; break; + case WDA_DISASSOC_TX_COMP: + limDisassocTxCompleteCnf(pMac , limMsg->bodyval); + break; + + case WDA_DEAUTH_TX_COMP: + limDeauthTxCompleteCnf(pMac, limMsg->bodyval); + break; + case eWNI_SME_DFS_BEACON_CHAN_SW_IE_REQ: limProcessSmeReqMessages(pMac, limMsg); vos_mem_free((v_VOID_t*)limMsg->bodyptr); diff --git a/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c b/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c index b1281419aab6..04bef5d98ac1 100644 --- a/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c @@ -2923,21 +2923,7 @@ limProcessMlmDisassocReqNtf(tpAniSirGlobal pMac, eHalStatus suspendStatus, tANI_ psessionEntry, FALSE); /* Send Disassoc CNF and receive path cleanup */ - if (!VOS_IS_STATUS_SUCCESS(vos_spin_lock_acquire - (&pMac->lim.limDisassocDeauthCnfReq.deauthDisassocInprogress))) - { - PELOGE(limLog(pMac, LOGE, FL - ("deauth/disassoc process lock aquire failed!"));) - return; - } limSendDisassocCnf(pMac); - if (!VOS_IS_STATUS_SUCCESS(vos_spin_lock_release - (&pMac->lim.limDisassocDeauthCnfReq.deauthDisassocInprogress))) - { - PELOGE(limLog(pMac, LOGE, FL - ("deauth/disassoc process lock release failed!"));) - return; - } } else { @@ -3062,21 +3048,7 @@ void limCleanUpDisassocDeauthReq(tpAniSirGlobal pMac, void limProcessDisassocAckTimeout(tpAniSirGlobal pMac) { - if (!VOS_IS_STATUS_SUCCESS(vos_spin_lock_acquire - (&pMac->lim.limDisassocDeauthCnfReq.deauthDisassocInprogress))) - { - PELOGE(limLog(pMac, LOGE, FL - ("deauth/disassoc process lock aquire failed!"));) - return; - } limSendDisassocCnf(pMac); - if (!VOS_IS_STATUS_SUCCESS(vos_spin_lock_release - (&pMac->lim.limDisassocDeauthCnfReq.deauthDisassocInprogress))) - { - PELOGE(limLog(pMac, LOGE, FL - ("deauth/disassoc process lock release failed!"));) - return; - } } /** @@ -3355,21 +3327,7 @@ end: void limProcessDeauthAckTimeout(tpAniSirGlobal pMac) { - if (!VOS_IS_STATUS_SUCCESS(vos_spin_lock_acquire - (&pMac->lim.limDisassocDeauthCnfReq.deauthDisassocInprogress))) - { - PELOGE(limLog(pMac, LOGE, FL - ("deauth/disassoc process lock aquire failed!"));) - return; - } limSendDeauthCnf(pMac); - if (!VOS_IS_STATUS_SUCCESS(vos_spin_lock_release - (&pMac->lim.limDisassocDeauthCnfReq.deauthDisassocInprogress))) - { - PELOGE(limLog(pMac, LOGE, FL - ("deauth/disassoc process lock release failed!"));) - return; - } } /** diff --git a/CORE/MAC/src/pe/lim/limSendManagementFrames.c b/CORE/MAC/src/pe/lim/limSendManagementFrames.c index b9637a6b31b7..4f3e59825296 100644 --- a/CORE/MAC/src/pe/lim/limSendManagementFrames.c +++ b/CORE/MAC/src/pe/lim/limSendManagementFrames.c @@ -3853,46 +3853,12 @@ end: eHalStatus limDisassocTxCompleteCnf(tpAniSirGlobal pMac, tANI_U32 txCompleteSuccess) { - eHalStatus status = eHAL_STATUS_FAILURE; - - if (!VOS_IS_STATUS_SUCCESS(vos_spin_lock_acquire - (&pMac->lim.limDisassocDeauthCnfReq.deauthDisassocInprogress))) - { - PELOGE(limLog(pMac, LOGE, FL - ("deauth/disassoc process lock aquire failed!"));) - return status; - } - status = limSendDisassocCnf(pMac); - if (!VOS_IS_STATUS_SUCCESS(vos_spin_lock_release - (&pMac->lim.limDisassocDeauthCnfReq.deauthDisassocInprogress))) - { - PELOGE(limLog(pMac, LOGE, FL - ("deauth/disassoc process lock release failed!"));) - return eHAL_STATUS_FAILURE; - } - return status; + return limSendDisassocCnf(pMac); } eHalStatus limDeauthTxCompleteCnf(tpAniSirGlobal pMac, tANI_U32 txCompleteSuccess) { - eHalStatus status = eHAL_STATUS_FAILURE; - - if (!VOS_IS_STATUS_SUCCESS(vos_spin_lock_acquire - (&pMac->lim.limDisassocDeauthCnfReq.deauthDisassocInprogress))) - { - PELOGE(limLog(pMac, LOGE, FL - ("deauth/disassoc process lock aquire failed!"));) - return status; - } - status = limSendDeauthCnf(pMac); - if (!VOS_IS_STATUS_SUCCESS(vos_spin_lock_release - (&pMac->lim.limDisassocDeauthCnfReq.deauthDisassocInprogress))) - { - PELOGE(limLog(pMac, LOGE, FL - ("deauth/disassoc process lock release failed!"));) - return eHAL_STATUS_FAILURE; - } - return status; + return limSendDeauthCnf(pMac); } /** diff --git a/CORE/MAC/src/pe/lim/limTypes.h b/CORE/MAC/src/pe/lim/limTypes.h index 3a00a8fc5167..8b06fac3d11f 100644 --- a/CORE/MAC/src/pe/lim/limTypes.h +++ b/CORE/MAC/src/pe/lim/limTypes.h @@ -1089,6 +1089,10 @@ void limProcessDisassocAckTimeout(tpAniSirGlobal pMac); void limProcessDeauthAckTimeout(tpAniSirGlobal pMac); eHalStatus limSendDisassocCnf(tpAniSirGlobal pMac); eHalStatus limSendDeauthCnf(tpAniSirGlobal pMac); +eHalStatus limDisassocTxCompleteCnf(tpAniSirGlobal pMac, + tANI_U32 txCompleteSuccess); +eHalStatus limDeauthTxCompleteCnf(tpAniSirGlobal pMac, + tANI_U32 txCompleteSuccess); #ifdef WLAN_FEATURE_VOWIFI_11R typedef struct sSetLinkCbackParams diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 9e5e14ea05a3..3287bff46bdc 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -15602,6 +15602,29 @@ static void wma_mgmt_tx_ack_work_handler(struct work_struct *ack_work) wma_handle->ack_work_ctx = NULL; } +/* function : wma_mgmt_tx_comp_conf_ind + * Descriptin : Post mgmt tx complete indication to PE. + * Args : + wma_handle : Pointer to WMA handle + * sub_type : Tx mgmt frame sub type + * status : Mgmt frame tx status + * Returns : + */ +static void +wma_mgmt_tx_comp_conf_ind(tp_wma_handle wma_handle, u_int8_t sub_type, + int32_t status) +{ + int32_t tx_comp_status; + + tx_comp_status = status ? 0 : 1; + if(sub_type == SIR_MAC_MGMT_DISASSOC) { + wma_send_msg(wma_handle, WDA_DISASSOC_TX_COMP, NULL, tx_comp_status); + } + else if(sub_type == SIR_MAC_MGMT_DEAUTH) { + wma_send_msg(wma_handle, WDA_DEAUTH_TX_COMP, NULL, tx_comp_status); + } +} + /** * wma_mgmt_tx_ack_comp_hdlr - handles tx ack mgmt completion * @context: context with which the handler is registered @@ -15620,20 +15643,27 @@ wma_mgmt_tx_ack_comp_hdlr(void *wma_context, tp_wma_handle wma_handle = (tp_wma_handle)wma_context; if(wma_handle && wma_handle->umac_ota_ack_cb[pFc->subType]) { - struct wma_tx_ack_work_ctx *ack_work; + if((pFc->subType == SIR_MAC_MGMT_DISASSOC) || + (pFc->subType == SIR_MAC_MGMT_DEAUTH)) { + wma_mgmt_tx_comp_conf_ind(wma_handle, (u_int8_t)pFc->subType, + status); + } + else { + struct wma_tx_ack_work_ctx *ack_work; - ack_work = - adf_os_mem_alloc(NULL, sizeof(struct wma_tx_ack_work_ctx)); + ack_work = + adf_os_mem_alloc(NULL, sizeof(struct wma_tx_ack_work_ctx)); - if(ack_work) { - INIT_WORK(&ack_work->ack_cmp_work, - wma_mgmt_tx_ack_work_handler); - ack_work->wma_handle = wma_handle; - ack_work->sub_type = pFc->subType; - ack_work->status = status; + if(ack_work) { + INIT_WORK(&ack_work->ack_cmp_work, + wma_mgmt_tx_ack_work_handler); + ack_work->wma_handle = wma_handle; + ack_work->sub_type = pFc->subType; + ack_work->status = status; - /* Schedue the Work */ - schedule_work(&ack_work->ack_cmp_work); + /* Schedue the Work */ + schedule_work(&ack_work->ack_cmp_work); + } } } } diff --git a/CORE/WDA/inc/wlan_qct_wda.h b/CORE/WDA/inc/wlan_qct_wda.h index 0afa9f604495..6aa98677253e 100644 --- a/CORE/WDA/inc/wlan_qct_wda.h +++ b/CORE/WDA/inc/wlan_qct_wda.h @@ -1331,6 +1331,8 @@ tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb); */ #define WDA_DFS_BEACON_TX_SUCCESS_IND SIR_HAL_BEACON_TX_SUCCESS_IND #define WDA_FW_STATS_IND SIR_HAL_FW_STATS_IND +#define WDA_DISASSOC_TX_COMP SIR_HAL_DISASSOC_TX_COMP +#define WDA_DEAUTH_TX_COMP SIR_HAL_DEAUTH_TX_COMP #define WDA_MODEM_POWER_STATE_IND SIR_HAL_MODEM_POWER_STATE_IND |
