Browse Source

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
Abhinav Kumar 6 years ago
parent
commit
9b4f4ba969
2 changed files with 9 additions and 47 deletions
  1. 0 1
      core/sme/inc/sme_rrm_internal.h
  2. 9 46
      core/sme/src/rrm/sme_rrm.c

+ 0 - 1
core/sme/inc/sme_rrm_internal.h

@@ -85,7 +85,6 @@ typedef struct sRrmSMEContext {
 #endif /* FEATURE_WLAN_ESE */
 #endif /* FEATURE_WLAN_ESE */
 	tRrmMsgReqSource msgSource;
 	tRrmMsgReqSource msgSource;
 	wlan_scan_requester req_id;
 	wlan_scan_requester req_id;
-	qdf_wake_lock_t scan_wake_lock;
 } tRrmSMEContext, *tpRrmSMEContext;
 } tRrmSMEContext, *tpRrmSMEContext;
 
 
 typedef struct sRrmNeighborReq {
 typedef struct sRrmNeighborReq {

+ 9 - 46
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;
 		uint32_t chan_num;
 
 
 		req = qdf_mem_malloc(sizeof(*req));
 		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(
 		vdev = wlan_objmgr_get_vdev_by_id_from_psoc(
 						mac_ctx->psoc,
 						mac_ctx->psoc,
@@ -764,7 +766,9 @@ static QDF_STATUS sme_rrm_issue_scan_req(tpAniSirGlobal mac_ctx)
 						WLAN_LEGACY_SME_ID);
 						WLAN_LEGACY_SME_ID);
 		if (!vdev) {
 		if (!vdev) {
 			sme_err("VDEV is null %d", session_id);
 			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);
 		ucfg_scan_init_default_params(vdev, req);
 		req->scan_req.dwell_time_active = 0;
 		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);
 				req->scan_req.chan_list.chan[0].freq);
 		status = ucfg_scan_start(req);
 		status = ucfg_scan_start(req);
 		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
 		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
+		if (QDF_IS_STATUS_ERROR(status))
+			goto free_ch_lst;
 
 
 		return status;
 		return status;
 	} else if (eSIR_BEACON_TABLE == scan_type) {
 	} else if (eSIR_BEACON_TABLE == scan_type) {
@@ -902,38 +908,6 @@ free_ch_lst:
 	return status;
 	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
  * sme_rrm_process_beacon_report_req_ind() -Process beacon report request
  * @pMac:- Global Mac structure
  * @pMac:- Global Mac structure
@@ -952,7 +926,6 @@ QDF_STATUS sme_rrm_process_beacon_report_req_ind(tpAniSirGlobal pMac,
 	tpSirBeaconReportReqInd pBeaconReq = (tpSirBeaconReportReqInd) pMsgBuf;
 	tpSirBeaconReportReqInd pBeaconReq = (tpSirBeaconReportReqInd) pMsgBuf;
 	tpRrmSMEContext pSmeRrmContext = &pMac->rrm.rrmSmeContext;
 	tpRrmSMEContext pSmeRrmContext = &pMac->rrm.rrmSmeContext;
 	uint32_t len = 0, i = 0;
 	uint32_t len = 0, i = 0;
-	uint32_t total_rrm_scan_time;
 
 
 	sme_debug("Received Beacon report request ind Channel = %d",
 	sme_debug("Received Beacon report request ind Channel = %d",
 		pBeaconReq->channelInfo.channelNum);
 		pBeaconReq->channelInfo.channelNum);
@@ -1049,12 +1022,6 @@ QDF_STATUS sme_rrm_process_beacon_report_req_ind(tpAniSirGlobal pMac,
 		pSmeRrmContext->token, pSmeRrmContext->regClass,
 		pSmeRrmContext->token, pSmeRrmContext->regClass,
 		pSmeRrmContext->randnIntvl, pSmeRrmContext->msgSource);
 		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);
 	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;
 	QDF_STATUS qdf_ret_status = QDF_STATUS_SUCCESS;
 
 
 	pSmeRrmContext->rrmConfig.max_randn_interval = 50;        /* ms */
 	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_status = qdf_mc_timer_init(&pSmeRrmContext->IterMeasTimer,
 				       QDF_TIMER_TYPE_SW,
 				       QDF_TIMER_TYPE_SW,
@@ -1552,8 +1517,6 @@ QDF_STATUS rrm_close(tpAniSirGlobal pMac)
 
 
 	csr_ll_close(&pSmeRrmContext->neighborReportCache);
 	csr_ll_close(&pSmeRrmContext->neighborReportCache);
 
 
-	qdf_wake_lock_destroy(&pSmeRrmContext->scan_wake_lock);
-
 	return qdf_status;
 	return qdf_status;
 
 
 }
 }