diff options
| author | Yun Park <yunp@codeaurora.org> | 2017-08-10 15:51:28 -0700 |
|---|---|---|
| committer | snandini <snandini@codeaurora.org> | 2017-08-13 15:47:53 -0700 |
| commit | 23c1fe440da49dbfb63e05a58bf4e5e07808d83d (patch) | |
| tree | 26a6583063a642ecb6bdc019508285a7b4a34824 | |
| parent | 928a3083cd44fa9f0393a0dd6f0bdef0610b4b0c (diff) | |
Revert "qcacld-3.0: Give SMMU mappings to IPA when IPA SMMU S1 enabled"
This reverts commit Ib1de285051b74a8e1a69be854b754921964785b7
Change-Id: I0c86c685ec406fba39ebc46ee38867b281be9de9
CRs-Fixed: 2091061
| -rw-r--r-- | core/dp/htt/htt_h2t.c | 2 | ||||
| -rw-r--r-- | core/dp/htt/htt_rx.c | 12 | ||||
| -rw-r--r-- | core/dp/htt/htt_tx.c | 78 |
3 files changed, 53 insertions, 39 deletions
diff --git a/core/dp/htt/htt_h2t.c b/core/dp/htt/htt_h2t.c index 83a08f48d790..bf825f6d4c6d 100644 --- a/core/dp/htt/htt_h2t.c +++ b/core/dp/htt/htt_h2t.c @@ -1249,7 +1249,7 @@ int htt_h2t_ipa_uc_set_active(struct htt_pdev_t *pdev, pkt->msdu_id = HTT_TX_COMPL_INV_MSDU_ID; pkt->pdev_ctxt = NULL; /* not used during send-done callback */ - if (uc_active && !is_tx) { + if (qdf_mem_smmu_s1_enabled(pdev->osdev) && uc_active && !is_tx) { if (htt_rx_ipa_uc_buf_pool_map(pdev)) { qdf_print("%s: Unable to create mapping for IPA rx buffers\n", __func__); diff --git a/core/dp/htt/htt_rx.c b/core/dp/htt/htt_rx.c index 0851cceca6c8..cbbd06ae8d21 100644 --- a/core/dp/htt/htt_rx.c +++ b/core/dp/htt/htt_rx.c @@ -446,7 +446,7 @@ static int htt_rx_ring_fill_n(struct htt_pdev_t *pdev, int num) int num_alloc = 0; idx = *(pdev->rx_ring.alloc_idx.vaddr); - if (pdev->uc_map_reqd) { + if (qdf_mem_smmu_s1_enabled(pdev->osdev) && pdev->uc_map_reqd) { mem_map_table = qdf_mem_map_table_alloc(num); if (!mem_map_table) { qdf_print("%s: Failed to allocate memory for mem map table\n", @@ -543,7 +543,7 @@ moretofill: pdev->rx_ring.buf.netbufs_ring[idx] = rx_netbuf; } - if (pdev->uc_map_reqd) { + if (qdf_mem_smmu_s1_enabled(pdev->osdev) && pdev->uc_map_reqd) { qdf_update_mem_map_table(pdev->osdev, mem_info, paddr, HTT_RX_BUF_SIZE); mem_info++; @@ -565,7 +565,7 @@ moretofill: } free_mem_map_table: - if (pdev->uc_map_reqd) { + if (qdf_mem_smmu_s1_enabled(pdev->osdev) && pdev->uc_map_reqd) { cds_smmu_map_unmap(true, num_alloc, mem_map_table); qdf_mem_free(mem_map_table); } @@ -2301,7 +2301,7 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev, /* Get the total number of MSDUs */ msdu_count = HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(*(msg_word + 1)); HTT_RX_CHECK_MSDU_COUNT(msdu_count); - if (pdev->uc_map_reqd) { + if (qdf_mem_smmu_s1_enabled(pdev->osdev) && pdev->uc_map_reqd) { mem_map_table = qdf_mem_map_table_alloc(msdu_count); if (!mem_map_table) { qdf_print("%s: Failed to allocate memory for mem map table\n", @@ -2334,7 +2334,7 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev, } while (msdu_count > 0) { - if (pdev->uc_map_reqd) { + if (qdf_mem_smmu_s1_enabled(pdev->osdev) && pdev->uc_map_reqd) { qdf_update_mem_map_table(pdev->osdev, mem_info, QDF_NBUF_CB_PADDR(msdu), HTT_RX_BUF_SIZE); @@ -2479,7 +2479,7 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev, } free_mem_map_table: - if (pdev->uc_map_reqd) { + if (qdf_mem_smmu_s1_enabled(pdev->osdev) && pdev->uc_map_reqd) { if (num_unmapped) cds_smmu_map_unmap(false, num_unmapped, mem_map_table); diff --git a/core/dp/htt/htt_tx.c b/core/dp/htt/htt_tx.c index eddeae6df704..9793beb29949 100644 --- a/core/dp/htt/htt_tx.c +++ b/core/dp/htt/htt_tx.c @@ -1075,13 +1075,15 @@ static int htt_tx_ipa_uc_wdi_tx_buf_alloc(struct htt_pdev_t *pdev, qdf_shared_mem_t *shared_tx_buffer; ring_vaddr = (qdf_dma_addr_t *)pdev->ipa_uc_tx_rsc.tx_comp_ring->vaddr; - mem_map_table = qdf_mem_map_table_alloc(uc_tx_buf_cnt); - if (!mem_map_table) { - qdf_print("%s: Failed to allocate memory for mem map table\n", - __func__); - return 0; + if (qdf_mem_smmu_s1_enabled(pdev->osdev)) { + mem_map_table = qdf_mem_map_table_alloc(uc_tx_buf_cnt); + if (!mem_map_table) { + qdf_print("%s: Failed to allocate memory for mem map table\n", + __func__); + return 0; + } + mem_info = mem_map_table; } - mem_info = mem_map_table; /* Allocate TX buffers as many as possible */ for (tx_buffer_count = 0; @@ -1137,10 +1139,12 @@ static int htt_tx_ipa_uc_wdi_tx_buf_alloc(struct htt_pdev_t *pdev, /* Memory barrier to ensure actual value updated */ ring_vaddr++; - qdf_update_mem_map_table(pdev->osdev, mem_info, - shared_tx_buffer->mem_info.iova, - uc_tx_buf_sz); - mem_info++; + if (qdf_mem_smmu_s1_enabled(pdev->osdev)) { + qdf_update_mem_map_table(pdev->osdev, mem_info, + shared_tx_buffer->mem_info.iova, + uc_tx_buf_sz); + mem_info++; + } } /* @@ -1168,9 +1172,11 @@ static int htt_tx_ipa_uc_wdi_tx_buf_alloc(struct htt_pdev_t *pdev, } free_mem_map_table: - cds_smmu_map_unmap(true, tx_buffer_count_pwr2, - mem_map_table); - qdf_mem_free(mem_map_table); + if (qdf_mem_smmu_s1_enabled(pdev->osdev)) { + cds_smmu_map_unmap(true, tx_buffer_count_pwr2, + mem_map_table); + qdf_mem_free(mem_map_table); + } return tx_buffer_count_pwr2; } @@ -1189,9 +1195,10 @@ static void htt_tx_buf_pool_free(struct htt_pdev_t *pdev) for (idx = 0; idx < pdev->ipa_uc_tx_rsc.alloc_tx_buf_cnt; idx++) { if (pdev->ipa_uc_tx_rsc.tx_buf_pool_strg[idx]) { - cds_smmu_map_unmap(false, 1, - &pdev->ipa_uc_tx_rsc.tx_buf_pool_strg[ - idx]->mem_info); + if (qdf_mem_smmu_s1_enabled(pdev->osdev)) + cds_smmu_map_unmap(false, 1, + &pdev->ipa_uc_tx_rsc.tx_buf_pool_strg[ + idx]->mem_info); qdf_mem_shared_mem_free(pdev->osdev, pdev->ipa_uc_tx_rsc. tx_buf_pool_strg[idx]); @@ -1215,13 +1222,15 @@ static int htt_tx_ipa_uc_wdi_tx_buf_alloc(struct htt_pdev_t *pdev, qdf_shared_mem_t *shared_tx_buffer; ring_vaddr = pdev->ipa_uc_tx_rsc.tx_comp_ring->vaddr; - mem_map_table = qdf_mem_map_table_alloc(uc_tx_buf_cnt); - if (!mem_map_table) { - qdf_print("%s: Failed to allocate memory for mem map table\n", - __func__); - return 0; + if (qdf_mem_smmu_s1_enabled(pdev->osdev)) { + mem_map_table = qdf_mem_map_table_alloc(uc_tx_buf_cnt); + if (!mem_map_table) { + qdf_print("%s: Failed to allocate memory for mem map table\n", + __func__); + return 0; + } + mem_info = mem_map_table; } - mem_info = mem_map_table; /* Allocate TX buffers as many as possible */ for (tx_buffer_count = 0; @@ -1266,10 +1275,12 @@ static int htt_tx_ipa_uc_wdi_tx_buf_alloc(struct htt_pdev_t *pdev, /* Memory barrier to ensure actual value updated */ ring_vaddr++; - qdf_update_mem_map_table(pdev->osdev, mem_info, - shared_tx_buffer->mem_info.iova, - uc_tx_buf_sz); - mem_info++; + if (qdf_mem_smmu_s1_enabled(pdev->osdev)) { + qdf_update_mem_map_table(pdev->osdev, mem_info, + shared_tx_buffer->mem_info.iova, + uc_tx_buf_sz); + mem_info++; + } } /* @@ -1297,9 +1308,11 @@ static int htt_tx_ipa_uc_wdi_tx_buf_alloc(struct htt_pdev_t *pdev, } free_mem_map_table: - cds_smmu_map_unmap(true, tx_buffer_count_pwr2, - mem_map_table); - qdf_mem_free(mem_map_table); + if (qdf_mem_smmu_s1_enabled(pdev->osdev)) { + cds_smmu_map_unmap(true, tx_buffer_count_pwr2, + mem_map_table); + qdf_mem_free(mem_map_table); + } return tx_buffer_count_pwr2; } @@ -1310,9 +1323,10 @@ static void htt_tx_buf_pool_free(struct htt_pdev_t *pdev) for (idx = 0; idx < pdev->ipa_uc_tx_rsc.alloc_tx_buf_cnt; idx++) { if (pdev->ipa_uc_tx_rsc.tx_buf_pool_strg[idx]) { - cds_smmu_map_unmap(false, 1, - &pdev->ipa_uc_tx_rsc.tx_buf_pool_strg[ - idx]->mem_info); + if (qdf_mem_smmu_s1_enabled(pdev->osdev)) + cds_smmu_map_unmap(false, 1, + &pdev->ipa_uc_tx_rsc.tx_buf_pool_strg[ + idx]->mem_info); qdf_mem_shared_mem_free(pdev->osdev, pdev->ipa_uc_tx_rsc. tx_buf_pool_strg[idx]); |
