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
This commit is contained in:
Sravan Goud
2020-01-13 13:17:21 +05:30
committed by nshrivas
parent 03b82f7365
commit a4030a4261
2 changed files with 16 additions and 3 deletions

View File

@@ -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 * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * 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_paddr,
(void *)ipa_res->tx_comp_doorbell_vaddr); (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 * For RX, REO module on Napier/Hastings does reordering on incoming
* Ethernet packets and writes one or more descriptors to REO2IPA Rx * 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 = ipa_res->rx_ready_doorbell_paddr =
QDF_IPA_WDI_CONN_OUT_PARAMS_RX_UC_DB_PA(&pipe_out); QDF_IPA_WDI_CONN_OUT_PARAMS_RX_UC_DB_PA(&pipe_out);
soc->ipa_first_tx_db_access = true;
return QDF_STATUS_SUCCESS; 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 = ipa_res->rx_ready_doorbell_paddr =
QDF_IPA_WDI_CONN_OUT_PARAMS_RX_UC_DB_PA(&pipe_out); 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, 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", "%s: Tx: %s=%pK, %s=%d, %s=%pK, %s=%pK, %s=%d, %s=%pK, %s=%d, %s=%pK",
__func__, __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_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
struct dp_pdev *pdev = struct dp_pdev *pdev =
dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id); 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; QDF_STATUS result;
if (!pdev) { 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; return QDF_STATUS_E_FAILURE;
} }
ipa_res = &pdev->ipa_resource;
qdf_atomic_set(&soc->ipa_pipes_enabled, 1); qdf_atomic_set(&soc->ipa_pipes_enabled, 1);
dp_ipa_handle_rx_buf_pool_smmu_mapping(soc, pdev, true); 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; 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; return QDF_STATUS_SUCCESS;
} }

View File

@@ -1190,6 +1190,7 @@ struct dp_soc {
} ipa_uc_rx_rsc; } ipa_uc_rx_rsc;
qdf_atomic_t ipa_pipes_enabled; qdf_atomic_t ipa_pipes_enabled;
bool ipa_first_tx_db_access;
#endif #endif
#ifdef WLAN_FEATURE_STATS_EXT #ifdef WLAN_FEATURE_STATS_EXT