qcacmn: Handle ipa_mapped flag correctly to prevent race

Currently soc->ipa_mapped flag is set to true only after all
the buffers are SMMU mapped to IPA. This leads to a race
window where Rx buffers routed to WLAN HOST in the replenish
path are not mapped to IPA, as the ipa_mapped flag is still
set to 0. The fix is to set the ipa_mapped flag to 1, right when
the IPA pipes are enabled, before waiting for the complete
buffer pool to be IPA SMMU mapped.
With this fix, RX buffers can be unmapped and mapped to IPA
domain in dp_pdev_rx_buffers_attach() and
dp_pdev_nbuf_alloc_and_map_replenish() in WLAN host RX path when
ipa pipes are enabled.

This change also renames ipa_mapped flag to ipa_map_allowed.

Change-Id: Ibbe50cb211f858a3372e31644df2f5e98f99a292
CRs-Fixed: 3569745
此提交包含在:
Namita Nair
2023-07-20 15:31:59 -07:00
提交者 Rahul Choudhary
父節點 1f2104b733
當前提交 8de279eab8
共有 7 個檔案被更改,包括 41 行新增37 行删除

查看文件

@@ -365,11 +365,10 @@ dp_pdev_nbuf_alloc_and_map_replenish(struct dp_soc *dp_soc,
nbuf_frag_info_t->paddr =
qdf_nbuf_get_frag_paddr((nbuf_frag_info_t->virt_addr).nbuf, 0);
if (qdf_atomic_read(&dp_soc->ipa_mapped))
dp_ipa_handle_rx_buf_smmu_mapping(dp_soc, (qdf_nbuf_t)(
(nbuf_frag_info_t->virt_addr).nbuf),
rx_desc_pool->buf_size,
true, __func__, __LINE__);
dp_ipa_handle_rx_buf_smmu_mapping(dp_soc, (qdf_nbuf_t)(
(nbuf_frag_info_t->virt_addr).nbuf),
rx_desc_pool->buf_size,
true, __func__, __LINE__);
ret = dp_check_paddr(dp_soc, &((nbuf_frag_info_t->virt_addr).nbuf),
&nbuf_frag_info_t->paddr,
@@ -3190,8 +3189,7 @@ dp_pdev_rx_buffers_attach(struct dp_soc *dp_soc, uint32_t mac_id,
desc_list->rx_desc.cookie,
rx_desc_pool->owner);
if (qdf_atomic_read(&dp_soc->ipa_mapped))
dp_ipa_handle_rx_buf_smmu_mapping(
dp_ipa_handle_rx_buf_smmu_mapping(
dp_soc, nbuf,
rx_desc_pool->buf_size, true,
__func__, __LINE__);