diff options
| author | Arun Khandavalli <akhandav@codeaurora.org> | 2017-08-01 18:41:04 +0530 |
|---|---|---|
| committer | snandini <snandini@codeaurora.org> | 2017-08-13 22:27:20 -0700 |
| commit | 0752590e48313c3aaab6922e84283fac8d02c07a (patch) | |
| tree | 8fcb5b53aa514dc14e94d3c51768702a251155b9 | |
| parent | 84858003282fdf743c96e007cf3dbce2e6f66d4a (diff) | |
qcacld-3.0: Add wait during module_init for static driver
Incase of the static driver there can be failure while accessing
the WCNSS_qcom_cfg.ini because ueventd has not enumerated the
file which results in probe failure.
Since the probe is happening in different context the failure will not
be updated to upper layers.
To mitigate the issue add wait for the static driver.
Change-Id: I90c8ec8a95e9f98ff420eb0fcf76a631da3ba0ba
CRs-Fixed: 2085748
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 21ac300af4c8..986ac4f63619 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -11034,6 +11034,28 @@ static void wlan_hdd_state_ctrl_param_destroy(void) pr_info("Device node unregistered"); } +#ifndef MODULE +static int hdd_wait_for_probe_complete(void) +{ + unsigned long rc; + + rc = wait_for_completion_timeout(&wlan_start_comp, + msecs_to_jiffies(HDD_WLAN_START_WAIT_TIME)); + + if (!rc) { + hdd_alert("Timed-out waiting for Probe to complete"); + return -ETIMEDOUT; + } + + return 0; +} +#else +static int hdd_wait_for_probe_complete(void) +{ + return 0; +} +#endif + /** * __hdd_module_init - Module init helper * @@ -11076,6 +11098,12 @@ static int __hdd_module_init(void) goto out; } + if (hdd_wait_for_probe_complete()) { + pr_err("%s: probe of the driver failed!", __func__); + wlan_hdd_unregister_driver(); + goto out; + } + pr_info("%s: driver loaded\n", WLAN_MODULE_NAME); return 0; @@ -11158,6 +11186,7 @@ static ssize_t wlan_boot_cb(struct kobject *kobj, return -EALREADY; } + init_completion(&wlan_start_comp); if (__hdd_module_init()) { pr_err("%s: wlan driver initialization failed\n", __func__); return -EIO; @@ -11259,7 +11288,6 @@ static int wlan_deinit_sysfs(void) hdd_sysfs_cleanup(); return 0; } - #endif /* MODULE */ #ifdef MODULE |
