wlan: Do not let APPS to suspend if LFR is in the middle of a scan.
When AP to which the STA is connected is abruptly turned off, LFR
triggered scans kick-in due to RSSI penalization of missed beacons.
When this happens, it is being observed that it takes a very long
time to disconnect and move into IMPS.
This happens when APPS attempts to suspend when LFR is in the middle
of a background scan (i.e. the suspend request came in between the
INIT and FINISH scan for the single/multiple channel background scan
triggered by LFR).
Background scans from LFR do not use a wakelock (as this is a non-HLOS
functionality). Due to this, the suspend request from the APPS succeeds.
When this happens, Riva is still in suspend BMPS state because we are
in the middle of a background scan. Riva resumes BMPS only when the
scan completes. But, since the APPS is already suspended, finishing the
scan gets delayed and there is nothing to have Riva resume BMPS.
When BMPS is suspended in Riva during the scan, the heartbeat/beacon
miss monitoring is suspended as well. So, if APPS suspends when LFR is
in the middle of a background scan, then beacon miss monitoring in Riva
gets disabled as well. This in turn results in long time to get
disconnected and enter IMPS.
This issue is being fixed by not allowing APPS to suspend when LFR is
in the middle of a background scan.
Change-Id: Ia68fd710fb61903d7691a32bc30cfbf1839a2d06
CRs-Fixed: 444003
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 7ca4cf6..77790c7 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -4659,6 +4659,7 @@
v_BOOL_t hdd_is_apps_power_collapse_allowed(hdd_context_t* pHddCtx)
{
tPmcState pmcState = pmcGetPmcState(pHddCtx->hHal);
+ tANI_BOOLEAN scanRspPending = csrNeighborRoamScanRspPending(pHddCtx->hHal);
hdd_config_t *pConfig = pHddCtx->cfg_ini;
hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL;
hdd_adapter_t *pAdapter = NULL;
@@ -4687,10 +4688,14 @@
if ( (WLAN_HDD_INFRA_STATION == pAdapter->device_mode)
|| (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode) )
{
- if ((pConfig->fIsImpsEnabled || pConfig->fIsBmpsEnabled)
+ if (((pConfig->fIsImpsEnabled || pConfig->fIsBmpsEnabled)
&& (pmcState != IMPS && pmcState != BMPS
- && pmcState != STOPPED && pmcState != STANDBY))
+ && pmcState != STOPPED && pmcState != STANDBY)) ||
+ (eANI_BOOLEAN_TRUE == scanRspPending))
{
+ hddLog( LOGE, "%s: do not allow APPS power collapse-"
+ "pmcState = %d scanRspPending = %d",
+ __func__, pmcState, scanRspPending );
return FALSE;
}
}