qcacld-3.0: Change semantics of Runtime Lock APIs

QDF Runtime PM lock APIs semantics are changed. Incorporate the
changes done in QDF for all the Runtime PM lock APIs.

CRs-fixed: 1116549
Change-Id: Ia701378031b7e9c01583eaef403e1219fdce47e3
This commit is contained in:
Prashanth Bhatta
2017-01-19 15:17:58 -08:00
committed by snandini
父節點 d77b5f094f
當前提交 87b6dc0a9f
共有 8 個文件被更改,包括 33 次插入36 次删除

查看文件

@@ -14613,7 +14613,7 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
hdd_conn_set_connection_state(pAdapter,
eConnectionState_Connecting);
qdf_runtime_pm_prevent_suspend(pAdapter->connect_rpm_ctx.
qdf_runtime_pm_prevent_suspend(&pAdapter->connect_rpm_ctx.
connect);
hdd_prevent_suspend_timeout(HDD_WAKELOCK_TIMEOUT_CONNECT,
WIFI_POWER_EVENT_WAKELOCK_CONNECT);
@@ -14632,7 +14632,7 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
/* change back to NotAssociated */
hdd_conn_set_connection_state(pAdapter,
eConnectionState_NotConnected);
qdf_runtime_pm_allow_suspend(pAdapter->connect_rpm_ctx.
qdf_runtime_pm_allow_suspend(&pAdapter->connect_rpm_ctx.
connect);
hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_CONNECT);
}

查看文件

@@ -164,7 +164,7 @@ static void hdd_hostapd_channel_allow_suspend(hdd_adapter_t *pAdapter,
hdd_err("DFS: allowing suspend (chan: %d)", channel);
qdf_wake_lock_release(&pHddCtx->sap_dfs_wakelock,
WIFI_POWER_EVENT_WAKELOCK_DFS);
qdf_runtime_pm_allow_suspend(pHddCtx->runtime_context.dfs);
qdf_runtime_pm_allow_suspend(&pHddCtx->runtime_context.dfs);
}
}
@@ -201,7 +201,7 @@ static void hdd_hostapd_channel_prevent_suspend(hdd_adapter_t *pAdapter,
/* Acquire wakelock if we have at least one DFS channel in use */
if (atomic_inc_return(&pHddCtx->sap_dfs_ref_cnt) == 1) {
hdd_err("DFS: preventing suspend (chan: %d)", channel);
qdf_runtime_pm_prevent_suspend(pHddCtx->runtime_context.dfs);
qdf_runtime_pm_prevent_suspend(&pHddCtx->runtime_context.dfs);
qdf_wake_lock_acquire(&pHddCtx->sap_dfs_wakelock,
WIFI_POWER_EVENT_WAKELOCK_DFS);
}

查看文件

@@ -2870,8 +2870,8 @@ static void hdd_runtime_suspend_context_init(hdd_context_t *hdd_ctx)
{
struct hdd_runtime_pm_context *ctx = &hdd_ctx->runtime_context;
ctx->roc = qdf_runtime_lock_init("roc");
ctx->dfs = qdf_runtime_lock_init("dfs");
qdf_runtime_lock_init(&ctx->roc);
qdf_runtime_lock_init(&ctx->dfs);
}
/**
@@ -2884,10 +2884,8 @@ static void hdd_runtime_suspend_context_deinit(hdd_context_t *hdd_ctx)
{
struct hdd_runtime_pm_context *ctx = &hdd_ctx->runtime_context;
qdf_runtime_lock_deinit(ctx->roc);
ctx->roc = NULL;
qdf_runtime_lock_deinit(ctx->dfs);
ctx->dfs = NULL;
qdf_runtime_lock_deinit(&ctx->roc);
qdf_runtime_lock_deinit(&ctx->dfs);
wlan_scan_runtime_pm_deinit(hdd_ctx->hdd_pdev);
}
@@ -2896,15 +2894,14 @@ static void hdd_adapter_runtime_suspend_init(hdd_adapter_t *adapter)
{
struct hdd_connect_pm_context *ctx = &adapter->connect_rpm_ctx;
ctx->connect = qdf_runtime_lock_init("connect");
qdf_runtime_lock_init(&ctx->connect);
}
static void hdd_adapter_runtime_suspend_denit(hdd_adapter_t *adapter)
{
struct hdd_connect_pm_context *ctx = &adapter->connect_rpm_ctx;
qdf_runtime_lock_deinit(ctx->connect);
ctx->connect = NULL;
qdf_runtime_lock_deinit(&ctx->connect);
}
#else /* FEATURE_RUNTIME_PM */
static void hdd_runtime_suspend_context_init(hdd_context_t *hdd_ctx) {}
@@ -4738,7 +4735,7 @@ void hdd_connect_result(struct net_device *dev, const u8 *bssid,
req_ie_len, resp_ie, resp_ie_len,
status, gfp, connect_timeout, timeout_reason);
qdf_runtime_pm_allow_suspend(padapter->connect_rpm_ctx.connect);
qdf_runtime_pm_allow_suspend(&padapter->connect_rpm_ctx.connect);
hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_CONNECT);
}
#else
@@ -4753,7 +4750,8 @@ void hdd_connect_result(struct net_device *dev, const u8 *bssid,
cfg80211_connect_result(dev, bssid, req_ie, req_ie_len,
resp_ie, resp_ie_len, status, gfp);
qdf_runtime_pm_allow_suspend(padapter->connect_rpm_ctx.connect);
qdf_runtime_pm_allow_suspend(&padapter->connect_rpm_ctx.connect);
hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_CONNECT);
}
#endif

