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
This commit is contained in:
Dustin Brown
2017-03-10 11:06:25 -08:00
committed by Sandeep Puligilla
parent 5581285544
commit d5f1294562
3 changed files with 32 additions and 2 deletions

View File

@@ -1254,6 +1254,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

View File

@@ -813,6 +813,8 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
struct vdev_up_params param = {0};
QDF_STATUS status;
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) {
@@ -2094,8 +2096,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);
}
/**

View File

@@ -3976,6 +3976,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;