qcacmn: Access initial ipa tx doorbell after enable pipes

Currently host writes to TX doorbell register after ipa connect
pipes to indicate number of free TX buffers. In case when IPA
clocks are off and host tries to access the register will leads
to invalid access. So access the tx doorbell register after ipa
enable pipes which makes sure IPA clocks are always on.

Change-Id: If11fdc9c408ebf7f22eef6a020b507bc39ee6a8e
CRs-Fixed: 2599029
这个提交包含在:
Sravan Goud
2020-01-13 13:17:21 +05:30
提交者 nshrivas
父节点 03b82f7365
当前提交 a4030a4261
修改 2 个文件,包含 16 行新增3 行删除

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -702,8 +702,6 @@ QDF_STATUS dp_ipa_set_doorbell_paddr(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
(void *)ipa_res->tx_comp_doorbell_paddr,
(void *)ipa_res->tx_comp_doorbell_vaddr);
hal_srng_dst_init_hp(wbm_srng, ipa_res->tx_comp_doorbell_vaddr);
/*
* For RX, REO module on Napier/Hastings does reordering on incoming
* Ethernet packets and writes one or more descriptors to REO2IPA Rx
@@ -1233,6 +1231,8 @@ QDF_STATUS dp_ipa_setup(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
ipa_res->rx_ready_doorbell_paddr =
QDF_IPA_WDI_CONN_OUT_PARAMS_RX_UC_DB_PA(&pipe_out);
soc->ipa_first_tx_db_access = true;
return QDF_STATUS_SUCCESS;
}
@@ -1445,6 +1445,8 @@ QDF_STATUS dp_ipa_setup(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
ipa_res->rx_ready_doorbell_paddr =
QDF_IPA_WDI_CONN_OUT_PARAMS_RX_UC_DB_PA(&pipe_out);
soc->ipa_first_tx_db_access = true;
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
"%s: Tx: %s=%pK, %s=%d, %s=%pK, %s=%pK, %s=%d, %s=%pK, %s=%d, %s=%pK",
__func__,
@@ -1604,6 +1606,9 @@ QDF_STATUS dp_ipa_enable_pipes(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
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);
struct hal_srng *wbm_srng = (struct hal_srng *)
soc->tx_comp_ring[IPA_TX_COMP_RING_IDX].hal_srng;
struct dp_ipa_resources *ipa_res;
QDF_STATUS result;
if (!pdev) {
@@ -1611,6 +1616,8 @@ QDF_STATUS dp_ipa_enable_pipes(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
return QDF_STATUS_E_FAILURE;
}
ipa_res = &pdev->ipa_resource;
qdf_atomic_set(&soc->ipa_pipes_enabled, 1);
dp_ipa_handle_rx_buf_pool_smmu_mapping(soc, pdev, true);
@@ -1624,6 +1631,11 @@ QDF_STATUS dp_ipa_enable_pipes(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
return QDF_STATUS_E_FAILURE;
}
if (soc->ipa_first_tx_db_access) {
hal_srng_dst_init_hp(wbm_srng, ipa_res->tx_comp_doorbell_vaddr);
soc->ipa_first_tx_db_access = false;
}
return QDF_STATUS_SUCCESS;
}