查看文件

@@ -206,7 +206,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);
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
@@ -379,7 +379,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);
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);
@@ -583,7 +583,7 @@ static void wlan_hdd_remain_on_chan_timeout(void *data)
}
hdd_tdls_notify_p2p_roc(hdd_ctx, P2P_ROC_END);
qdf_runtime_pm_allow_suspend(hdd_ctx->runtime_context.roc);
qdf_runtime_pm_allow_suspend(&hdd_ctx->runtime_context.roc);
hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
}
@@ -646,7 +646,7 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter,
}
hdd_prevent_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
qdf_runtime_pm_prevent_suspend(pHddCtx->runtime_context.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. */
@@ -682,7 +682,7 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter,
cfgState->remain_on_chan_ctx = NULL;
}
mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
qdf_runtime_pm_allow_suspend(pHddCtx->runtime_context.
qdf_runtime_pm_allow_suspend(&pHddCtx->runtime_context.
roc);
hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
return -EINVAL;
@@ -723,7 +723,7 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter,
cfgState->remain_on_chan_ctx = NULL;
}
mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
qdf_runtime_pm_allow_suspend(pHddCtx->runtime_context.
qdf_runtime_pm_allow_suspend(&pHddCtx->runtime_context.
roc);
hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
return -EINVAL;
@@ -737,7 +737,7 @@ 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.
qdf_runtime_pm_allow_suspend(&pHddCtx->runtime_context.
roc);
hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
return -EINVAL;

查看文件

@@ -1918,7 +1918,7 @@ static void hdd_stop_dhcp_ind(hdd_adapter_t *adapter)
adapter->macAddressCurrent.bytes,
adapter->sessionId);
hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DHCP);
qdf_runtime_pm_allow_suspend(adapter->connect_rpm_ctx.connect);
qdf_runtime_pm_allow_suspend(&adapter->connect_rpm_ctx.connect);
}
/**
@@ -1935,7 +1935,7 @@ static void hdd_start_dhcp_ind(hdd_adapter_t *adapter)
hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
hdd_debug("DHCP start indicated through power save");
qdf_runtime_pm_prevent_suspend(adapter->connect_rpm_ctx.connect);
qdf_runtime_pm_prevent_suspend(&adapter->connect_rpm_ctx.connect);
hdd_prevent_suspend_timeout(HDD_WAKELOCK_TIMEOUT_CONNECT,
WIFI_POWER_EVENT_WAKELOCK_DHCP);
sme_dhcp_start_ind(hdd_ctx->hHal, adapter->device_mode,