diff options
| author | Prashanth Bhatta <bhattap@codeaurora.org> | 2016-10-11 16:08:11 -0700 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2016-10-12 17:45:01 -0700 |
| commit | ab00438c68952dccfe41f2d3c00d7197bcfe0e45 (patch) | |
| tree | 4fd18f094a547d8199a5d7f2ca5cda556601105e | |
| parent | 2ac92bda55ac0ef21f66173f4f486d3d74d58edf (diff) | |
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
| -rw-r--r-- | core/hdd/inc/wlan_hdd_main.h | 30 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 43 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_power.c | 4 |
3 files changed, 59 insertions, 18 deletions
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 3a0b6fb7a520..41e16d0da753 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -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); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index c2677892d0a3..10738b27a157 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -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); diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index f629c6e7982c..2e625006e12c 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -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"); |
