From fb49ccd37f740647e56df00fbaa40175c3a0d36f Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Mon, 28 Feb 2022 14:48:24 +0530 Subject: [PATCH] qcacld-3.0: Avoid Using sme global lock in hdd calls of Connection mgr If the connection manager command is moved from pending to active queue after an SME initiated active command e.g SAP peer disconnect, it's already holding the SME lock and trying to acquire the connection manager lock. Now if in another thread, the connection manager process is already in progress and tries to get the SME lock, the driver ends up in a deadlock. Thus remove the SME global lock from the APIs called from HDD disconnect handlers. Change-Id: Ia1e9d4480935cb8954eeb02bf3d845dce4b29f8f CRs-Fixed: 3139097 --- core/sme/src/common/sme_api.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 694bc74996..e9d5cb149b 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -5502,7 +5502,7 @@ QDF_STATUS sme_set_tsf_gpio(mac_handle_t mac_handle, uint32_t pinvalue) QDF_STATUS sme_get_cfg_valid_channels(uint32_t *valid_ch_freq, uint32_t *len) { - QDF_STATUS status = QDF_STATUS_E_FAILURE; + QDF_STATUS status; struct mac_context *mac_ctx = sme_get_mac_context(); uint32_t *valid_ch_freq_list; uint32_t i; @@ -5518,12 +5518,7 @@ QDF_STATUS sme_get_cfg_valid_channels(uint32_t *valid_ch_freq, uint32_t *len) if (!valid_ch_freq_list) return QDF_STATUS_E_NOMEM; - status = sme_acquire_global_lock(&mac_ctx->sme); - if (QDF_IS_STATUS_SUCCESS(status)) { - status = csr_get_cfg_valid_channels(mac_ctx, - valid_ch_freq_list, len); - sme_release_global_lock(&mac_ctx->sme); - } + status = csr_get_cfg_valid_channels(mac_ctx, valid_ch_freq_list, len); for (i = 0; i < *len; i++) valid_ch_freq[i] = valid_ch_freq_list[i]; @@ -8278,15 +8273,12 @@ QDF_STATUS sme_get_reg_info(mac_handle_t mac_handle, uint32_t chan_freq, uint32_t *regInfo1, uint32_t *regInfo2) { struct mac_context *mac = MAC_CONTEXT(mac_handle); - QDF_STATUS status; + QDF_STATUS status = QDF_STATUS_SUCCESS; uint8_t i; bool found = false; - status = sme_acquire_global_lock(&mac->sme); *regInfo1 = 0; *regInfo2 = 0; - if (!QDF_IS_STATUS_SUCCESS(status)) - return status; for (i = 0; i < CFG_VALID_CHANNEL_LIST_LEN; i++) { if (mac->scan.defaultPowerTable[i].center_freq == chan_freq) { @@ -8302,7 +8294,6 @@ QDF_STATUS sme_get_reg_info(mac_handle_t mac_handle, uint32_t chan_freq, if (!found) status = QDF_STATUS_E_FAILURE; - sme_release_global_lock(&mac->sme); return status; }