qcacmn: Fix regression from DP init-deinit path changes

MCL DP initialization path is running into issues due to change
I5732453f617bdc16995fda916b645c41845c3ecb. Fix the same.

Move flow control lock variables to re-use region. This is needed since
flow control deinit happens in dp_soc_detach, while in dp_soc_deinit, the
soc memory is being partially reset.

De-init HTT memory in dp_soc_deinit and free HTT handle
in dp_soc_detach. The existing code was not freeing HTT
packets for MCL case and freeing the HTT handle twice.

CRs-Fixed: 2359409
Change-Id: I52dcccc0444d4ce139a29ffcb884598bbacda88f
This commit is contained in:
Mohit Khanna
2018-11-30 14:10:55 -08:00
committed by nshrivas
parent 7c265d301e
commit 40f76b57f8
4 changed files with 41 additions and 29 deletions

View File

@@ -3272,6 +3272,12 @@ fail2:
return NULL;
}
void htt_soc_htc_dealloc(struct htt_soc *htt_handle)
{
htt_htc_misc_pkt_pool_free(htt_handle);
htt_htc_pkt_pool_free(htt_handle);
}
/*
* htt_soc_htc_prealloc() - HTC memory prealloc
* @htt_soc: SOC level HTT handle
@@ -3279,8 +3285,7 @@ fail2:
* Return: QDF_STATUS_SUCCESS on Success or
* QDF_STATUS_E_NOMEM on allocation failure
*/
QDF_STATUS
htt_soc_htc_prealloc(struct htt_soc *soc)
QDF_STATUS htt_soc_htc_prealloc(struct htt_soc *soc)
{
int i;
@@ -3300,22 +3305,15 @@ htt_soc_htc_prealloc(struct htt_soc *soc)
}
/*
* htt_soc_detach() - Detach SOC level HTT
* @htt_soc: HTT SOC handle
* htt_soc_detach() - Free SOC level HTT handle
* @htt_hdl: HTT SOC handle
*/
void
htt_soc_detach(void *htt_soc)
void htt_soc_detach(void *htt_hdl)
{
struct htt_soc *soc = (struct htt_soc *)htt_soc;
struct dp_soc *dpsoc = soc->dp_soc;
struct htt_soc *htt_handle = (struct htt_soc *)htt_hdl;
if (dpsoc->dp_soc_reinit) {
htt_htc_misc_pkt_pool_free(soc);
htt_htc_pkt_pool_free(soc);
} else {
HTT_TX_MUTEX_DESTROY(&soc->htt_tx_mutex);
qdf_mem_free(soc);
}
HTT_TX_MUTEX_DESTROY(&htt_handle->htt_tx_mutex);
qdf_mem_free(htt_handle);
}
/**

View File

@@ -151,6 +151,14 @@ void *
htt_soc_initialize(void *htt_soc, void *ctrl_psoc, HTC_HANDLE htc_soc,
void *hal_soc, qdf_device_t osdev);
/*
* htt_soc_htc_dealloc() - HTC memory de-alloc
* @htt_soc: SOC level HTT handle
*
* Return: None
*/
void htt_soc_htc_dealloc(struct htt_soc *htt_handle);
/*
* htt_soc_htc_prealloc() - HTC memory prealloc
* @htt_soc: SOC level HTT handle
@@ -158,8 +166,7 @@ htt_soc_initialize(void *htt_soc, void *ctrl_psoc, HTC_HANDLE htc_soc,
* Return: QDF_STATUS_SUCCESS on success or
* QDF_STATUS_E_NO_MEM on allocation failure
*/
QDF_STATUS
htt_soc_htc_prealloc(struct htt_soc *htt_soc);
QDF_STATUS htt_soc_htc_prealloc(struct htt_soc *htt_soc);
void htt_soc_detach(void *soc);

View File

@@ -3658,7 +3658,7 @@ static void dp_soc_deinit(void *txrx_soc)
qdf_spinlock_destroy(&soc->peer_ref_mutex);
qdf_spinlock_destroy(&soc->htt_stats.lock);
htt_soc_detach(soc->htt_handle);
htt_soc_htc_dealloc(soc->htt_handle);
qdf_spinlock_destroy(&soc->rx.defrag.defrag_lock);
@@ -3758,8 +3758,8 @@ static void dp_soc_detach(void *txrx_soc)
dp_srng_cleanup(soc, &soc->reo_status_ring, REO_STATUS, 0);
dp_hw_link_desc_pool_cleanup(soc);
soc->dp_soc_reinit = 0;
htt_soc_detach(soc->htt_handle);
soc->dp_soc_reinit = 0;
wlan_cfg_soc_detach(soc->wlan_cfg_ctx);

View File

@@ -821,22 +821,29 @@ struct dp_soc {
/* Number of REO destination rings */
uint8_t num_reo_dest_rings;
#ifdef QCA_LL_TX_FLOW_CONTROL_V2
/* lock to control access to soc TX descriptors */
qdf_spinlock_t flow_pool_array_lock;
/* pause callback to pause TX queues as per flow control */
tx_pause_callback pause_cb;
/* flow pool related statistics */
struct dp_txrx_pool_stats pool_stats;
#endif /* !QCA_LL_TX_FLOW_CONTROL_V2 */
/*
* re-use memory section ends
* reuse memory indicator
*
* DO NOT CHANGE NAME OR MOVE THIS VARIABLE
* Re-use memory section ends. reuse memory indicator.
* Everything above this variable "dp_soc_reinit" is retained across
* WiFi up/down for AP use-cases.
* Everything below this variable "dp_soc_reinit" is reset during
* dp_soc_deinit.
*/
bool dp_soc_reinit;
uint32_t wbm_idle_scatter_buf_size;
#ifdef QCA_LL_TX_FLOW_CONTROL_V2
qdf_spinlock_t flow_pool_array_lock;
tx_pause_callback pause_cb;
struct dp_txrx_pool_stats pool_stats;
#endif /* !QCA_LL_TX_FLOW_CONTROL_V2 */
/* Tx H/W queues lock */
qdf_spinlock_t tx_queue_lock[MAX_TX_HW_QUEUES];