From bd4a9fe637c0db0b64fdc6fc316b0ca7f44cf909 Mon Sep 17 00:00:00 2001 From: Jianmin Zhu Date: Tue, 19 May 2020 19:55:31 +0800 Subject: [PATCH] qcacmn: Handle WMI_REG_CHAN_LIST_CC_EVENTID in worker thread Somtimes F/W event WMI_REG_CHAN_LIST_CC_EVENTID comes for country code changed before WMI_READY_EVENTID processed completely in worker thread, to update current channel list, hdd_regulatory_dyn_cbk is invoked in scheduler thread and wiphy is extracted from pdev which isn't attached to pdev yet, assert will happen. WMI_READY_EVENTID and WMI_REG_CHAN_LIST_CC_EVENTID should be serialized, both of them should be handled in same context, such as worker thread. Set WMI_REG_CHAN_LIST_CC_EVENTID execution context same as WMI_READY_EVENTID: WMI_RX_WORK_CTX. Host F/W handshake during init: Host <- FW WMI_SERVICE_READY_EVENTID Host <- FW WMI_SERVICE_READY_EXT_EVENTID Host -> FW WMI_INIT_CMDID Host <- FW WMI_REG_CHAN_LIST_CC_EVENTID Host -> FW WMI_SET_CURRENT_COUNTRY_CMDID Host <- FW WMI_READY_EVENTID Host <- FW WMI_REG_CHAN_LIST_CC_EVENTID Change-Id: I922e5f2a9722e9b441cc844dd38b1039dd4d8900 CRs-Fixed: 2689274 --- target_if/regulatory/src/target_if_reg.c | 2 +- wmi/src/wmi_unified.c | 25 ------------------------ 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/target_if/regulatory/src/target_if_reg.c b/target_if/regulatory/src/target_if_reg.c index 8c6083d41c..95f59186a1 100644 --- a/target_if/regulatory/src/target_if_reg.c +++ b/target_if/regulatory/src/target_if_reg.c @@ -265,7 +265,7 @@ static QDF_STATUS tgt_if_regulatory_register_master_list_handler( return wmi_unified_register_event_handler( wmi_handle, wmi_reg_chan_list_cc_event_id, - tgt_reg_chan_list_update_handler, WMI_RX_UMAC_CTX); + tgt_reg_chan_list_update_handler, WMI_RX_WORK_CTX); } /** diff --git a/wmi/src/wmi_unified.c b/wmi/src/wmi_unified.c index e12692b80a..bee2bbfd34 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -2122,31 +2122,6 @@ wmi_process_fw_event_sched_thread_ctx(struct wmi_unified *wmi, struct wmi_process_fw_event_params *params_buf; struct scheduler_msg msg = { 0 }; uint32_t event_id; - struct target_psoc_info *tgt_hdl; - bool is_wmi_ready = false; - struct wlan_objmgr_psoc *psoc; - - psoc = target_if_get_psoc_from_scn_hdl(wmi->scn_handle); - if (!psoc) { - target_if_err("psoc is null"); - qdf_nbuf_free(ev); - return QDF_STATUS_E_INVAL; - } - - tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc); - if (!tgt_hdl) { - wmi_err("target_psoc_info is null"); - qdf_nbuf_free(ev); - return QDF_STATUS_E_INVAL; - } - - is_wmi_ready = target_psoc_get_wmi_ready(tgt_hdl); - if (!is_wmi_ready) { - wmi_debug("fw event recvd before ready event processed"); - wmi_debug("therefore use worker thread"); - wmi_process_fw_event_worker_thread_ctx(wmi, ev); - return QDF_STATUS_E_INVAL; - } params_buf = qdf_mem_malloc(sizeof(struct wmi_process_fw_event_params)); if (!params_buf) {