qcacmn: add API to do IPA Tx buf smmu_unmapping for Hastings
Add API to do IPA Tx buf SMMU-S1 unmapping and register it with cdp ops for Hastings, also assert if map/unmap failed. Change-Id: I4071b5fccd84c3c97b9dccc40c6f798d70993189 CRs-Fixed: 2792170
This commit is contained in:

committed by
snandini

parent
e2ec5b2d46
commit
3970f133ee
@@ -106,11 +106,9 @@ static QDF_STATUS __dp_ipa_handle_buf_smmu_mapping(struct dp_soc *soc,
|
|||||||
size);
|
size);
|
||||||
|
|
||||||
if (create)
|
if (create)
|
||||||
qdf_ipa_wdi_create_smmu_mapping(1, &mem_map_table);
|
return qdf_ipa_wdi_create_smmu_mapping(1, &mem_map_table);
|
||||||
else
|
else
|
||||||
qdf_ipa_wdi_release_smmu_mapping(1, &mem_map_table);
|
return qdf_ipa_wdi_release_smmu_mapping(1, &mem_map_table);
|
||||||
|
|
||||||
return QDF_STATUS_SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QDF_STATUS dp_ipa_handle_rx_buf_smmu_mapping(struct dp_soc *soc,
|
QDF_STATUS dp_ipa_handle_rx_buf_smmu_mapping(struct dp_soc *soc,
|
||||||
@@ -169,6 +167,11 @@ static QDF_STATUS __dp_ipa_tx_buf_smmu_mapping(
|
|||||||
qdf_nbuf_t nbuf;
|
qdf_nbuf_t nbuf;
|
||||||
uint32_t buf_len;
|
uint32_t buf_len;
|
||||||
|
|
||||||
|
if (!ipa_is_ready()) {
|
||||||
|
dp_info("IPA is not READY");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
for (index = 0; index < tx_buffer_cnt; index++) {
|
for (index = 0; index < tx_buffer_cnt; index++) {
|
||||||
nbuf = (qdf_nbuf_t)
|
nbuf = (qdf_nbuf_t)
|
||||||
soc->ipa_uc_tx_rsc.tx_buf_pool_vaddr_unaligned[index];
|
soc->ipa_uc_tx_rsc.tx_buf_pool_vaddr_unaligned[index];
|
||||||
@@ -176,8 +179,10 @@ static QDF_STATUS __dp_ipa_tx_buf_smmu_mapping(
|
|||||||
continue;
|
continue;
|
||||||
buf_len = qdf_nbuf_get_data_len(nbuf);
|
buf_len = qdf_nbuf_get_data_len(nbuf);
|
||||||
ret = __dp_ipa_handle_buf_smmu_mapping(
|
ret = __dp_ipa_handle_buf_smmu_mapping(
|
||||||
soc, nbuf, buf_len, true);
|
soc, nbuf, buf_len, create);
|
||||||
|
qdf_assert_always(!ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,19 +299,12 @@ static void dp_tx_ipa_uc_detach(struct dp_soc *soc, struct dp_pdev *pdev)
|
|||||||
int idx;
|
int idx;
|
||||||
qdf_nbuf_t nbuf;
|
qdf_nbuf_t nbuf;
|
||||||
struct dp_ipa_resources *ipa_res;
|
struct dp_ipa_resources *ipa_res;
|
||||||
bool is_ipa_ready = qdf_ipa_is_ready();
|
|
||||||
uint32_t buf_len;
|
|
||||||
|
|
||||||
for (idx = 0; idx < soc->ipa_uc_tx_rsc.alloc_tx_buf_cnt; idx++) {
|
for (idx = 0; idx < soc->ipa_uc_tx_rsc.alloc_tx_buf_cnt; idx++) {
|
||||||
nbuf = (qdf_nbuf_t)
|
nbuf = (qdf_nbuf_t)
|
||||||
soc->ipa_uc_tx_rsc.tx_buf_pool_vaddr_unaligned[idx];
|
soc->ipa_uc_tx_rsc.tx_buf_pool_vaddr_unaligned[idx];
|
||||||
if (!nbuf)
|
if (!nbuf)
|
||||||
continue;
|
continue;
|
||||||
buf_len = qdf_nbuf_get_data_len(nbuf);
|
|
||||||
if (qdf_mem_smmu_s1_enabled(soc->osdev) && is_ipa_ready)
|
|
||||||
__dp_ipa_handle_buf_smmu_mapping(
|
|
||||||
soc, nbuf, buf_len, false);
|
|
||||||
|
|
||||||
qdf_nbuf_unmap_single(soc->osdev, nbuf, QDF_DMA_BIDIRECTIONAL);
|
qdf_nbuf_unmap_single(soc->osdev, nbuf, QDF_DMA_BIDIRECTIONAL);
|
||||||
qdf_nbuf_free(nbuf);
|
qdf_nbuf_free(nbuf);
|
||||||
soc->ipa_uc_tx_rsc.tx_buf_pool_vaddr_unaligned[idx] =
|
soc->ipa_uc_tx_rsc.tx_buf_pool_vaddr_unaligned[idx] =
|
||||||
@@ -2049,6 +2047,30 @@ QDF_STATUS dp_ipa_tx_buf_smmu_mapping(
|
|||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
ret = __dp_ipa_tx_buf_smmu_mapping(soc, pdev, true);
|
ret = __dp_ipa_tx_buf_smmu_mapping(soc, pdev, true);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDF_STATUS dp_ipa_tx_buf_smmu_unmapping(
|
||||||
|
struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
|
||||||
|
{
|
||||||
|
QDF_STATUS ret;
|
||||||
|
|
||||||
|
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
|
||||||
|
struct dp_pdev *pdev =
|
||||||
|
dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id);
|
||||||
|
|
||||||
|
if (!pdev) {
|
||||||
|
dp_err("%s invalid instance", __func__);
|
||||||
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!qdf_mem_smmu_s1_enabled(soc->osdev)) {
|
||||||
|
dp_debug("SMMU S1 disabled");
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
ret = __dp_ipa_tx_buf_smmu_mapping(soc, pdev, false);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -250,16 +250,27 @@ bool dp_ipa_is_mdm_platform(void);
|
|||||||
qdf_nbuf_t dp_ipa_handle_rx_reo_reinject(struct dp_soc *soc, qdf_nbuf_t nbuf);
|
qdf_nbuf_t dp_ipa_handle_rx_reo_reinject(struct dp_soc *soc, qdf_nbuf_t nbuf);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dp_ipa_tx_buf_smmu_mapping() Create SMMU mappings for IPA
|
* dp_ipa_tx_buf_smmu_mapping() - Create SMMU mappings for IPA
|
||||||
* allocated TX buffers
|
* allocated TX buffers
|
||||||
* @soc_hdl - handle to the soc
|
* @soc_hdl: handle to the soc
|
||||||
* @pdev_id - pdev id number, to get the handle
|
* @pdev_id: pdev id number, to get the handle
|
||||||
*
|
*
|
||||||
* Return: QDF_STATUS
|
* Return: QDF_STATUS
|
||||||
*/
|
*/
|
||||||
QDF_STATUS dp_ipa_tx_buf_smmu_mapping(
|
QDF_STATUS dp_ipa_tx_buf_smmu_mapping(
|
||||||
struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
|
struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* dp_ipa_tx_buf_smmu_unmapping() - Release SMMU mappings for IPA
|
||||||
|
* allocated TX buffers
|
||||||
|
* @soc_hdl: handle to the soc
|
||||||
|
* @pdev_id: pdev id number, to get the handle
|
||||||
|
*
|
||||||
|
* Return: QDF_STATUS
|
||||||
|
*/
|
||||||
|
QDF_STATUS dp_ipa_tx_buf_smmu_unmapping(
|
||||||
|
struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
static inline int dp_ipa_uc_detach(struct dp_soc *soc, struct dp_pdev *pdev)
|
static inline int dp_ipa_uc_detach(struct dp_soc *soc, struct dp_pdev *pdev)
|
||||||
{
|
{
|
||||||
@@ -291,8 +302,14 @@ static inline qdf_nbuf_t dp_ipa_handle_rx_reo_reinject(struct dp_soc *soc,
|
|||||||
return nbuf;
|
return nbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline QDF_STATUS dp_ipa_tx_buf_smmu_mapping(
|
static inline QDF_STATUS dp_ipa_tx_buf_smmu_mapping(struct cdp_soc_t *soc_hdl,
|
||||||
struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
|
uint8_t pdev_id)
|
||||||
|
{
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline QDF_STATUS dp_ipa_tx_buf_smmu_unmapping(struct cdp_soc_t *soc_hdl,
|
||||||
|
uint8_t pdev_id)
|
||||||
{
|
{
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@@ -11430,7 +11430,8 @@ static struct cdp_ipa_ops dp_ops_ipa = {
|
|||||||
.ipa_disable_pipes = dp_ipa_disable_pipes,
|
.ipa_disable_pipes = dp_ipa_disable_pipes,
|
||||||
.ipa_set_perf_level = dp_ipa_set_perf_level,
|
.ipa_set_perf_level = dp_ipa_set_perf_level,
|
||||||
.ipa_rx_intrabss_fwd = dp_ipa_rx_intrabss_fwd,
|
.ipa_rx_intrabss_fwd = dp_ipa_rx_intrabss_fwd,
|
||||||
.ipa_tx_buf_smmu_mapping = dp_ipa_tx_buf_smmu_mapping
|
.ipa_tx_buf_smmu_mapping = dp_ipa_tx_buf_smmu_mapping,
|
||||||
|
.ipa_tx_buf_smmu_unmapping = dp_ipa_tx_buf_smmu_unmapping
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user