From ca144d8158ef2514b7fcdaf4b257a595fe12fde6 Mon Sep 17 00:00:00 2001 From: Guolei Bian Date: Thu, 10 Nov 2016 11:07:42 +0800 Subject: [PATCH] qcacld-3.0: reset sta_connected to 0 during SSR to avoid fw crash qcacld-2.0 to qcacld-3.0 propagation sta_connected flag check may fail when handle WLAN_STA_CONNECT event. This will cause enable-ipa operation get skipped for the connect operation. If a disconnect operation follows, it will invoke fw to disable the ipa. Fw considers ipa to be disabled by default, so fw will consider it be double-disable and trigger the crash. Change-Id: Iaf4855eb1776e8c8c3b027d0ee2beb644063ef75 CRs-Fixed: 1079051 --- core/hdd/src/wlan_hdd_ipa.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index cd6d8d9e0778..27736c9a4104 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -638,6 +638,27 @@ static inline bool hdd_ipa_uc_sta_is_enabled(hdd_context_t *hdd_ctx) return HDD_IPA_IS_CONFIG_ENABLED(hdd_ctx, HDD_IPA_UC_STA_ENABLE_MASK); } +/** + * hdd_ipa_uc_sta_reset_sta_connected() - Reset sta_connected flag + * @hdd_ipa: Global HDD IPA context + * + * Return: None + */ +#ifdef IPA_UC_STA_OFFLOAD +static inline void hdd_ipa_uc_sta_reset_sta_connected( + struct hdd_ipa_priv *hdd_ipa) +{ + vos_lock_acquire(&hdd_ipa->event_lock); + hdd_ipa->sta_connected = 0; + vos_lock_release(&hdd_ipa->event_lock); +} +#else +static inline void hdd_ipa_uc_sta_reset_sta_connected( + struct hdd_ipa_priv *hdd_ipa) +{ +} +#endif + /** * hdd_ipa_is_pre_filter_enabled() - Is IPA pre-filter enabled? * @hdd_ipa: Global HDD IPA context @@ -2017,6 +2038,9 @@ int hdd_ipa_uc_ssr_deinit(void) } qdf_mutex_release(&hdd_ipa->ipa_lock); + if (hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx)) + hdd_ipa_uc_sta_reset_sta_connected(hdd_ipa); + /* Full IPA driver cleanup not required since wlan driver is now * unloaded and reloaded after SSR. */