qcacld-3.0: Stop bus BW timer during recovery

During recovery, bus bandwidth (BW) compute timer may fire and
cause stability issues. Destroy the bus bandwidth timer during
shutdown and initialize during re-init.

Change-Id: I20d52f028e61e81bdda5004e30f1c143ef4d5f23
CRs-fixed: 1075655
This commit is contained in:
Prashanth Bhatta 2016-10-11 16:08:11 -07:00 committed by qcabuildsw
parent 2ac92bda55
commit ab00438c68
3 changed files with 59 additions and 18 deletions

View File

@ -1619,6 +1619,26 @@ void hdd_checkandupdate_phymode(hdd_context_t *pHddCtx);
#ifdef MSM_PLATFORM
void hdd_start_bus_bw_compute_timer(hdd_adapter_t *pAdapter);
void hdd_stop_bus_bw_compute_timer(hdd_adapter_t *pAdapter);
/**
* hdd_bus_bandwidth_init() - Initialize bus bandwidth data structures.
* hdd_ctx: HDD context
*
* Initialize bus bandwidth related data structures like spinlock and timer.
*
* Return: None.
*/
int hdd_bus_bandwidth_init(hdd_context_t *hdd_ctx);
/**
* hdd_bus_bandwidth_destroy() - Destroy bus bandwidth data structures.
* hdd_ctx: HDD context
*
* Destroy bus bandwidth related data structures like timer.
*
* Return: None.
*/
void hdd_bus_bandwidth_destroy(hdd_context_t *hdd_ctx);
#else
static inline void hdd_start_bus_bw_compute_timer(hdd_adapter_t *pAdapter)
{
@ -1629,6 +1649,16 @@ static inline void hdd_stop_bus_bw_computer_timer(hdd_adapter_t *pAdapter)
{
return;
}
int hdd_bus_bandwidth_init(hdd_context_t *hdd_ctx)
{
return 0;
}
void hdd_bus_bandwidth_destroy(hdd_context_t *hdd_ctx)
{
return;
}
#endif
int hdd_init(void);

View File

@ -4693,18 +4693,7 @@ static void hdd_wlan_exit(hdd_context_t *hdd_ctx)
hdd_unregister_notifiers(hdd_ctx);
#ifdef MSM_PLATFORM
if (QDF_TIMER_STATE_RUNNING ==
qdf_mc_timer_get_current_state(&hdd_ctx->bus_bw_timer)) {
qdf_mc_timer_stop(&hdd_ctx->bus_bw_timer);
hdd_reset_tcp_delack(hdd_ctx);
}
if (!QDF_IS_STATUS_SUCCESS
(qdf_mc_timer_destroy(&hdd_ctx->bus_bw_timer))) {
hdd_err("Cannot deallocate Bus bandwidth timer");
}
#endif
hdd_bus_bandwidth_destroy(hdd_ctx);
#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
if (QDF_TIMER_STATE_RUNNING ==
@ -5270,6 +5259,9 @@ static void hdd_bus_bw_compute_cbk(void *priv)
bool connected = false;
uint32_t ipa_tx_packets = 0, ipa_rx_packets = 0;
if (wlan_hdd_validate_context(hdd_ctx))
return;
for (status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
NULL != adapterNode && QDF_STATUS_SUCCESS == status;
status =
@ -5362,6 +5354,26 @@ static void hdd_bus_bw_compute_cbk(void *priv)
qdf_mc_timer_start(&hdd_ctx->bus_bw_timer,
hdd_ctx->config->busBandwidthComputeInterval);
}
int hdd_bus_bandwidth_init(hdd_context_t *hdd_ctx)
{
spin_lock_init(&hdd_ctx->bus_bw_lock);
qdf_mc_timer_init(&hdd_ctx->bus_bw_timer,
QDF_TIMER_TYPE_SW,
hdd_bus_bw_compute_cbk, (void *)hdd_ctx);
return 0;
}
void hdd_bus_bandwidth_destroy(hdd_context_t *hdd_ctx)
{
if (qdf_mc_timer_get_current_state(&hdd_ctx->bus_bw_timer) ==
QDF_TIMER_STATE_RUNNING)
hdd_reset_tcp_delack(hdd_ctx);
qdf_mc_timer_destroy(&hdd_ctx->bus_bw_timer);
}
#endif
/**
@ -7922,12 +7934,7 @@ int hdd_wlan_startup(struct device *dev)
hdd_err("Failed to init ACS Skip timer");
#endif
#ifdef MSM_PLATFORM
spin_lock_init(&hdd_ctx->bus_bw_lock);
qdf_mc_timer_init(&hdd_ctx->bus_bw_timer,
QDF_TIMER_TYPE_SW,
hdd_bus_bw_compute_cbk, (void *)hdd_ctx);
#endif
hdd_bus_bandwidth_init(hdd_ctx);
hdd_lpass_notify_start(hdd_ctx);

View File

@ -1476,6 +1476,8 @@ QDF_STATUS hdd_wlan_shutdown(void)
QDF_ASSERT(false);
}
hdd_bus_bandwidth_destroy(pHddCtx);
wlansap_global_deinit();
hdd_wlan_stop_modules(pHddCtx);
@ -1537,6 +1539,8 @@ QDF_STATUS hdd_wlan_re_init(void)
if (pHddCtx->config->enable_dp_trace)
qdf_dp_trace_init();
hdd_bus_bandwidth_init(pHddCtx);
ret = hdd_wlan_start_modules(pHddCtx, pAdapter, true);
if (ret) {
hdd_err("Failed to start wlan after error");