Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 234d3528 authored by Prashanth Bhatta's avatar Prashanth Bhatta Committed by Akash Patel
Browse files

qcacld-3.0: Use CDF APIs for spin lock

sched_scan_lock and connection_status_lock's are using spin lock
APIs directly from kernel. Change to use CDF APIs for spin lock.

Change-Id: I0f56624df34682150b402fc36b9dfdba36a598f3
CRs-fixed: 959287
parent 11667807
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2026,7 +2026,7 @@ bool cds_set_connection_in_progress(bool value)
		return false;
	}

	spin_lock(&hdd_ctx->connection_status_lock);
	cdf_spin_lock(&hdd_ctx->connection_status_lock);
	/*
	 * if the value is set to true previously and if someone is
	 * trying to make it true again then it could be some race
@@ -2037,7 +2037,7 @@ bool cds_set_connection_in_progress(bool value)
		status = false;
	else
		hdd_ctx->connection_in_progress = value;
	spin_unlock(&hdd_ctx->connection_status_lock);
	cdf_spin_unlock(&hdd_ctx->connection_status_lock);
	return status;
}

+2 −2
Original line number Diff line number Diff line
@@ -1208,7 +1208,7 @@ struct hdd_context_s {
	/* Use below lock to protect access to isSchedScanUpdatePending
	 * since it will be accessed in two different contexts.
	 */
	spinlock_t schedScan_lock;
	cdf_spinlock_t sched_scan_lock;

	/* Flag keeps track of wiphy suspend/resume */
	bool isWiphySuspended;
@@ -1325,7 +1325,7 @@ struct hdd_context_s {

	cdf_mc_timer_t dbs_opportunistic_timer;
	bool connection_in_progress;
	spinlock_t connection_status_lock;
	cdf_spinlock_t connection_status_lock;
	cdf_mutex_t hdd_conc_list_lock;

	uint16_t hdd_txrx_hist_idx;
+2 −2
Original line number Diff line number Diff line
@@ -4890,8 +4890,8 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc)
	init_completion(&hdd_ctx->mc_sus_event_var);
	init_completion(&hdd_ctx->ready_to_suspend);

	spin_lock_init(&hdd_ctx->schedScan_lock);
	spin_lock_init(&hdd_ctx->connection_status_lock);
	cdf_spinlock_init(&hdd_ctx->sched_scan_lock);
	cdf_spinlock_init(&hdd_ctx->connection_status_lock);

	cdf_spinlock_init(&hdd_ctx->hdd_adapter_lock);
	cdf_list_init(&hdd_ctx->hddAdapters, MAX_NUMBER_OF_ADAPTERS);
+3 −3
Original line number Diff line number Diff line
@@ -1768,16 +1768,16 @@ static int __wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy)
	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
			 TRACE_CODE_HDD_CFG80211_RESUME_WLAN,
			 NO_SESSION, pHddCtx->isWiphySuspended));
	spin_lock(&pHddCtx->schedScan_lock);
	cdf_spin_lock(&pHddCtx->sched_scan_lock);
	pHddCtx->isWiphySuspended = false;
	if (true != pHddCtx->isSchedScanUpdatePending) {
		spin_unlock(&pHddCtx->schedScan_lock);
		cdf_spin_unlock(&pHddCtx->sched_scan_lock);
		hddLog(LOG1, FL("Return resume is not due to PNO indication"));
		return 0;
	}
	/* Reset flag to avoid updatating cfg80211 data old results again */
	pHddCtx->isSchedScanUpdatePending = false;
	spin_unlock(&pHddCtx->schedScan_lock);
	cdf_spin_unlock(&pHddCtx->sched_scan_lock);

	status = hdd_get_front_adapter(pHddCtx, &pAdapterNode);

+3 −3
Original line number Diff line number Diff line
@@ -1951,15 +1951,15 @@ hdd_sched_scan_callback(void *callbackContext,
		return;
	}

	spin_lock(&pHddCtx->schedScan_lock);
	cdf_spin_lock(&pHddCtx->sched_scan_lock);
	if (true == pHddCtx->isWiphySuspended) {
		pHddCtx->isSchedScanUpdatePending = true;
		spin_unlock(&pHddCtx->schedScan_lock);
		cdf_spin_unlock(&pHddCtx->sched_scan_lock);
		hddLog(LOG1,
		       FL("Update cfg80211 scan database after it resume"));
		return;
	}
	spin_unlock(&pHddCtx->schedScan_lock);
	cdf_spin_unlock(&pHddCtx->sched_scan_lock);

	ret = wlan_hdd_cfg80211_update_bss(pHddCtx->wiphy, pAdapter, 0);