diff options
| author | Prashanth Bhatta <bhattap@codeaurora.org> | 2017-01-19 15:17:58 -0800 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2017-01-30 21:22:00 -0800 |
| commit | dd393e781c84608298fcef9579755ee9ea64031b (patch) | |
| tree | 56f1ce2729a372a52cde3421a704a7a7c8f441ca | |
| parent | f2d5c5e549d55e5c9c8fe9293abbf289d004a55a (diff) | |
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
| -rw-r--r-- | core/cds/src/cds_api.c | 12 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_cfg80211.c | 4 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_hostapd.c | 4 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 23 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_p2p.c | 15 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_power.c | 4 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_scan.c | 6 | ||||
| -rw-r--r-- | core/wma/src/wma_dev_if.c | 10 | ||||
| -rw-r--r-- | core/wma/src/wma_features.c | 6 | ||||
| -rw-r--r-- | core/wma/src/wma_main.c | 12 |
10 files changed, 46 insertions, 50 deletions
diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index f94bb9fe8b41..4370247f55b7 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -1674,14 +1674,14 @@ void cds_trigger_recovery(bool skip_crash_inject) return; } - recovery_lock = qdf_runtime_lock_init("cds_recovery"); - if (!recovery_lock) { + status = qdf_runtime_lock_init(&recovery_lock); + if (QDF_STATUS_SUCCESS != status) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, - "Could not acquire runtime pm lock!"); + "Could not acquire runtime pm lock: %d!", status); return; } - qdf_runtime_pm_prevent_suspend(recovery_lock); + qdf_runtime_pm_prevent_suspend(&recovery_lock); /* * If force assert thru platform is available, trigger that interface. @@ -1713,8 +1713,8 @@ void cds_trigger_recovery(bool skip_crash_inject) } out: - qdf_runtime_pm_allow_suspend(recovery_lock); - qdf_runtime_lock_deinit(recovery_lock); + qdf_runtime_pm_allow_suspend(&recovery_lock); + qdf_runtime_lock_deinit(&recovery_lock); } /** diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 1c12075b5e37..4d88160188e5 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -12171,7 +12171,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); status = sme_roam_connect(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, pRoamProfile, @@ -12186,7 +12186,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); } diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index d9732e579eae..c01d6a65704d 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -154,7 +154,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); } } @@ -190,7 +190,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); } diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 2bc21d5c580b..6ca104e64188 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2388,9 +2388,9 @@ 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"); - ctx->dfs = qdf_runtime_lock_init("dfs"); + qdf_runtime_lock_init(&ctx->scan); + qdf_runtime_lock_init(&ctx->roc); + qdf_runtime_lock_init(&ctx->dfs); } /** @@ -2403,26 +2403,23 @@ 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->scan); - ctx->scan = NULL; - qdf_runtime_lock_deinit(ctx->roc); - ctx->roc = NULL; - qdf_runtime_lock_deinit(ctx->dfs); - ctx->dfs = NULL; + qdf_runtime_lock_deinit(&ctx->scan); + qdf_runtime_lock_deinit(&ctx->roc); + qdf_runtime_lock_deinit(&ctx->dfs); } 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); + qdf_runtime_lock_deinit(&ctx->connect); ctx->connect = NULL; } #else /* FEATURE_RUNTIME_PM */ @@ -3977,7 +3974,7 @@ void hdd_connect_result(struct net_device *dev, const u8 *bssid, req_ie_len, resp_ie, resp_ie_len, status, gfp, connect_timeout); - qdf_runtime_pm_allow_suspend(padapter->connect_rpm_ctx.connect); + qdf_runtime_pm_allow_suspend(&padapter->connect_rpm_ctx.connect); } #else void hdd_connect_result(struct net_device *dev, const u8 *bssid, @@ -3990,7 +3987,7 @@ 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); } #endif diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index 1d346d3f93da..b72e6864f8e5 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -197,7 +197,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 @@ -349,7 +349,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); @@ -528,7 +528,8 @@ static void wlan_hdd_remain_on_chan_timeout(void *data) } hdd_restart_tdls_source_timer(hdd_ctx, hdd_ctx->tdls_mode_last); - 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); } @@ -589,7 +590,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); + 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. */ @@ -625,7 +626,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; @@ -666,7 +667,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; @@ -680,7 +681,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; diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 2813628ea5a9..925707dbb795 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1973,7 +1973,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); } /** @@ -1990,7 +1990,7 @@ static void hdd_start_dhcp_ind(hdd_adapter_t *adapter) hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); hdd_err("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(1000, WIFI_POWER_EVENT_WAKELOCK_DHCP); sme_dhcp_start_ind(hdd_ctx->hHal, adapter->device_mode, adapter->macAddressCurrent.bytes, diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index 558fc3d60eac..b9341ecc206d 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -1262,7 +1262,7 @@ static QDF_STATUS hdd_cfg80211_scan_done_callback(tHalHandle halHandle, hdd_vendor_scan_callback(pAdapter, req, aborted); allow_suspend: - qdf_runtime_pm_allow_suspend(hddctx->runtime_context.scan); + qdf_runtime_pm_allow_suspend(&hddctx->runtime_context.scan); qdf_spin_lock(&hddctx->hdd_scan_req_q_lock); size = qdf_list_size(&hddctx->hdd_scan_req_q); if (!size) { @@ -1952,7 +1952,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy, wlan_hdd_update_scan_rand_attrs((void *)&scan_req, (void *)request, WLAN_HDD_HOST_SCAN); - qdf_runtime_pm_prevent_suspend(pHddCtx->runtime_context.scan); + qdf_runtime_pm_prevent_suspend(&pHddCtx->runtime_context.scan); status = sme_scan_request(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, &scan_req, &hdd_cfg80211_scan_done_callback, dev); @@ -1966,7 +1966,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy, status = -EIO; } - qdf_runtime_pm_allow_suspend(pHddCtx->runtime_context.scan); + qdf_runtime_pm_allow_suspend(&pHddCtx->runtime_context.scan); hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_SCAN); goto free_mem; } diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index dbfd3a8f351b..e31875014f8f 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -570,7 +570,7 @@ static QDF_STATUS wma_handle_vdev_detach(tp_wma_handle wma_handle, &wma_handle->wmi_cmd_rsp_wake_lock, WMA_FW_RSP_EVENT_WAKE_LOCK_DURATION); qdf_runtime_pm_prevent_suspend( - wma_handle->wmi_cmd_rsp_runtime_lock); + &wma_handle->wmi_cmd_rsp_runtime_lock); } WMA_LOGD("Call txrx detach with callback for vdev %d", vdev_id); ol_txrx_vdev_detach(iface->handle, NULL, NULL); @@ -2314,7 +2314,7 @@ int wma_vdev_delete_handler(void *handle, uint8_t *cmd_param_info, } qdf_wake_lock_release(&wma->wmi_cmd_rsp_wake_lock, WIFI_POWER_EVENT_WAKELOCK_WMI_CMD_RSP); - qdf_runtime_pm_allow_suspend(wma->wmi_cmd_rsp_runtime_lock); + qdf_runtime_pm_allow_suspend(&wma->wmi_cmd_rsp_runtime_lock); /* Send response to upper layers */ wma_vdev_detach_callback(req_msg->user_data); qdf_mc_timer_stop(&req_msg->event_timeout); @@ -2367,7 +2367,7 @@ int wma_peer_delete_handler(void *handle, uint8_t *cmd_param_info, qdf_wake_lock_release(&wma->wmi_cmd_rsp_wake_lock, WIFI_POWER_EVENT_WAKELOCK_WMI_CMD_RSP); - qdf_runtime_pm_allow_suspend(wma->wmi_cmd_rsp_runtime_lock); + qdf_runtime_pm_allow_suspend(&wma->wmi_cmd_rsp_runtime_lock); /* Cleanup timeout handler */ qdf_mc_timer_stop(&req_msg->event_timeout); qdf_mc_timer_destroy(&req_msg->event_timeout); @@ -2710,7 +2710,7 @@ void wma_vdev_resp_timer(void *data) qdf_wake_lock_release(&wma->wmi_cmd_rsp_wake_lock, WIFI_POWER_EVENT_WAKELOCK_WMI_CMD_RSP); qdf_runtime_pm_allow_suspend( - wma->wmi_cmd_rsp_runtime_lock); + &wma->wmi_cmd_rsp_runtime_lock); } params->status = QDF_STATUS_E_TIMEOUT; @@ -4244,7 +4244,7 @@ static void wma_delete_sta_req_ap_mode(tp_wma_handle wma, WIFI_POWER_EVENT_WAKELOCK_WMI_CMD_RSP); qdf_wake_lock_timeout_acquire(&wma->wmi_cmd_rsp_wake_lock, WMA_FW_RSP_EVENT_WAKE_LOCK_DURATION); - qdf_runtime_pm_prevent_suspend(wma->wmi_cmd_rsp_runtime_lock); + qdf_runtime_pm_prevent_suspend(&wma->wmi_cmd_rsp_runtime_lock); return; } diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 59081e9a6222..f720ec1d6f71 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -4147,7 +4147,7 @@ QDF_STATUS wma_resume_req(tp_wma_handle wma, enum qdf_suspend_type type) wmi_set_runtime_pm_inprogress(wma->wmi_handle, false); if (type == QDF_RUNTIME_SUSPEND) - qdf_runtime_pm_allow_suspend(wma->wma_runtime_resume_lock); + qdf_runtime_pm_allow_suspend(&wma->wma_runtime_resume_lock); return QDF_STATUS_SUCCESS; } @@ -6538,7 +6538,7 @@ static QDF_STATUS wma_post_runtime_resume_msg(WMA_HANDLE handle) QDF_STATUS status; tp_wma_handle wma = (tp_wma_handle) handle; - qdf_runtime_pm_prevent_suspend(wma->wma_runtime_resume_lock); + qdf_runtime_pm_prevent_suspend(&wma->wma_runtime_resume_lock); resume_msg.bodyptr = NULL; resume_msg.type = WMA_RUNTIME_PM_RESUME_IND; @@ -6547,7 +6547,7 @@ static QDF_STATUS wma_post_runtime_resume_msg(WMA_HANDLE handle) if (!QDF_IS_STATUS_SUCCESS(status)) { WMA_LOGE("Failed to post Runtime PM Resume IND to VOS"); - qdf_runtime_pm_allow_suspend(wma->wma_runtime_resume_lock); + qdf_runtime_pm_allow_suspend(&wma->wma_runtime_resume_lock); } return status; diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 2b16119eac4f..d7274c2c6f4b 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -1959,8 +1959,7 @@ QDF_STATUS wma_open(void *cds_context, wma_handle->qdf_dev = qdf_dev; wma_handle->max_scan = cds_cfg->max_scan; - wma_handle->wma_runtime_resume_lock = - qdf_runtime_lock_init("wma_runtime_resume"); + qdf_runtime_lock_init(&wma_handle->wma_runtime_resume_lock); /* Initialize max_no_of_peers for wma_get_number_of_peers_supported() */ wma_init_max_no_of_peers(wma_handle, cds_cfg->max_station); @@ -2348,8 +2347,7 @@ QDF_STATUS wma_open(void *cds_context, qdf_wake_lock_create(&wma_handle->wmi_cmd_rsp_wake_lock, "wlan_fw_rsp_wakelock"); - wma_handle->wmi_cmd_rsp_runtime_lock = - qdf_runtime_lock_init("wlan_fw_rsp_runtime_lock"); + qdf_runtime_lock_init(&wma_handle->wmi_cmd_rsp_runtime_lock); /* Register peer assoc conf event handler */ wmi_unified_register_event_handler(wma_handle->wmi_handle, @@ -2379,7 +2377,7 @@ QDF_STATUS wma_open(void *cds_context, err_dbglog_init: qdf_wake_lock_destroy(&wma_handle->wmi_cmd_rsp_wake_lock); - qdf_runtime_lock_deinit(wma_handle->wmi_cmd_rsp_runtime_lock); + qdf_runtime_lock_deinit(&wma_handle->wmi_cmd_rsp_runtime_lock); qdf_spinlock_destroy(&wma_handle->vdev_respq_lock); qdf_spinlock_destroy(&wma_handle->wma_hold_req_q_lock); err_event_init: @@ -2407,7 +2405,7 @@ err_wma_handle: qdf_wake_lock_destroy(&wma_handle->wow_wake_lock); } - qdf_runtime_lock_deinit(wma_handle->wma_runtime_resume_lock); + qdf_runtime_lock_deinit(&wma_handle->wma_runtime_resume_lock); cds_free_context(cds_context, QDF_MODULE_ID_WMA, wma_handle); WMA_LOGD("%s: Exit", __func__); @@ -3545,7 +3543,7 @@ QDF_STATUS wma_close(void *cds_ctx) wma_cleanup_vdev_resp(wma_handle); wma_cleanup_hold_req(wma_handle); qdf_wake_lock_destroy(&wma_handle->wmi_cmd_rsp_wake_lock); - qdf_runtime_lock_deinit(wma_handle->wmi_cmd_rsp_runtime_lock); + qdf_runtime_lock_deinit(&wma_handle->wmi_cmd_rsp_runtime_lock); for (idx = 0; idx < wma_handle->num_mem_chunks; ++idx) { qdf_mem_free_consistent(wma_handle->qdf_dev, wma_handle->qdf_dev->dev, |
