summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVevek Venkatesan <vevekv@codeaurora.org>2019-11-28 17:51:42 +0530
committerVevek Venkatesan <vevekv@codeaurora.org>2019-11-28 19:48:20 +0530
commit38c2a74667500b3974dfb659dbee3c8bb6096f56 (patch)
tree307cf3bd389a5ea30dd33d39f47aaa613cf46611
parent007e63ee934c2123334fa01bf2a576d3e3c5eb8a (diff)
qcacld-3.0: setup IPA sys pipes if ipa_wdi_init succeeds
At present, IPA sys pipes setup done before ipa_wdi_init, so chances for IPA uC is not yet up and running. As wdi init succeeds only if uC is up and running, setting up IPA sys pipes after ipa_wdi_init succeeds. Change-Id: Iee9783b0238a3bc96a2e73e47ffebf3b44623485 CRs-Fixed: 2573929
-rw-r--r--core/hdd/src/wlan_hdd_ipa.c42
1 files changed, 29 insertions, 13 deletions
diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c
index d582e6ba8fc3..f2275fc5e09f 100644
--- a/core/hdd/src/wlan_hdd_ipa.c
+++ b/core/hdd/src/wlan_hdd_ipa.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -658,6 +658,7 @@ static int hdd_ipa_uc_enable_pipes(struct hdd_ipa_priv *hdd_ipa);
static int hdd_ipa_wdi_init(struct hdd_ipa_priv *hdd_ipa);
static void hdd_ipa_send_pkt_to_tl(struct hdd_ipa_iface_context *iface_context,
struct ipa_rx_data *ipa_tx_desc);
+static int hdd_ipa_setup_sys_pipe(struct hdd_ipa_priv *hdd_ipa);
/**
* hdd_ipa_uc_get_db_paddr() - Get Doorbell physical address
@@ -4062,6 +4063,19 @@ static void hdd_ipa_uc_loaded_handler(struct hdd_ipa_priv *ipa_ctxt)
return;
}
+ /* Setup IPA sys_pipe for MCC */
+ if (hdd_ipa_uc_sta_is_enabled(ipa_ctxt->hdd_ctx)) {
+ ret = hdd_ipa_setup_sys_pipe(ipa_ctxt);
+ if (ret) {
+ HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
+ "ipa sys pipes setup failed ret=%d", ret);
+ return;
+ }
+
+ INIT_WORK(&ipa_ctxt->mcc_work,
+ hdd_ipa_mcc_work_handler);
+ }
+
/* Connect pipe */
ret = hdd_ipa_wdi_conn_pipes(ipa_ctxt, ipa_res);
if (ret) {
@@ -7503,14 +7517,6 @@ static QDF_STATUS __hdd_ipa_init(hdd_context_t *hdd_ctx)
hdd_ipa->sta_connected = 0;
hdd_ipa->ipa_pipes_down = true;
hdd_ipa->wdi_enabled = false;
- /* Setup IPA sys_pipe for MCC */
- if (hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx)) {
- ret = hdd_ipa_setup_sys_pipe(hdd_ipa);
- if (ret)
- goto fail_create_sys_pipe;
-
- INIT_WORK(&hdd_ipa->mcc_work, hdd_ipa_mcc_work_handler);
- }
ret = hdd_ipa_wdi_init(hdd_ipa);
if (ret) {
@@ -7518,15 +7524,25 @@ static QDF_STATUS __hdd_ipa_init(hdd_context_t *hdd_ctx)
"ipa wdi init failed ret=%d", ret);
if (ret == -EACCES) {
if (hdd_ipa_uc_send_wdi_control_msg(false))
- goto fail_create_sys_pipe;
+ goto ipa_wdi_destroy;
} else {
- goto fail_create_sys_pipe;
+ goto ipa_wdi_destroy;
+ }
+ } else {
+ /* Setup IPA sys_pipe for MCC */
+ if (hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx)) {
+ ret = hdd_ipa_setup_sys_pipe(hdd_ipa);
+ if (ret)
+ goto ipa_wdi_destroy;
+
+ INIT_WORK(&hdd_ipa->mcc_work,
+ hdd_ipa_mcc_work_handler);
}
}
} else {
ret = hdd_ipa_setup_sys_pipe(hdd_ipa);
if (ret)
- goto fail_create_sys_pipe;
+ goto ipa_wdi_destroy;
}
init_completion(&hdd_ipa->ipa_resource_comp);
@@ -7534,7 +7550,7 @@ static QDF_STATUS __hdd_ipa_init(hdd_context_t *hdd_ctx)
HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "exit: success");
return QDF_STATUS_SUCCESS;
-fail_create_sys_pipe:
+ipa_wdi_destroy:
hdd_ipa_wdi_destroy_rm(hdd_ipa);
fail_setup_rm:
qdf_spinlock_destroy(&hdd_ipa->pm_lock);