From 86d196bacd6b00a7e63a29710db3a37eb96ce4c0 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Thu, 2 Aug 2018 11:51:49 -0700 Subject: [PATCH] qcacld-3.0: Normalize bus bandwidth init/deinit sequence The HDD bus bandwidth infrastructure init/deinit sequence is currently very sporadic. Startup and re-init initialize it at different point, and failed to de-initialize it in the case of failure. Likewise, exit and shutdown de-initialize it at different points. Update the HDD bus bandwidth init/deinit sequence so that it is uniform and symmetrical in all situations. Change-Id: I5312bd340d885aafb8d4e809672eb02afc199781 CRs-Fixed: 2290237 --- core/hdd/inc/wlan_hdd_main.h | 8 ++++---- core/hdd/src/wlan_hdd_main.c | 10 ++++------ core/hdd/src/wlan_hdd_power.c | 6 ++---- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 4e7e94eeb9..226dc04fb4 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -2264,14 +2264,14 @@ void hdd_bus_bw_compute_timer_try_stop(struct hdd_context *hdd_ctx); int hdd_bus_bandwidth_init(struct hdd_context *hdd_ctx); /** - * hdd_bus_bandwidth_destroy() - Destroy bus bandwidth data structures. + * hdd_bus_bandwidth_deinit() - De-initialize bus bandwidth data structures. * @hdd_ctx: HDD context * - * Destroy bus bandwidth related data structures like timer. + * De-initialize bus bandwidth related data structures like timer. * * Return: None. */ -void hdd_bus_bandwidth_destroy(struct hdd_context *hdd_ctx); +void hdd_bus_bandwidth_deinit(struct hdd_context *hdd_ctx); /** * hdd_bus_bw_cancel_work() - Cancel the bus_bw_work worker @@ -2315,7 +2315,7 @@ int hdd_bus_bandwidth_init(struct hdd_context *hdd_ctx) } static inline -void hdd_bus_bandwidth_destroy(struct hdd_context *hdd_ctx) +void hdd_bus_bandwidth_deinit(struct hdd_context *hdd_ctx) { } diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index cb1e07bab9..1ce257751a 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -6949,8 +6949,6 @@ static void hdd_wlan_exit(struct hdd_context *hdd_ctx) hdd_unregister_notifiers(hdd_ctx); - hdd_bus_bandwidth_destroy(hdd_ctx); - #ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE if (QDF_TIMER_STATE_RUNNING == qdf_mc_timer_get_current_state(&hdd_ctx->skip_acs_scan_timer)) { @@ -7012,6 +7010,7 @@ static void hdd_wlan_exit(struct hdd_context *hdd_ctx) hdd_wlan_stop_modules(hdd_ctx, false); + hdd_bus_bandwidth_deinit(hdd_ctx); hdd_driver_memdump_deinit(); qdf_nbuf_deinit_replenish_timer(); @@ -7715,7 +7714,7 @@ int hdd_bus_bandwidth_init(struct hdd_context *hdd_ctx) return 0; } -void hdd_bus_bandwidth_destroy(struct hdd_context *hdd_ctx) +void hdd_bus_bandwidth_deinit(struct hdd_context *hdd_ctx) { if (hdd_ctx->bus_bw_timer_running) hdd_reset_tcp_delack(hdd_ctx); @@ -11173,8 +11172,8 @@ int hdd_wlan_startup(struct device *dev) osif_request_manager_init(); qdf_atomic_init(&hdd_ctx->con_mode_flag); - hdd_driver_memdump_init(); + hdd_bus_bandwidth_init(hdd_ctx); ret = hdd_wlan_start_modules(hdd_ctx, false); if (ret) { @@ -11236,8 +11235,6 @@ int hdd_wlan_startup(struct device *dev) qdf_spinlock_create(&hdd_ctx->acs_skip_lock); #endif - hdd_bus_bandwidth_init(hdd_ctx); - hdd_lpass_notify_start(hdd_ctx); if (hdd_ctx->rps) @@ -11287,6 +11284,7 @@ err_stop_modules: hdd_wlan_stop_modules(hdd_ctx, false); err_memdump_deinit: + hdd_bus_bandwidth_deinit(hdd_ctx); hdd_driver_memdump_deinit(); osif_request_manager_deinit(); diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index dd1430a293..88e844c444 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1240,10 +1240,9 @@ QDF_STATUS hdd_wlan_shutdown(void) } #endif - hdd_bus_bandwidth_destroy(hdd_ctx); - hdd_wlan_stop_modules(hdd_ctx, false); + hdd_bus_bandwidth_deinit(hdd_ctx); hdd_lpass_notify_stop(hdd_ctx); hdd_info("WLAN driver shutdown complete"); @@ -1321,10 +1320,8 @@ QDF_STATUS hdd_wlan_re_init(void) hdd_err("Failed to get adapter"); hdd_dp_trace_init(hdd_ctx->config); - hdd_bus_bandwidth_init(hdd_ctx); - ret = hdd_wlan_start_modules(hdd_ctx, true); if (ret) { hdd_err("Failed to start wlan after error"); @@ -1361,6 +1358,7 @@ QDF_STATUS hdd_wlan_re_init(void) goto success; err_re_init: + hdd_bus_bandwidth_deinit(hdd_ctx); qdf_dp_trace_deinit(); /* Allow the phone to go to sleep */ hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT);