ath10k: cancel coverage class work during stop and restart
authorMohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
Fri, 31 Mar 2017 11:58:41 +0000 (17:28 +0530)
committerKalle Valo <kvalo@qca.qualcomm.com>
Wed, 5 Apr 2017 07:36:49 +0000 (10:36 +0300)
It seems set_coverage_class_work is not cancelled anywhere,
though I could not find a crash/warning  with this existing
design, its safer to cancel it during stop() and also before
restarting the hardware.

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/core.c
drivers/net/wireless/ath/ath10k/mac.c

index f450ebbb28d5344a9fc8fb6d52f23d3c1e2f5401..85a14e2b3d04ba39ae8f2acc639c002353496778 100644 (file)
@@ -1627,6 +1627,13 @@ static void ath10k_core_restart(struct work_struct *work)
        wake_up(&ar->wmi.tx_credits_wq);
        wake_up(&ar->peer_mapping_wq);
 
+       /* TODO: We can have one instance of cancelling coverage_class_work by
+        * moving it to ath10k_halt(), so that both stop() and restart() would
+        * call that but it takes conf_mutex() and if we call cancel_work_sync()
+        * with conf_mutex it will deadlock.
+        */
+       cancel_work_sync(&ar->set_coverage_class_work);
+
        mutex_lock(&ar->conf_mutex);
 
        switch (ar->state) {
index 3ca713e09ce9f80929a086f1f15957dc95128f05..ddabec8022f4687c73abb90305b9629564b88736 100644 (file)
@@ -4717,6 +4717,7 @@ static void ath10k_stop(struct ieee80211_hw *hw)
        }
        mutex_unlock(&ar->conf_mutex);
 
+       cancel_work_sync(&ar->set_coverage_class_work);
        cancel_delayed_work_sync(&ar->scan.timeout);
        cancel_work_sync(&ar->restart_work);
 }