From 006f383e64fd059492d7a78556e68bcb933a8b08 Mon Sep 17 00:00:00 2001 From: Hanumanth Reddy Pothula Date: Thu, 12 Oct 2017 15:52:43 +0530 Subject: [PATCH] qcacld-3.0: Don't double start inactivity timer There is a possibility of double start of inactivity timer if iff_up (hdd_open) happens while probe/remove/reinit is still going on. To mitigate this issue, on iff_up, start inactivity after acquiring hdd_init_deinit_lock, which make sure probe/remove/reinit are completed, and thereby inactivity timer is stopped. Change-Id: I2417215380e318a8410a2d25eabf82f353a26c4f CRs-Fixed: 2125494 --- core/hdd/src/wlan_hdd_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index c2c6d56c1174..5a913c6eedb1 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2557,6 +2557,8 @@ static int __hdd_open(struct net_device *dev) mutex_lock(&hdd_init_deinit_lock); + hdd_start_driver_ops_timer(eHDD_DRV_OP_IFF_UP); + /* * This scenario can be hit in cases where in the wlan driver after * registering the netdevices and there is a failure in driver @@ -2607,6 +2609,7 @@ static int __hdd_open(struct net_device *dev) hdd_populate_wifi_pos_cfg(hdd_ctx); err_hdd_hdd_init_deinit_lock: + hdd_stop_driver_ops_timer(); mutex_unlock(&hdd_init_deinit_lock); return ret; } @@ -2625,9 +2628,7 @@ static int hdd_open(struct net_device *dev) int ret; cds_ssr_protect(__func__); - hdd_start_driver_ops_timer(eHDD_DRV_OP_IFF_UP); ret = __hdd_open(dev); - hdd_stop_driver_ops_timer(); cds_ssr_unprotect(__func__); return ret;