qcacld-3.0: Remove hdd_init_deinit_lock

hdd_init_deinit_lock has been obsoleted by the addition and integration
of the Driver Synchronization feature. Remove hdd_init_deinit_lock.

Change-Id: Ia1b9e4279f42023ba2c956224ceabd02d8b4c6d4
CRs-Fixed: 2420766
This commit is contained in:
Dustin Brown
2019-03-19 15:51:54 -07:00
committed by nshrivas
parent 42cc9fd76b
commit 3da3a83e84
3 changed files with 7 additions and 33 deletions

View File

@@ -369,8 +369,6 @@ enum hdd_driver_flags {
/* Assigned size of driver memory dump is 4096 bytes */ /* Assigned size of driver memory dump is 4096 bytes */
#define DRIVER_MEM_DUMP_SIZE 4096 #define DRIVER_MEM_DUMP_SIZE 4096
extern struct mutex hdd_init_deinit_lock;
/* MAX OS Q block time value in msec /* MAX OS Q block time value in msec
* Prevent from permanent stall, resume OS Q if timer expired * Prevent from permanent stall, resume OS Q if timer expired
*/ */

View File

@@ -359,7 +359,6 @@ static int check_for_probe_defer(int ret)
static void hdd_soc_load_lock(struct device *dev) static void hdd_soc_load_lock(struct device *dev)
{ {
mutex_lock(&hdd_init_deinit_lock);
hdd_prevent_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT); hdd_prevent_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT);
hdd_request_pm_qos(dev, DISABLE_KRAIT_IDLE_PS_VAL); hdd_request_pm_qos(dev, DISABLE_KRAIT_IDLE_PS_VAL);
} }
@@ -368,7 +367,6 @@ static void hdd_soc_load_unlock(struct device *dev)
{ {
hdd_remove_pm_qos(dev); hdd_remove_pm_qos(dev);
hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT); hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT);
mutex_unlock(&hdd_init_deinit_lock);
} }
static int __hdd_soc_probe(struct device *dev, static int __hdd_soc_probe(struct device *dev,
@@ -579,7 +577,6 @@ static void __hdd_soc_remove(struct device *dev)
if (!hdd_wait_for_debugfs_threads_completion()) if (!hdd_wait_for_debugfs_threads_completion())
hdd_warn("Debugfs threads are still active attempting driver unload anyway"); hdd_warn("Debugfs threads are still active attempting driver unload anyway");
mutex_lock(&hdd_init_deinit_lock);
if (hdd_get_conparam() == QDF_GLOBAL_EPPING_MODE) { if (hdd_get_conparam() == QDF_GLOBAL_EPPING_MODE) {
hdd_wlan_stop_modules(hdd_ctx, false); hdd_wlan_stop_modules(hdd_ctx, false);
epping_disable(); epping_disable();
@@ -590,8 +587,6 @@ static void __hdd_soc_remove(struct device *dev)
hdd_context_destroy(hdd_ctx); hdd_context_destroy(hdd_ctx);
mutex_unlock(&hdd_init_deinit_lock);
cds_set_driver_in_bad_state(false); cds_set_driver_in_bad_state(false);
cds_set_unload_in_progress(false); cds_set_unload_in_progress(false);
@@ -713,23 +708,21 @@ static void __hdd_soc_recovery_shutdown(void)
/* cancel/flush any pending/active idle shutdown work */ /* cancel/flush any pending/active idle shutdown work */
hdd_psoc_idle_timer_stop(hdd_ctx); hdd_psoc_idle_timer_stop(hdd_ctx);
mutex_lock(&hdd_init_deinit_lock);
/* nothing to do if the soc is already unloaded */ /* nothing to do if the soc is already unloaded */
if (hdd_ctx->driver_status == DRIVER_MODULES_CLOSED) { if (hdd_ctx->driver_status == DRIVER_MODULES_CLOSED) {
hdd_info("Driver modules are already closed"); hdd_info("Driver modules are already closed");
goto unlock; return;
} }
if (cds_is_load_or_unload_in_progress()) { if (cds_is_load_or_unload_in_progress()) {
hdd_info("Load/unload in progress, ignore SSR shutdown"); hdd_info("Load/unload in progress, ignore SSR shutdown");
goto unlock; return;
} }
hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
if (!hif_ctx) { if (!hif_ctx) {
hdd_err("Failed to get HIF context, ignore SSR shutdown"); hdd_err("Failed to get HIF context, ignore SSR shutdown");
goto unlock; return;
} }
/* mask the host controller interrupts */ /* mask the host controller interrupts */
@@ -747,13 +740,6 @@ static void __hdd_soc_recovery_shutdown(void)
hif_disable_isr(hif_ctx); hif_disable_isr(hif_ctx);
hdd_wlan_shutdown(); hdd_wlan_shutdown();
} }
mutex_unlock(&hdd_init_deinit_lock);
return;
unlock:
mutex_unlock(&hdd_init_deinit_lock);
} }
/** /**

View File

@@ -232,8 +232,6 @@ static char *country_code;
static int enable_11d = -1; static int enable_11d = -1;
static int enable_dfs_chan_scan = -1; static int enable_dfs_chan_scan = -1;
DEFINE_MUTEX(hdd_init_deinit_lock);
#define WLAN_NLINK_CESIUM 30 #define WLAN_NLINK_CESIUM 30
static qdf_wake_lock_t wlan_wake_lock; static qdf_wake_lock_t wlan_wake_lock;
@@ -3113,8 +3111,6 @@ static int __hdd_open(struct net_device *dev)
return -EBUSY; return -EBUSY;
} }
mutex_lock(&hdd_init_deinit_lock);
/* /*
* This scenario can be hit in cases where in the wlan driver after * This scenario can be hit in cases where in the wlan driver after
* registering the netdevices and there is a failure in driver * registering the netdevices and there is a failure in driver
@@ -3124,14 +3120,13 @@ static int __hdd_open(struct net_device *dev)
if (!cds_is_driver_loaded()) { if (!cds_is_driver_loaded()) {
hdd_err("Failed to start the wlan driver!!"); hdd_err("Failed to start the wlan driver!!");
ret = -EIO; return -EIO;
goto err_hdd_hdd_init_deinit_lock;
} }
ret = hdd_psoc_idle_restart(hdd_ctx); ret = hdd_psoc_idle_restart(hdd_ctx);
if (ret) { if (ret) {
hdd_err("Failed to start WLAN modules return"); hdd_err("Failed to start WLAN modules return");
goto err_hdd_hdd_init_deinit_lock; return ret;
} }
if (!test_bit(SME_SESSION_OPENED, &adapter->event_flags)) { if (!test_bit(SME_SESSION_OPENED, &adapter->event_flags)) {
@@ -3139,7 +3134,7 @@ static int __hdd_open(struct net_device *dev)
if (ret) { if (ret) {
hdd_err("Failed to start adapter :%d", hdd_err("Failed to start adapter :%d",
adapter->device_mode); adapter->device_mode);
goto err_hdd_hdd_init_deinit_lock; return ret;
} }
} }
@@ -3163,10 +3158,7 @@ static int __hdd_open(struct net_device *dev)
hdd_populate_wifi_pos_cfg(hdd_ctx); hdd_populate_wifi_pos_cfg(hdd_ctx);
hdd_lpass_notify_start(hdd_ctx, adapter); hdd_lpass_notify_start(hdd_ctx, adapter);
err_hdd_hdd_init_deinit_lock: return 0;
mutex_unlock(&hdd_init_deinit_lock);
return ret;
} }
/** /**
@@ -13507,7 +13499,6 @@ static int __hdd_driver_mode_change(struct hdd_context *hdd_ctx,
} }
qdf_atomic_set(&hdd_ctx->con_mode_flag, 1); qdf_atomic_set(&hdd_ctx->con_mode_flag, 1);
mutex_lock(&hdd_init_deinit_lock);
curr_mode = hdd_get_conparam(); curr_mode = hdd_get_conparam();
if (curr_mode == next_mode) { if (curr_mode == next_mode) {
@@ -13570,7 +13561,6 @@ static int __hdd_driver_mode_change(struct hdd_context *hdd_ctx,
errno = 0; errno = 0;
unlock: unlock:
mutex_unlock(&hdd_init_deinit_lock);
qdf_atomic_set(&hdd_ctx->con_mode_flag, 0); qdf_atomic_set(&hdd_ctx->con_mode_flag, 0);
return errno; return errno;