qcacld-3.0: Wait for sme_soc_set_dual_mac_config to get complete

SAP turn on is getting stuck for longer time due to vdev is getting
deleted logically before response for sme_soc_set_dual_mac_config comes.

To resolve this, add wait in wlan_hdd_update_dbs_scan_and_fw_mode_config
to confirm sme_soc_set_dual_mac_config completion.

Change-Id: I9408713fcf828d24688ecc45290d8c90a8d54c22
CRs-Fixed: 2663509
This commit is contained in:
Bapiraju Alla
2020-04-14 20:07:00 +05:30
committed by nshrivas
orang tua 6132f72217
melakukan 6cddfae45a
8 mengubah file dengan 155 tambahan dan 11 penghapusan

Melihat File

@@ -1545,6 +1545,7 @@ void policy_mgr_set_dual_mac_fw_mode_config(struct wlan_objmgr_psoc *psoc,
/** /**
* policy_mgr_soc_set_dual_mac_cfg_cb() - Callback for set dual mac config * policy_mgr_soc_set_dual_mac_cfg_cb() - Callback for set dual mac config
* @psoc: PSOC object information
* @status: Status of set dual mac config * @status: Status of set dual mac config
* @scan_config: Current scan config whose status is the first param * @scan_config: Current scan config whose status is the first param
* @fw_mode_config: Current FW mode config whose status is the first param * @fw_mode_config: Current FW mode config whose status is the first param
@@ -1553,8 +1554,10 @@ void policy_mgr_set_dual_mac_fw_mode_config(struct wlan_objmgr_psoc *psoc,
* *
* Return: None * Return: None
*/ */
void policy_mgr_soc_set_dual_mac_cfg_cb(enum set_hw_mode_status status, void policy_mgr_soc_set_dual_mac_cfg_cb(struct wlan_objmgr_psoc *psoc,
uint32_t scan_config, uint32_t fw_mode_config); enum set_hw_mode_status status,
uint32_t scan_config,
uint32_t fw_mode_config);
/** /**
* policy_mgr_map_concurrency_mode() - to map concurrency mode * policy_mgr_map_concurrency_mode() - to map concurrency mode
@@ -1720,6 +1723,44 @@ QDF_STATUS policy_mgr_reset_connection_update(struct wlan_objmgr_psoc *psoc);
*/ */
QDF_STATUS policy_mgr_set_connection_update(struct wlan_objmgr_psoc *psoc); QDF_STATUS policy_mgr_set_connection_update(struct wlan_objmgr_psoc *psoc);
/**
* policy_mgr_reset_dual_mac_configuration() - Reset dual MAC configuration
* complete event
* @psoc: PSOC object information
* Resets the concurrent dual MAC configuration complete event
*
* Return: QDF_STATUS
*/
QDF_STATUS
policy_mgr_reset_dual_mac_configuration(struct wlan_objmgr_psoc *psoc);
/**
* policy_mgr_wait_for_dual_mac_configuration() - Wait for set dual MAC
* configuration command to get processed
* @psoc: PSOC object information
* Waits for DUAL_MAC_CONFIG_TIMEOUT duration until
* policy_mgr_soc_set_dual_mac_cfg_cb sets the event
* dual_mac_configuration_complete_evt
*
* Return: QDF_STATUS
*/
QDF_STATUS
policy_mgr_wait_for_dual_mac_configuration(struct wlan_objmgr_psoc *psoc);
/**
* policy_mgr_dual_mac_configuration_complete() - Complete dual MAC
* configuration wait event
* @psoc: PSOC object information
* Sets the concurrent dual MAC configuration complete event
*
* Return: QDF_STATUS
*/
QDF_STATUS
policy_mgr_dual_mac_configuration_complete(struct wlan_objmgr_psoc *psoc);
/** /**
* policy_mgr_set_chan_switch_complete_evt() - set channel * policy_mgr_set_chan_switch_complete_evt() - set channel
* switch completion event * switch completion event

Melihat File

@@ -980,9 +980,10 @@ enum set_hw_mode_status {
SET_HW_MODE_STATUS_ALREADY, SET_HW_MODE_STATUS_ALREADY,
}; };
typedef void (*dual_mac_cb)(enum set_hw_mode_status status, typedef void (*dual_mac_cb)(struct wlan_objmgr_psoc *psoc,
uint32_t scan_config, enum set_hw_mode_status status,
uint32_t fw_mode_config); uint32_t scan_config,
uint32_t fw_mode_config);
/** /**
* enum policy_mgr_hw_mode_change - identify the HW mode switching to. * enum policy_mgr_hw_mode_change - identify the HW mode switching to.
* *

Melihat File

@@ -2273,6 +2273,77 @@ QDF_STATUS policy_mgr_set_connection_update(struct wlan_objmgr_psoc *psoc)
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
QDF_STATUS
policy_mgr_wait_for_dual_mac_configuration(struct wlan_objmgr_psoc *psoc)
{
QDF_STATUS status;
struct policy_mgr_psoc_priv_obj *policy_mgr_context;
policy_mgr_context = policy_mgr_get_context(psoc);
if (!policy_mgr_context) {
policy_mgr_err("Invalid context");
return QDF_STATUS_E_FAILURE;
}
status = qdf_wait_single_event(
&policy_mgr_context->dual_mac_configuration_complete_evt,
DUAL_MAC_CONFIG_TIMEOUT);
if (!QDF_IS_STATUS_SUCCESS(status)) {
policy_mgr_err("wait for event failed");
return QDF_STATUS_E_FAILURE;
}
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
policy_mgr_dual_mac_configuration_complete(struct wlan_objmgr_psoc *psoc)
{
QDF_STATUS status;
struct policy_mgr_psoc_priv_obj *policy_mgr_context;
policy_mgr_context = policy_mgr_get_context(psoc);
if (!policy_mgr_context) {
policy_mgr_err("Invalid context");
return QDF_STATUS_E_FAILURE;
}
status = qdf_event_set(
&policy_mgr_context->dual_mac_configuration_complete_evt);
if (!QDF_IS_STATUS_SUCCESS(status)) {
policy_mgr_err("set event failed");
return QDF_STATUS_E_FAILURE;
}
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
policy_mgr_reset_dual_mac_configuration(struct wlan_objmgr_psoc *psoc)
{
QDF_STATUS status;
struct policy_mgr_psoc_priv_obj *policy_mgr_context;
policy_mgr_context = policy_mgr_get_context(psoc);
if (!policy_mgr_context) {
policy_mgr_err("Invalid context");
return QDF_STATUS_E_FAILURE;
}
status = qdf_event_reset(
&policy_mgr_context->dual_mac_configuration_complete_evt);
if (!QDF_IS_STATUS_SUCCESS(status)) {
policy_mgr_err("clear event failed");
return QDF_STATUS_E_FAILURE;
}
return QDF_STATUS_SUCCESS;
}
QDF_STATUS policy_mgr_set_chan_switch_complete_evt( QDF_STATUS policy_mgr_set_chan_switch_complete_evt(
struct wlan_objmgr_psoc *psoc) struct wlan_objmgr_psoc *psoc)
{ {

Melihat File

@@ -1386,12 +1386,15 @@ QDF_STATUS policy_mgr_check_conn_with_mode_and_vdev_id(
return qdf_status; return qdf_status;
} }
void policy_mgr_soc_set_dual_mac_cfg_cb(enum set_hw_mode_status status, void policy_mgr_soc_set_dual_mac_cfg_cb(struct wlan_objmgr_psoc *psoc,
uint32_t scan_config, enum set_hw_mode_status status,
uint32_t fw_mode_config) uint32_t scan_config,
uint32_t fw_mode_config)
{ {
policy_mgr_debug("Status:%d for scan_config:%x fw_mode_config:%x", policy_mgr_debug("Status:%d for scan_config:%x fw_mode_config:%x",
status, scan_config, fw_mode_config); status, scan_config, fw_mode_config);
policy_mgr_dual_mac_configuration_complete(psoc);
} }
void policy_mgr_set_dual_mac_scan_config(struct wlan_objmgr_psoc *psoc, void policy_mgr_set_dual_mac_scan_config(struct wlan_objmgr_psoc *psoc,

Melihat File

@@ -41,6 +41,8 @@
#define PM_5_GHZ_CH_FREQ_36 (5180) #define PM_5_GHZ_CH_FREQ_36 (5180)
#define CHANNEL_SWITCH_COMPLETE_TIMEOUT (2000) #define CHANNEL_SWITCH_COMPLETE_TIMEOUT (2000)
#define DUAL_MAC_CONFIG_TIMEOUT (POLICY_MGR_SER_CMD_TIMEOUT + 1000)
/** /**
* Policy Mgr hardware mode list bit-mask definitions. * Policy Mgr hardware mode list bit-mask definitions.
* Bits 4:0, 31:29 are unused. * Bits 4:0, 31:29 are unused.
@@ -333,6 +335,8 @@ struct policy_mgr_cfg {
* @user_config_sap_ch_freq: SAP channel freq configured by user application * @user_config_sap_ch_freq: SAP channel freq configured by user application
* @cfg: Policy manager config data * @cfg: Policy manager config data
* @dynamic_mcc_adaptive_sched: disable/enable mcc adaptive scheduler feature * @dynamic_mcc_adaptive_sched: disable/enable mcc adaptive scheduler feature
* @dual_mac_configuration_complete_evt: qdf event to synchronize dual mac
* configuration setting
*/ */
struct policy_mgr_psoc_priv_obj { struct policy_mgr_psoc_priv_obj {
struct wlan_objmgr_psoc *psoc; struct wlan_objmgr_psoc *psoc;
@@ -374,6 +378,7 @@ struct policy_mgr_psoc_priv_obj {
uint32_t valid_ch_freq_list[NUM_CHANNELS]; uint32_t valid_ch_freq_list[NUM_CHANNELS];
uint32_t valid_ch_freq_list_count; uint32_t valid_ch_freq_list_count;
bool dynamic_mcc_adaptive_sched; bool dynamic_mcc_adaptive_sched;
qdf_event_t dual_mac_configuration_complete_evt;
}; };
/** /**

Melihat File

@@ -440,6 +440,13 @@ QDF_STATUS policy_mgr_psoc_enable(struct wlan_objmgr_psoc *psoc)
return status; return status;
} }
/* init dual_mac_configuration_complete_evt */
status = qdf_event_create(&pm_ctx->dual_mac_configuration_complete_evt);
if (!QDF_IS_STATUS_SUCCESS(status)) {
policy_mgr_err("dual_mac_configuration_complete_evt init failed");
return status;
}
status = qdf_event_create(&pm_ctx->opportunistic_update_done_evt); status = qdf_event_create(&pm_ctx->opportunistic_update_done_evt);
if (!QDF_IS_STATUS_SUCCESS(status)) { if (!QDF_IS_STATUS_SUCCESS(status)) {
policy_mgr_err("opportunistic_update_done_evt init failed"); policy_mgr_err("opportunistic_update_done_evt init failed");
@@ -595,6 +602,14 @@ QDF_STATUS policy_mgr_psoc_disable(struct wlan_objmgr_psoc *psoc)
QDF_ASSERT(0); QDF_ASSERT(0);
} }
/* destroy dual_mac_configuration_complete_evt */
if (!QDF_IS_STATUS_SUCCESS(qdf_event_destroy
(&pm_ctx->dual_mac_configuration_complete_evt))) {
policy_mgr_err("Failed to destroy dual_mac_configuration_complete_evt");
status = QDF_STATUS_E_FAILURE;
QDF_ASSERT(0);
}
/* deinit pm_conc_connection_list */ /* deinit pm_conc_connection_list */
qdf_mem_zero(pm_conc_connection_list, sizeof(pm_conc_connection_list)); qdf_mem_zero(pm_conc_connection_list, sizeof(pm_conc_connection_list));

Melihat File

@@ -2762,13 +2762,21 @@ wlan_hdd_update_dbs_scan_and_fw_mode_config(void)
hdd_debug("send scan_cfg: 0x%x fw_mode_cfg: 0x%x to fw", hdd_debug("send scan_cfg: 0x%x fw_mode_cfg: 0x%x to fw",
cfg.scan_config, cfg.fw_mode_config); cfg.scan_config, cfg.fw_mode_config);
status = policy_mgr_reset_dual_mac_configuration(hdd_ctx->psoc);
if (QDF_IS_STATUS_ERROR(status))
return status;
status = sme_soc_set_dual_mac_config(cfg); status = sme_soc_set_dual_mac_config(cfg);
if (status != QDF_STATUS_SUCCESS) { if (QDF_IS_STATUS_SUCCESS(status)) {
/* wait for sme_soc_set_dual_mac_config to complete */
status =
policy_mgr_wait_for_dual_mac_configuration(hdd_ctx->psoc);
} else {
hdd_err("sme_soc_set_dual_mac_config failed %d", status); hdd_err("sme_soc_set_dual_mac_config failed %d", status);
return status; return status;
} }
return QDF_STATUS_SUCCESS; return status;
} }
/** /**

Melihat File

@@ -1973,7 +1973,7 @@ static QDF_STATUS sme_process_dual_mac_config_resp(struct mac_context *mac,
sme_err("Callback failed-Dual mac config is NULL"); sme_err("Callback failed-Dual mac config is NULL");
} else { } else {
sme_debug("Calling HDD callback for Dual mac config"); sme_debug("Calling HDD callback for Dual mac config");
callback(param->status, callback(mac->psoc, param->status,
command->u.set_dual_mac_cmd.scan_config, command->u.set_dual_mac_cmd.scan_config,
command->u.set_dual_mac_cmd.fw_mode_config); command->u.set_dual_mac_cmd.fw_mode_config);
} }