qcacld-3.0: Check for wmi_ready before processing wmi messages

If wmi_ready is not set, we can infer that WMI_READY_EVENTID has not
been fully processed yet. Completion of WMI_READY_EVENTID is necessary
for any follow-on messages to be processed properly, since it builds
infrastructure on host. Therefore, serialize the follow-on message with
WMI_READY_EVENT if wmi_ready is not set yet.

CRs-Fixed: 2267180
Change-Id: I2e5df318f8e40a9487502a49539252c9fde9892b
This commit is contained in:
Amar Singhal 2018-06-26 15:09:58 -07:00 • committed by nshrivas
commit 4228c39d30

View file

@ -1757,17 +1757,47 @@ static int wma_process_fw_event_mc_thread_ctx(void *ctx, void *ev)
*
* Return: 0 on success, errno on failure
*/
int wma_process_fw_event_handler(void *ctx, void *ev, uint8_t rx_ctx)
int wma_process_fw_event_handler(void *ctx, void *htc_packet, uint8_t rx_ctx)
{
int err = 0;
ol_scn_t scn_handle;
struct wlan_objmgr_psoc *psoc;
struct target_psoc_info *tgt_hdl;
wmi_buf_t evt_buf;
bool is_wmi_ready = false;
evt_buf = (wmi_buf_t) ((HTC_PACKET *)htc_packet)->pPktContext;
scn_handle = ((wmi_unified_t)ctx)->scn_handle;
psoc = target_if_get_psoc_from_scn_hdl(scn_handle);
if (!psoc) {
WMA_LOGE("psoc is null");
return err;
}
tgt_hdl = (struct target_psoc_info *)wlan_psoc_get_tgt_if_handle(
psoc);
if (!tgt_hdl) {
WMA_LOGE("target_psoc_info is null");
return err;
}
is_wmi_ready = target_psoc_get_wmi_ready(tgt_hdl);
if (!is_wmi_ready) {
WMA_LOGW("wmi event recvd before wmi_ready_event is fully processed");
WMA_LOGW("therefore use worker thread");
wmi_process_fw_event_worker_thread_ctx(ctx, htc_packet);
return err;
}
if (rx_ctx == WMA_RX_SERIALIZER_CTX) {
err = wma_process_fw_event_mc_thread_ctx(ctx, ev);
err = wma_process_fw_event_mc_thread_ctx(ctx, evt_buf);
} else if (rx_ctx == WMA_RX_TASKLET_CTX) {
wma_process_fw_event_tasklet_ctx(ctx, ev);
wma_process_fw_event_tasklet_ctx(ctx, evt_buf);
} else {
WMA_LOGE("%s: invalid wmi event execution context", __func__);
qdf_nbuf_free(ev);
qdf_nbuf_free(evt_buf);
}
return err;