summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDustin Brown <dustinb@codeaurora.org>2017-03-10 11:06:25 -0800
committerSandeep Puligilla <spuligil@codeaurora.org>2017-03-12 22:59:07 -0700
commit4c8fed8fe13a6352b0d2112c92f05df047c3ded2 (patch)
treede5b0da11d2669ec11c08e3b9091c08af826a454
parent35de732734e99a54bdae579c1770dd8ea4c883a7 (diff)
qcacld-3.0: Acquire wakelock before sending VDEV_START
The host driver should not attempt to power collapse while pending VDEV_START commands are in flight. Acquire a wakelock before sending a VDEV_START request to firmware, and release it upon receipt of VDEV_START response. Change-Id: Iccca8ce4213b7527421f6b93fc4e08be9c31f471 CRs-Fixed: 2018066
-rw-r--r--core/wma/inc/wma_internal.h16
-rw-r--r--core/wma/src/wma_dev_if.c13
-rw-r--r--core/wma/src/wma_utils.c13
3 files changed, 35 insertions, 7 deletions
diff --git a/core/wma/inc/wma_internal.h b/core/wma/inc/wma_internal.h
index 381338f822a2..ee3454b40eb7 100644
--- a/core/wma/inc/wma_internal.h
+++ b/core/wma/inc/wma_internal.h
@@ -1318,6 +1318,22 @@ void wma_acquire_wmi_resp_wakelock(t_wma_handle *wma, uint32_t msec);
void wma_release_wmi_resp_wakelock(t_wma_handle *wma);
/**
+ * wma_send_vdev_start_to_fw() - send the vdev start command to firmware
+ * @wma: the WMA handle containing a reference to the wmi_handle to use
+ * @params: the VDEV_START params to send to firmware
+ *
+ * This is a helper function that acquires the WMI response wakelock before
+ * sending down the VDEV_START command to firmware. This wakelock is
+ * automatically released on failure. Consumers should call
+ * wma_release_wmi_resp_wakelock() upon receipt of the VDEV_START response from
+ * firmware, to avoid power penalties.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+wma_send_vdev_start_to_fw(t_wma_handle *wma, struct vdev_start_params *params);
+
+/**
* wma_send_vdev_stop_to_fw() - send the vdev stop command to firmware
* @wma: the WMA handle containing a reference to the wmi_handle to use
* @vdev_id: the VDEV Id of the VDEV to stop
diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c
index 0a0c293bdf44..ae9caaa04675 100644
--- a/core/wma/src/wma_dev_if.c
+++ b/core/wma/src/wma_dev_if.c
@@ -858,6 +858,8 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
int err;
wmi_channel_width chanwidth;
+ wma_release_wmi_resp_wakelock(wma);
+
#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
tpAniSirGlobal mac_ctx = cds_get_context(QDF_MODULE_ID_PE);
if (NULL == mac_ctx) {
@@ -1478,6 +1480,9 @@ int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
uint8_t peer_id;
struct wma_txrx_node *iface;
int32_t status = 0;
+
+ wma_release_wmi_resp_wakelock(wma);
+
#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
tpAniSirGlobal mac_ctx = cds_get_context(QDF_MODULE_ID_PE);
if (NULL == mac_ctx) {
@@ -1513,7 +1518,6 @@ int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
return -EINVAL;
}
- wma_release_wmi_resp_wakelock(wma);
wma_hidden_ssid_vdev_restart_on_vdev_stop(wma,
resp_event->vdev_id);
}
@@ -1540,8 +1544,6 @@ int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
(tpDeleteBssParams) req_msg->user_data;
struct beacon_info *bcn;
- wma_release_wmi_resp_wakelock(wma);
-
if (resp_event->vdev_id > wma->max_bssid) {
WMA_LOGE("%s: Invalid vdev_id %d", __func__,
resp_event->vdev_id);
@@ -1643,8 +1645,6 @@ int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
tpLinkStateParams params =
(tpLinkStateParams) req_msg->user_data;
- wma_release_wmi_resp_wakelock(wma);
-
peer = ol_txrx_find_peer_by_addr(pdev, params->bssid, &peer_id);
if (peer) {
WMA_LOGE(FL("Deleting peer %pM vdev id %d"),
@@ -2219,8 +2219,7 @@ QDF_STATUS wma_vdev_start(tp_wma_handle wma,
wma->interfaces[params.vdev_id].pause_bitmap = 0;
}
- return wmi_unified_vdev_start_send(wma->wmi_handle, &params);
-
+ return wma_send_vdev_start_to_fw(wma, &params);
}
/**
diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c
index d65d62592eec..bcada8672ad8 100644
--- a/core/wma/src/wma_utils.c
+++ b/core/wma/src/wma_utils.c
@@ -4399,6 +4399,19 @@ void wma_release_wmi_resp_wakelock(t_wma_handle *wma)
qdf_runtime_pm_allow_suspend(&wma->wmi_cmd_rsp_runtime_lock);
}
+QDF_STATUS
+wma_send_vdev_start_to_fw(t_wma_handle *wma, struct vdev_start_params *params)
+{
+ QDF_STATUS status;
+
+ wma_acquire_wmi_resp_wakelock(wma, WMA_VDEV_START_REQUEST_TIMEOUT);
+ status = wmi_unified_vdev_start_send(wma->wmi_handle, params);
+ if (QDF_IS_STATUS_ERROR(status))
+ wma_release_wmi_resp_wakelock(wma);
+
+ return status;
+}
+
QDF_STATUS wma_send_vdev_stop_to_fw(t_wma_handle *wma, uint8_t vdev_id)
{
QDF_STATUS status;