From d6b3fee9b3f1a301406b72ca702f3b3f4e478bb7 Mon Sep 17 00:00:00 2001 From: Sourav Mohapatra Date: Tue, 28 Jan 2020 13:24:47 +0530 Subject: [PATCH] qcacmn: Rectify fetching PDEV before creation In the change I0165f3bd4638280b45ad54391319806fba62e2fe, driver tries to fetch the PDEV in init_deinit_handler before it is created in MCC. This can cause driver init to fail. Move the fetching of the PDEV to after the PDEV is created. Change-Id: I028ac14da333084ce68f03f3d3771cdb6298933b CRs-Fixed: 2611379 --- .../init_deinit/src/init_event_handler.c | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/target_if/init_deinit/src/init_event_handler.c b/target_if/init_deinit/src/init_event_handler.c index 4bd8444ba8c7..e5037c0c72e1 100644 --- a/target_if/init_deinit/src/init_event_handler.c +++ b/target_if/init_deinit/src/init_event_handler.c @@ -466,6 +466,21 @@ static int init_deinit_ready_event_handler(ol_scn_t scn_handle, else info->wlan_res_cfg.agile_capability = ready_ev.agile_capability; + /* Indicate to the waiting thread that the ready + * event was received + */ + info->wlan_init_status = wmi_ready_extract_init_status( + wmi_handle, event); + + legacy_callback = target_if_get_psoc_legacy_service_ready_cb(); + if (legacy_callback) + if (legacy_callback(wmi_ready_event_id, + scn_handle, event, data_len)) { + target_if_err("Legacy callback returned error!"); + tgt_hdl->info.wmi_ready = FALSE; + goto exit; + } + num_radios = target_psoc_get_num_radios(tgt_hdl); if ((ready_ev.num_total_peer != 0) && @@ -513,20 +528,6 @@ static int init_deinit_ready_event_handler(ol_scn_t scn_handle, } } - /* Indicate to the waiting thread that the ready - * event was received - */ - info->wlan_init_status = wmi_ready_extract_init_status( - wmi_handle, event); - - legacy_callback = target_if_get_psoc_legacy_service_ready_cb(); - if (legacy_callback) - if (legacy_callback(wmi_ready_event_id, - scn_handle, event, data_len)) { - target_if_err("Legacy callback returned error!"); - tgt_hdl->info.wmi_ready = FALSE; - goto exit; - } if (ready_ev.pktlog_defs_checksum) { for (i = 0; i < num_radios; i++) {