From adb3b9f91d6cac35aa01736ea160c26de4f4584f Mon Sep 17 00:00:00 2001 From: Yeshwanth Sriram Guntuka Date: Mon, 15 Nov 2021 13:03:49 +0530 Subject: [PATCH] qcacmn: Update ipa_enabled config during cfg_soc_attach ipa_enabled cfg parameter is updated in DP post soc_attach and soc_init and the default value of ipa_enabled in soc cfg context is 0. ipa_enabled cfg is used in soc_attach and soc_init for tx and tx completion ring configurations and could potentially cause issues when ipa is enabled. Fix is to update ipa_enabled config as part of dp soc ipa_config_attach. Change-Id: Ia797d8feed8aff619b0f7f63ba7ec5823c82458c CRs-Fixed: 3075076 --- wlan_cfg/wlan_cfg.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index 862277f1ba..1639d51ff3 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -1596,6 +1596,8 @@ void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, #endif #ifdef IPA_OFFLOAD + +#define WLAN_CFG_IPA_ENABLE_MASK BIT(0) #ifdef IPA_WDI3_TX_TWO_PIPES /** * wlan_soc_ipa_cfg_attach() - Update ipa tx and tx alt config @@ -1609,6 +1611,8 @@ static void wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) { + wlan_cfg_ctx->ipa_enabled = (cfg_get(psoc, CFG_DP_IPA_OFFLOAD_CONFIG) & + WLAN_CFG_IPA_ENABLE_MASK); wlan_cfg_ctx->ipa_tx_ring_size = cfg_get(psoc, CFG_DP_IPA_TX_RING_SIZE); wlan_cfg_ctx->ipa_tx_comp_ring_size = @@ -1631,6 +1635,8 @@ static void wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) { + wlan_cfg_ctx->ipa_enabled = (cfg_get(psoc, CFG_DP_IPA_OFFLOAD_CONFIG) & + WLAN_CFG_IPA_ENABLE_MASK); wlan_cfg_ctx->ipa_tx_ring_size = cfg_get(psoc, CFG_DP_IPA_TX_RING_SIZE); wlan_cfg_ctx->ipa_tx_comp_ring_size = @@ -2232,7 +2238,7 @@ int wlan_cfg_num_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg) int wlan_cfg_num_nss_tcl_data_rings(struct wlan_cfg_dp_soc_ctxt *cfg) { if (!cfg->ipa_enabled) - return cfg->num_tcl_data_rings; + return cfg->num_nss_tcl_data_rings; return 1; }