summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManikandan Mohan <manikand@codeaurora.org>2017-02-09 11:26:53 -0800
committerqcabuildsw <qcabuildsw@localhost>2017-02-12 18:31:42 -0800
commita8bf9ca579bdcb62b9ff86a7f2cc3e2c3091942a (patch)
treef232ef3c31e6b0faa11665c3d33bd01446f717e7
parent23f08ae961c2b016cc7d9a4e312bb987248b606a (diff)
qcacld-3.0: Update IPA resource info at reconfiguration
IPA resource information allocated during cds_open must be updated to IPA HW before configuring to FW in cds_enable. Thus remove IPA HW configuration from HDD IPA init function to do this action at every reconfiguration. CRs-fixed: 2004133 Change-Id: I8761c06c1e84b68addbdcddccb4c652166c4c306
-rw-r--r--core/hdd/inc/wlan_hdd_ipa.h12
-rw-r--r--core/hdd/src/wlan_hdd_ipa.c53
-rw-r--r--core/hdd/src/wlan_hdd_main.c17
3 files changed, 38 insertions, 44 deletions
diff --git a/core/hdd/inc/wlan_hdd_ipa.h b/core/hdd/inc/wlan_hdd_ipa.h
index 9537ac0cedd3..9c94628a2b60 100644
--- a/core/hdd/inc/wlan_hdd_ipa.h
+++ b/core/hdd/inc/wlan_hdd_ipa.h
@@ -120,6 +120,7 @@ struct sk_buff *hdd_ipa_tx_packet_ipa(hdd_context_t *hdd_ctx,
struct sk_buff *skb, uint8_t session_id);
bool hdd_ipa_is_present(hdd_context_t *hdd_ctx);
void hdd_ipa_dump_info(hdd_context_t *hdd_ctx);
+QDF_STATUS hdd_ipa_uc_ol_init(hdd_context_t *hdd_ctx);
#else
static inline QDF_STATUS hdd_ipa_init(hdd_context_t *hdd_ctx)
{
@@ -248,5 +249,16 @@ bool hdd_ipa_is_present(hdd_context_t *hdd_ctx)
{
return false;
}
+
+/**
+ * hdd_ipa_uc_ol_init() - Initialize IPA uC offload
+ * @hdd_ctx: Global HDD context
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS hdd_ipa_uc_ol_init(hdd_context_t *hdd_ctx)
+{
+ return QDF_STATUS_SUCCESS;
+}
#endif /* IPA_OFFLOAD */
#endif /* #ifndef HDD_IPA_H__ */
diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c
index 66d6f5cc8813..ad49b88fc122 100644
--- a/core/hdd/src/wlan_hdd_ipa.c
+++ b/core/hdd/src/wlan_hdd_ipa.c
@@ -2642,7 +2642,7 @@ static void hdd_ipa_init_metering(struct hdd_ipa_priv *ipa_ctxt,
*
* Return: QDF_STATUS
*/
-static QDF_STATUS hdd_ipa_uc_ol_init(hdd_context_t *hdd_ctx)
+QDF_STATUS hdd_ipa_uc_ol_init(hdd_context_t *hdd_ctx)
{
struct ipa_wdi_in_params pipe_in;
struct ipa_wdi_out_params pipe_out;
@@ -2660,7 +2660,16 @@ static QDF_STATUS hdd_ipa_uc_ol_init(hdd_context_t *hdd_ctx)
stat = QDF_STATUS_E_FAILURE;
goto fail_return;
}
-
+ ol_txrx_ipa_uc_get_resource(pdev, &ipa_ctxt->ipa_resource);
+ if ((ipa_ctxt->ipa_resource.ce_sr_base_paddr == 0) ||
+ (ipa_ctxt->ipa_resource.tx_comp_ring_base_paddr == 0) ||
+ (ipa_ctxt->ipa_resource.rx_rdy_ring_base_paddr == 0) ||
+ (ipa_ctxt->ipa_resource.rx2_rdy_ring_base_paddr == 0)) {
+ HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL,
+ "IPA UC resource alloc fail");
+ stat = QDF_STATUS_E_FAILURE;
+ goto fail_return;
+ }
qdf_mem_zero(&ipa_ctxt->cons_pipe_in, sizeof(struct ipa_wdi_in_params));
qdf_mem_zero(&ipa_ctxt->prod_pipe_in, sizeof(struct ipa_wdi_in_params));
qdf_mem_zero(&pipe_in, sizeof(struct ipa_wdi_in_params));
@@ -3147,29 +3156,10 @@ static int __hdd_ipa_uc_ssr_reinit(hdd_context_t *hdd_ctx)
struct hdd_ipa_priv *hdd_ipa = ghdd_ipa;
int i;
struct hdd_ipa_iface_context *iface_context = NULL;
- struct ol_txrx_pdev_t *pdev = NULL;
if (!hdd_ipa || !hdd_ipa_uc_is_enabled(hdd_ctx))
return 0;
- pdev = cds_get_context(QDF_MODULE_ID_TXRX);
- if (!pdev) {
- HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "pdev is NULL");
- return -EINVAL;
- }
- HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "dbg2");
-
- ol_txrx_ipa_uc_get_resource(pdev, &hdd_ipa->ipa_resource);
- if ((hdd_ipa->ipa_resource.ce_sr_base_paddr == 0) ||
- (hdd_ipa->ipa_resource.tx_comp_ring_base_paddr == 0) ||
- (hdd_ipa->ipa_resource.rx_rdy_ring_base_paddr == 0) ||
- (hdd_ipa->ipa_resource.rx2_rdy_ring_base_paddr == 0)) {
- HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL,
- "IPA UC resource alloc fail");
- return -EINVAL;
- }
- HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "dbg2");
-
/* Create the interface context */
for (i = 0; i < HDD_IPA_MAX_IFACE; i++) {
iface_context = &hdd_ipa->iface_context[i];
@@ -3192,13 +3182,6 @@ static int __hdd_ipa_uc_ssr_reinit(hdd_context_t *hdd_ctx)
hdd_ipa->sta_connected = 0;
hdd_ipa->ipa_pipes_down = true;
hdd_ipa->uc_loaded = true;
-
- if (hdd_ipa_uc_ol_init(hdd_ctx)) {
- HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL,
- "Failed to setup pipes");
- return -EINVAL;
- }
-
}
return 0;
@@ -5809,15 +5792,6 @@ static QDF_STATUS __hdd_ipa_init(hdd_context_t *hdd_ctx)
ghdd_ipa = hdd_ipa;
hdd_ipa->hdd_ctx = hdd_ctx;
hdd_ipa->num_iface = 0;
- ol_txrx_ipa_uc_get_resource(pdev, &hdd_ipa->ipa_resource);
- if ((0 == hdd_ipa->ipa_resource.ce_sr_base_paddr) ||
- (0 == hdd_ipa->ipa_resource.tx_comp_ring_base_paddr) ||
- (0 == hdd_ipa->ipa_resource.rx_rdy_ring_base_paddr) ||
- (0 == hdd_ipa->ipa_resource.rx2_rdy_ring_base_paddr)) {
- HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL,
- "IPA UC resource alloc fail");
- goto fail_get_resource;
- }
/* Create the interface context */
for (i = 0; i < HDD_IPA_MAX_IFACE; i++) {
@@ -5866,8 +5840,6 @@ static QDF_STATUS __hdd_ipa_init(hdd_context_t *hdd_ctx)
if (hdd_ipa_uc_register_uc_ready(hdd_ipa))
goto fail_create_sys_pipe;
- if (hdd_ipa_uc_ol_init(hdd_ctx))
- goto fail_ol_init;
} else {
ret = hdd_ipa_setup_sys_pipe(hdd_ipa);
if (ret)
@@ -5877,13 +5849,10 @@ static QDF_STATUS __hdd_ipa_init(hdd_context_t *hdd_ctx)
EXIT();
return QDF_STATUS_SUCCESS;
-fail_ol_init:
- hdd_ipa_teardown_sys_pipe(hdd_ipa);
fail_create_sys_pipe:
hdd_ipa_destroy_rm_resource(hdd_ipa);
fail_setup_rm:
qdf_spinlock_destroy(&hdd_ipa->pm_lock);
-fail_get_resource:
qdf_mem_free(hdd_ipa);
hdd_ctx->hdd_ipa = NULL;
ghdd_ipa = NULL;
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 71e9ab277871..02e77cc87a7e 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -1841,8 +1841,10 @@ int hdd_wlan_start_modules(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter,
}
if (reinit) {
- if (hdd_ipa_uc_ssr_reinit(hdd_ctx))
- hdd_err("HDD IPA UC reinit failed");
+ if (hdd_ipa_uc_ssr_reinit(hdd_ctx)) {
+ hdd_err("HDD IPA UC reinit failed");
+ goto close;
+ }
}
/* Fall through dont add break here */
@@ -7998,6 +8000,17 @@ int hdd_configure_cds(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter)
goto out;
}
+ /* Always get latest IPA resources allocated from cds_open and configure
+ * IPA module before configuring them to FW. Sequence required as crash
+ * observed otherwise.
+ */
+ if (hdd_ipa_uc_is_enabled(hdd_ctx)) {
+ if (hdd_ipa_uc_ol_init(hdd_ctx)) {
+ hdd_err("Failed to setup pipes");
+ goto out;
+ }
+ }
+
/*
* Start CDS which starts up the SME/MAC/HAL modules and everything
* else