qcacld-3.0: Disable Runtime PM when ROC in progress

During ROC, runtime pm needs to be disabled to allow FW send the
packets to host.

Change-Id: Ib51321f105b5a57df2d67c0ff1502dc4c051a5da
CRs-Fixed: 1072520
This commit is contained in:
Komal Seelam 2016-09-29 12:32:13 +05:30 • committed by qcabuildsw
commit aa75f26bff
3 changed files with 17 additions and 1 deletions

View file

@ -862,6 +862,7 @@ struct hdd_chan_change_params {
*/
struct hdd_runtime_pm_context {
qdf_runtime_lock_t scan;
qdf_runtime_lock_t roc;
};
/**

View file

@ -2463,6 +2463,7 @@ static void hdd_runtime_suspend_context_init(hdd_context_t *hdd_ctx)
struct hdd_runtime_pm_context *ctx = &hdd_ctx->runtime_context;
ctx->scan = qdf_runtime_lock_init("scan");
ctx->roc = qdf_runtime_lock_init("roc");
}
/**
@ -2477,6 +2478,8 @@ static void hdd_runtime_suspend_context_deinit(hdd_context_t *hdd_ctx)
qdf_runtime_lock_deinit(ctx->scan);
ctx->scan = NULL;
qdf_runtime_lock_deinit(ctx->roc);
ctx->roc = NULL;
}
static void hdd_adapter_runtime_suspend_init(hdd_adapter_t *adapter)

View file

@ -193,6 +193,7 @@ QDF_STATUS wlan_hdd_remain_on_channel_callback(tHalHandle hHal, void *pCtx,
* roc requests are immediately processed without being queued
*/
pAdapter->is_roc_inprogress = false;
qdf_runtime_pm_allow_suspend(hdd_ctx->runtime_context.roc);
/*
* If the allow suspend is done later, the scheduled roc wil prevent
* the system from going into suspend and immediately this logic
@ -266,6 +267,7 @@ void wlan_hdd_cancel_existing_remain_on_channel(hdd_adapter_t *pAdapter)
{
hdd_cfg80211_state_t *cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter);
hdd_remain_on_chan_ctx_t *pRemainChanCtx;
hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
unsigned long rc;
mutex_lock(&cfgState->remain_on_chan_ctx_lock);
@ -340,6 +342,7 @@ void wlan_hdd_cancel_existing_remain_on_channel(hdd_adapter_t *pAdapter)
if (!rc) {
hdd_err("timeout waiting for cancel remain on channel ready indication");
}
qdf_runtime_pm_allow_suspend(hdd_ctx->runtime_context.roc);
hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
} else
mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
@ -468,6 +471,7 @@ static void wlan_hdd_remain_on_chan_timeout(void *data)
hdd_adapter_t *pAdapter = (hdd_adapter_t *) data;
hdd_remain_on_chan_ctx_t *pRemainChanCtx;
hdd_cfg80211_state_t *cfgState;
hdd_context_t *hdd_ctx;
if ((NULL == pAdapter) ||
(WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) {
@ -475,6 +479,7 @@ static void wlan_hdd_remain_on_chan_timeout(void *data)
return;
}
hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter);
mutex_lock(&cfgState->remain_on_chan_ctx_lock);
pRemainChanCtx = cfgState->remain_on_chan_ctx;
@ -510,8 +515,8 @@ static void wlan_hdd_remain_on_chan_timeout(void *data)
pRemainChanCtx->scan_id);
}
qdf_runtime_pm_allow_suspend(hdd_ctx->runtime_context.roc);
hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
}
static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter,
@ -571,6 +576,7 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter,
duration = P2P_ROC_DURATION_MULTIPLIER_GO_ABSENT * duration;
hdd_prevent_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
qdf_runtime_pm_prevent_suspend(pHddCtx->runtime_context.roc);
INIT_COMPLETION(pAdapter->rem_on_chan_ready_event);
/* call sme API to start remain on channel. */
@ -598,6 +604,8 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter,
qdf_mc_timer_destroy(
&pRemainChanCtx->hdd_remain_on_chan_timer);
qdf_mem_free(pRemainChanCtx);
qdf_runtime_pm_allow_suspend(pHddCtx->runtime_context.
roc);
hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
return -EINVAL;
}
@ -629,6 +637,8 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter,
qdf_mc_timer_destroy(
&pRemainChanCtx->hdd_remain_on_chan_timer);
qdf_mem_free(pRemainChanCtx);
qdf_runtime_pm_allow_suspend(pHddCtx->runtime_context.
roc);
hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
return -EINVAL;
}
@ -641,6 +651,8 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter,
wlansap_cancel_remain_on_channel(
WLAN_HDD_GET_SAP_CTX_PTR(pAdapter),
pRemainChanCtx->scan_id);
qdf_runtime_pm_allow_suspend(pHddCtx->runtime_context.
roc);
hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
return -EINVAL;
}