qcacld-3.0: Call eSAP_DFS_CHANNEL_CAC_START event from SAP_STARTING state

Currently, In case of SAP CSA, there is a race condition
driver handles the eSAP_DFS_CHANNEL_CAC_START event
from "SAP_INIT" state and move SAP state to "SAP_STARTING"
in schedular thread. Parallelly, if SAP state is used in
hostapd context to handle the event without being updated
which may lead to a assert.

To fix it, handles the eSAP_DFS_CHANNEL_CAC_START event in
"SAP_STARTING".

Change-Id: I01a535c6f86cdf0eff5bb91be870ab33604fb849
CRs-Fixed: 3541842
This commit is contained in:
Deeksha Gupta
2023-06-28 15:33:00 +05:30
committed by Rahul Choudhary
parent b8e80da2f6
commit 5dcc252bb3
2 changed files with 10 additions and 13 deletions

View File

@@ -528,7 +528,7 @@ wlansap_roam_process_ch_change_success(struct mac_context *mac_ctx,
policy_mgr_get_dfs_master_dynamic_enabled(
mac_ctx->psoc,
sap_ctx->sessionId)) {
sap_ctx->fsm_state = SAP_INIT;
sap_ctx->fsm_state = SAP_STARTING;
/* DFS Channel */
sap_event.event = eSAP_DFS_CHANNEL_CAC_START;
sap_event.params = csr_roam_info;

View File

@@ -3411,9 +3411,6 @@ static QDF_STATUS sap_fsm_cac_start(struct sap_context *sap_ctx,
struct mac_context *mac_ctx,
mac_handle_t mac_handle)
{
sap_ctx->fsm_state = SAP_STARTING;
sap_debug("Move sap state to SAP_STARTING");
if (!mac_ctx->sap.SapDfsInfo.is_dfs_cac_timer_running) {
sap_debug("sapdfs: starting dfs cac timer on sapctx[%pK]",
sap_ctx);
@@ -3460,15 +3457,6 @@ static QDF_STATUS sap_fsm_state_init(struct sap_context *sap_ctx,
mac_ctx, mac_handle);
if (QDF_IS_STATUS_ERROR(qdf_status))
sap_err("sap_goto_starting failed");
} else if (msg == eSAP_DFS_CHANNEL_CAC_START) {
if (sap_ctx->is_chan_change_inprogress) {
sap_signal_hdd_event(sap_ctx,
NULL,
eSAP_CHANNEL_CHANGE_EVENT,
(void *)eSAP_STATUS_SUCCESS);
sap_ctx->is_chan_change_inprogress = false;
}
qdf_status = sap_fsm_cac_start(sap_ctx, mac_ctx, mac_handle);
} else {
sap_err("in state %s, event msg %d", "SAP_INIT", msg);
}
@@ -3918,6 +3906,15 @@ static QDF_STATUS sap_fsm_state_starting(struct sap_context *sap_ctx,
sap_debug("cac duration is zero");
qdf_status = QDF_STATUS_SUCCESS;
}
} else if (msg == eSAP_DFS_CHANNEL_CAC_START) {
if (sap_ctx->is_chan_change_inprogress) {
sap_signal_hdd_event(sap_ctx,
NULL,
eSAP_CHANNEL_CHANGE_EVENT,
(void *)eSAP_STATUS_SUCCESS);
sap_ctx->is_chan_change_inprogress = false;
}
qdf_status = sap_fsm_cac_start(sap_ctx, mac_ctx, mac_handle);
} else {
sap_err("in state %s, invalid event msg %d", "SAP_STARTING",
msg);