diff options
author | gaurank kathpalia <gkathpal@codeaurora.org> | 2019-12-05 11:20:54 +0530 |
---|---|---|
committer | Isaac Chiou <isaacchiou@google.com> | 2020-02-24 05:50:58 +0000 |
commit | 3358f7ab1a71b3e03a548f4267606a4045ad439f (patch) | |
tree | 6347df54f0a0a9ccc2e9c744488f5f42fbec1ab5 | |
parent | 19b06765244a678967f6688595fd73f22800d2e3 (diff) | |
download | qcacld-3358f7ab1a71b3e03a548f4267606a4045ad439f.tar.gz |
qcacld-3.0: Prevent wlan suspend if conn in progress
Currently the driver does not check if the state
is key exchange in progress and suspends wlan
before set-key happens which further results in
FW also in wake up state.
This would result in delayed EAP exchange, and also
in power loss.
Scenario:-
1. Turn on STA and try to connect to enterprise network
2. Turn off display.
Here the display turn off would trigger APPS suspend
while the STA is trying to connect, and authenticate
and since there is no check in driver to prevent
suspend in set key in progress state, it would result
in a FW assert, as the expectation of FW is to allow
suspend only after set key has been done.
Fix is to prevent WLAN-suspend in case of connection
in progress, and allow suspend only in connected
and authenticated state.
bug: 145103580
Merged-In: Ic173116f7ba424005d938a43c75831a6a4dc874c
Change-Id: Ic173116f7ba424005d938a43c75831a6a4dc874c
CRs-Fixed: 2512866
Signed-off-by: Isaac Chiou <isaacchiou@google.com>
(cherry picked from commit 276984563e07e788f8d75f1257c12227593c4032)
-rw-r--r-- | core/hdd/src/wlan_hdd_power.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index c5e6579474..9b7d100cfc 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -79,6 +79,7 @@ #include <wlan_logging_sock_svc.h> #include "cds_utils.h" #include "wlan_hdd_packet_filter_api.h" +#include "cds_concurrency.h" /* Preprocessor definitions and constants */ #define HDD_SSR_BRING_UP_TIME 30000 @@ -1985,6 +1986,11 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, } mutex_unlock(&pHddCtx->iface_change_lock); + if (cds_is_connection_in_progress(NULL, NULL)) { + hdd_err("Suspend rejected: conn in progress"); + return -EINVAL; + } + /* If RADAR detection is in progress (HDD), prevent suspend. The flag * "dfs_cac_block_tx" is set to true when RADAR is found and stay true * until CAC is done for a SoftAP which is in started state. |