Browse Source

qcacmn: Avoid race condition while modifying connection list

In case of STA-AP case, new thread is created to call the func
policy_mgr_check_sta_ap_concurrent_ch_intf() that calls
policy_mgr_get_pcl_for_existing_conn() that modifies
pm_conc_connection_list table. The mc_thread calls
policy_mgr_get_valid_chan_weights() that also modifies
pm_conc_connection_list table. But the race condition is
created that mess up the pm_conc_connection_list table.

This race condition also leads to the scenario where the STA
connection to the AP is not updated properly . This shall lead
to the improper PCL update for a STA+SAP concurrency and thus
the channel switch fails.

The fix is to protect the whole sequence of the function
policy_mgr_check_sta_ap_concurrent_ch_intf() with mutex to avoid
race condition.

Change-Id: Ibb6d804afa70ef45d99e7ec9fc7fecc4993c7621
CRs-Fixed: 2047765
Nitesh Shah 8 years ago
parent
commit
1763abada0
1 changed files with 2 additions and 0 deletions
  1. 2 0
      umac/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c

+ 2 - 0
umac/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c

@@ -668,9 +668,11 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data)
 		policy_mgr_err("SAP restart get channel callback in NULL");
 		return;
 	}
+	qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
 	status = pm_ctx->hdd_cbacks.
 		wlan_hdd_get_channel_for_sap_restart(psoc, vdev_id,
 			&channel, &sec_ch, restart_sap);
+	qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
 	if (status != QDF_STATUS_SUCCESS) {
 		policy_mgr_err("Failed to switch SAP channel");
 		return;