Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4dc423a1 authored by Jianmin Zhu's avatar Jianmin Zhu Committed by nshrivas
Browse files

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
parent bb879c92
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -247,7 +247,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);
}

/**
+0 −25
Original line number Diff line number Diff line
@@ -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) {