From a53a423957a72af62f9cedccbddd8f6fb98ee987 Mon Sep 17 00:00:00 2001 From: Vevek Venkatesan Date: Thu, 8 Oct 2020 23:17:26 +0530 Subject: [PATCH] qcacld-3.0: fix the error in smmu_enable conditional check Fix the error in smmu_enable condition check for IPA Tx buffer and also add the flag to mark smmu map/unmap. Change-Id: I1a9b768c6f17a76b7a857367f342ffbe82e48379 CRs-Fixed: 2793156 --- core/dp/htt/htt_tx.c | 2 ++ core/dp/htt/htt_types.h | 1 + core/dp/txrx/ol_txrx_ipa.c | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/dp/htt/htt_tx.c b/core/dp/htt/htt_tx.c index 285b0c7ef799..370158055aa8 100644 --- a/core/dp/htt/htt_tx.c +++ b/core/dp/htt/htt_tx.c @@ -1379,6 +1379,8 @@ int htt_tx_ipa_uc_attach(struct htt_pdev_t *pdev, pdev->ipa_uc_tx_rsc.alloc_tx_buf_cnt = htt_tx_ipa_uc_wdi_tx_buf_alloc( pdev, uc_tx_buf_sz, uc_tx_buf_cnt, uc_tx_partition_base); + pdev->ipa_uc_tx_rsc.ipa_smmu_mapped = false; + return 0; diff --git a/core/dp/htt/htt_types.h b/core/dp/htt/htt_types.h index 386d8d968cb7..dc0951b5f2b3 100644 --- a/core/dp/htt/htt_types.h +++ b/core/dp/htt/htt_types.h @@ -123,6 +123,7 @@ struct htt_ipa_uc_tx_resource_t { uint32_t tx_comp_idx_paddr; qdf_shared_mem_t **tx_buf_pool_strg; uint32_t alloc_tx_buf_cnt; + bool ipa_smmu_mapped; }; /** diff --git a/core/dp/txrx/ol_txrx_ipa.c b/core/dp/txrx/ol_txrx_ipa.c index a9037b4ff7ac..f36bc4888235 100644 --- a/core/dp/txrx/ol_txrx_ipa.c +++ b/core/dp/txrx/ol_txrx_ipa.c @@ -295,7 +295,7 @@ static QDF_STATUS __ol_txrx_ipa_tx_buf_smmu_mapping(struct ol_txrx_pdev_t *pdev, return QDF_STATUS_E_FAILURE; } - if (qdf_mem_smmu_s1_enabled(htt_pdev->osdev)) { + if (!qdf_mem_smmu_s1_enabled(htt_pdev->osdev)) { ol_txrx_info("SMMU-S1 mapping is disabled"); return QDF_STATUS_SUCCESS; } @@ -320,6 +320,8 @@ static QDF_STATUS __ol_txrx_ipa_tx_buf_smmu_mapping(struct ol_txrx_pdev_t *pdev, ret = cds_smmu_map_unmap(create, unmap_cnt, mem_map_table); qdf_assert_always(!ret); qdf_mem_free(mem_map_table); + htt_pdev->ipa_uc_tx_rsc.ipa_smmu_mapped = create; + ol_txrx_info("smmu_map_unmap:%d of %d Tx buffers", create, unmap_cnt); return ret; }