From 9b4f4ba9691db5b2260eeec7d4ea48994ac3eec8 Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Thu, 15 Nov 2018 14:39:12 +0530 Subject: [PATCH] Revert "qcacld-3.0: Acquire wake lock timeout for rrm scan" FW does not assert when wow is enabled in presence of active scans. Only requirement is to abort the scans while suspending. So holding wakelock till scan is complete may introduce power side effects. Aborting the scan while suspending is already taken care by the CR-2343385. Fix is to revert the Change Id: I02ddc9b5e6ba5f1782d00e34f044ace34c54d0b0 and cleanup the channel list from rrm context in case of failure of rrm scan req. Change-Id: I844210a6a11f1d882bf42340b80b386856d9b87b CRs-Fixed: 2349857 --- core/sme/inc/sme_rrm_internal.h | 1 - core/sme/src/rrm/sme_rrm.c | 55 ++++++--------------------------- 2 files changed, 9 insertions(+), 47 deletions(-) diff --git a/core/sme/inc/sme_rrm_internal.h b/core/sme/inc/sme_rrm_internal.h index 90528bdc02b2..c590b4d7e4d7 100644 --- a/core/sme/inc/sme_rrm_internal.h +++ b/core/sme/inc/sme_rrm_internal.h @@ -85,7 +85,6 @@ typedef struct sRrmSMEContext { #endif /* FEATURE_WLAN_ESE */ tRrmMsgReqSource msgSource; wlan_scan_requester req_id; - qdf_wake_lock_t scan_wake_lock; } tRrmSMEContext, *tpRrmSMEContext; typedef struct sRrmNeighborReq { diff --git a/core/sme/src/rrm/sme_rrm.c b/core/sme/src/rrm/sme_rrm.c index f64439b1c384..f8fa1b096608 100644 --- a/core/sme/src/rrm/sme_rrm.c +++ b/core/sme/src/rrm/sme_rrm.c @@ -755,8 +755,10 @@ static QDF_STATUS sme_rrm_issue_scan_req(tpAniSirGlobal mac_ctx) uint32_t chan_num; req = qdf_mem_malloc(sizeof(*req)); - if (!req) - return QDF_STATUS_E_NOMEM; + if (!req) { + status = QDF_STATUS_E_NOMEM; + goto free_ch_lst; + } vdev = wlan_objmgr_get_vdev_by_id_from_psoc( mac_ctx->psoc, @@ -764,7 +766,9 @@ static QDF_STATUS sme_rrm_issue_scan_req(tpAniSirGlobal mac_ctx) WLAN_LEGACY_SME_ID); if (!vdev) { sme_err("VDEV is null %d", session_id); - return QDF_STATUS_E_INVAL; + status = QDF_STATUS_E_INVAL; + qdf_mem_free(req); + goto free_ch_lst; } ucfg_scan_init_default_params(vdev, req); req->scan_req.dwell_time_active = 0; @@ -852,6 +856,8 @@ static QDF_STATUS sme_rrm_issue_scan_req(tpAniSirGlobal mac_ctx) req->scan_req.chan_list.chan[0].freq); status = ucfg_scan_start(req); wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID); + if (QDF_IS_STATUS_ERROR(status)) + goto free_ch_lst; return status; } else if (eSIR_BEACON_TABLE == scan_type) { @@ -902,38 +908,6 @@ free_ch_lst: return status; } -/** - * sme_rrm_calculate_total_scan_time() - calculate total time req for - * scan for all channels - * @mac_ctx: The handle returned by mac_open. - * - * Return: total rrm scan time - */ -static uint32_t sme_rrm_calculate_total_scan_time(tpAniSirGlobal mac_ctx) -{ - uint32_t dwell_time_active; - uint16_t interval; - tpRrmSMEContext pSmeRrmContext = &mac_ctx->rrm.rrmSmeContext; - uint8_t num_channels; - uint32_t rrm_scan_time = 0; - - num_channels = pSmeRrmContext->channelList.numOfChannels; - - interval = pSmeRrmContext->randnIntvl + 10; - - dwell_time_active = pSmeRrmContext->duration[0]; - - /* - * Add 1 sec extra in actual total rrm scan time - * to accommodate any delay - */ - if (num_channels) - rrm_scan_time = ((num_channels * dwell_time_active) + - ((num_channels - 1) * interval) + 1000); - - return rrm_scan_time; -} - /** * sme_rrm_process_beacon_report_req_ind() -Process beacon report request * @pMac:- Global Mac structure @@ -952,7 +926,6 @@ QDF_STATUS sme_rrm_process_beacon_report_req_ind(tpAniSirGlobal pMac, tpSirBeaconReportReqInd pBeaconReq = (tpSirBeaconReportReqInd) pMsgBuf; tpRrmSMEContext pSmeRrmContext = &pMac->rrm.rrmSmeContext; uint32_t len = 0, i = 0; - uint32_t total_rrm_scan_time; sme_debug("Received Beacon report request ind Channel = %d", pBeaconReq->channelInfo.channelNum); @@ -1049,12 +1022,6 @@ QDF_STATUS sme_rrm_process_beacon_report_req_ind(tpAniSirGlobal pMac, pSmeRrmContext->token, pSmeRrmContext->regClass, pSmeRrmContext->randnIntvl, pSmeRrmContext->msgSource); - total_rrm_scan_time = sme_rrm_calculate_total_scan_time(pMac); - - if (total_rrm_scan_time) - qdf_wake_lock_timeout_acquire(&pSmeRrmContext->scan_wake_lock, - total_rrm_scan_time); - return sme_rrm_issue_scan_req(pMac); } @@ -1457,8 +1424,6 @@ QDF_STATUS rrm_open(tpAniSirGlobal pMac) QDF_STATUS qdf_ret_status = QDF_STATUS_SUCCESS; pSmeRrmContext->rrmConfig.max_randn_interval = 50; /* ms */ - qdf_wake_lock_create(&pSmeRrmContext->scan_wake_lock, - "wlan_rrm_scan_wl"); qdf_status = qdf_mc_timer_init(&pSmeRrmContext->IterMeasTimer, QDF_TIMER_TYPE_SW, @@ -1552,8 +1517,6 @@ QDF_STATUS rrm_close(tpAniSirGlobal pMac) csr_ll_close(&pSmeRrmContext->neighborReportCache); - qdf_wake_lock_destroy(&pSmeRrmContext->scan_wake_lock); - return qdf_status; }