qcacld-3.0: Fix race condition in sending STA IPA offload enable

During resource unloading, if two next to next client connect
request comes, one is handled in pending event handler in
wlan_ipa_uc_op_cb callback after processing FW TX suspend response
and other one is handled in scheduler thread, this causes race
condition in sending IPA offload enable for STA iface. So send IPA
enable req to FW before queuing the client connect event to the
pending events.

Change-Id: Ifcabc2481e590e5e128434614c4b46fe53a34636
CRs-Fixed: 2460573
This commit is contained in:
Vevek Venkatesan 2019-06-10 23:35:19 +05:30 committed by Gerrit - the friendly Code Review server
parent e5775805c7
commit ed315cdbdd

View File

@ -1527,6 +1527,24 @@ bool wlan_ipa_is_fw_wdi_activated(struct wlan_ipa_priv *ipa_ctx)
} }
#endif #endif
static inline
bool wlan_sap_no_client_connected(struct wlan_ipa_priv *ipa_ctx)
{
return !(ipa_ctx->sap_num_connected_sta);
}
static inline
bool wlan_sta_is_connected(struct wlan_ipa_priv *ipa_ctx)
{
return ipa_ctx->sta_connected;
}
static inline
bool wlan_ipa_uc_is_loaded(struct wlan_ipa_priv *ipa_ctx)
{
return ipa_ctx->uc_loaded;
}
/** /**
* wlan_ipa_uc_offload_enable_disable() - wdi enable/disable notify to fw * wlan_ipa_uc_offload_enable_disable() - wdi enable/disable notify to fw
* @ipa_ctx: global IPA context * @ipa_ctx: global IPA context
@ -1659,10 +1677,23 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode,
ipa_ctx->resource_loading ? ipa_ctx->resource_loading ?
"load" : "unload"); "load" : "unload");
if (type == QDF_IPA_AP_DISCONNECT) if (type == QDF_IPA_AP_DISCONNECT) {
wlan_ipa_uc_offload_enable_disable(ipa_ctx, wlan_ipa_uc_offload_enable_disable(ipa_ctx,
SIR_AP_RX_DATA_OFFLOAD, SIR_AP_RX_DATA_OFFLOAD,
session_id, false); session_id, false);
} else if (type == QDF_IPA_CLIENT_CONNECT_EX &&
wlan_sap_no_client_connected(ipa_ctx)) {
if (wlan_sta_is_connected(ipa_ctx) &&
wlan_ipa_uc_is_loaded(ipa_ctx) &&
wlan_ipa_uc_sta_is_enabled(ipa_ctx->
config) &&
!wlan_ipa_is_sta_only_offload_enabled()) {
wlan_ipa_uc_offload_enable_disable(
ipa_ctx,
SIR_STA_RX_DATA_OFFLOAD,
sta_session_id, true);
}
}
qdf_mutex_acquire(&ipa_ctx->ipa_lock); qdf_mutex_acquire(&ipa_ctx->ipa_lock);