summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Khandavalli <akhandav@codeaurora.org>2017-01-19 15:43:52 +0530
committerqcabuildsw <qcabuildsw@localhost>2017-01-21 14:32:57 -0800
commit74fba54156fd234cf6593ef3f9811f45f22a4e5a (patch)
tree4cb381f97ec90d2fdf560e8e887a14ac89748bb6
parentf46a27fc1c9e9089b4044b4b7146698ff28bb186 (diff)
qcacld-3.0: Wait for driver probe to complete in module_init
During wifi-on the framework will load the driver and starts the supplicant. In the present scenario, as soon as the driver registers with the platform driver it checks whether FW_READY indication is recieved. If the FW_READY is received the platform driver calls probe of the driver in same context of the wifistate machine. If the FW_READY indication is not received it calls the probe of the driver in the work queue context. This is resulting in the wifi grey out in the UI. So, wait for the driver probe completion in the module_init, before returning the context to framework. Change-Id: I21b70f7e383bde07ac8cc3d4969be18b840d26a4 CRs-fixed: 1112295
-rw-r--r--core/hdd/src/wlan_hdd_main.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index ded0fff8bda8..f46ebb62e6a0 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -194,7 +194,7 @@ static const struct wiphy_wowlan_support wowlan_support_reg_init = {
/* internal function declaration */
struct sock *cesium_nl_srv_sock;
-
+struct completion wlan_start_comp;
#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
void wlan_hdd_auto_shutdown_cb(void);
#endif
@@ -8359,6 +8359,7 @@ int hdd_wlan_startup(struct device *dev)
if (!QDF_IS_STATUS_SUCCESS(status))
hdd_err("Failed to disable Chan Avoidance Indication");
}
+ complete(&wlan_start_comp);
goto success;
err_debugfs_exit:
@@ -9318,11 +9319,7 @@ void hdd_deinit(void)
#endif
}
-#ifdef QCA_WIFI_3_0_ADRASTEA
-#define HDD_WLAN_START_WAIT_TIME (3600 * 1000)
-#else
#define HDD_WLAN_START_WAIT_TIME (CDS_WMA_TIMEOUT + 5000)
-#endif
/**
* __hdd_module_init - Module init helper
@@ -9334,6 +9331,7 @@ void hdd_deinit(void)
static int __hdd_module_init(void)
{
int ret = 0;
+ unsigned long rc;
pr_err("%s: Loading driver v%s\n", WLAN_MODULE_NAME,
QWLAN_VERSIONSTR TIMER_MANAGER_STR MEMORY_DEBUG_STR);
@@ -9350,6 +9348,7 @@ static int __hdd_module_init(void)
hdd_set_conparam((uint32_t) con_mode);
+ init_completion(&wlan_start_comp);
ret = wlan_hdd_register_driver();
if (ret) {
pr_err("%s: driver load failure, err %d\n", WLAN_MODULE_NAME,
@@ -9357,6 +9356,15 @@ static int __hdd_module_init(void)
goto out;
}
+ rc = wait_for_completion_timeout(&wlan_start_comp,
+ msecs_to_jiffies(HDD_WLAN_START_WAIT_TIME));
+
+ if (!rc) {
+ hdd_alert("Timed-out waiting for wlan_hdd_register_driver");
+ QDF_BUG(0);
+ goto out;
+ }
+
pr_info("%s: driver loaded\n", WLAN_MODULE_NAME);
return 0;