Skip to contentSkip to conversation

ath10k: cancel coverage class work during stop and restart

PATCH In review Mohammed Shafi Shajakhan 2 participants 2 messages Mar 31, 2017 – Apr 5, 2017 Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath10k: cancel coverage class work during stop and restart

From: Mohammed Shafi Shajakhan <[email protected]>

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.

---
[comments updated, thanks Kalle]

 drivers/net/wireless/ath/ath10k/core.c | 7 +++++++
 drivers/net/wireless/ath/ath10k/mac.c  | 1 +
 2 files changed, 8 insertions(+)
drivers/net/wireless/ath/ath10k/core.c +7 -0
index ba8768d..e653717 100644
@@ -1610,6 +1610,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) {
drivers/net/wireless/ath/ath10k/mac.c +1 -0
index 3029f25..6470ed3 100644
@@ -4684,6 +4684,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);
 }
Signature · 1 line
1.9.1
#1 lore raw
Quoted 8 lines · Mohammed Shafi Shajakhan

From: Mohammed Shafi Shajakhan <[email protected]>

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.

Patch applied to ath-next branch of ath.git, thanks.

d94475c2f95c ath10k: cancel coverage class work during stop and restart

Signature · 6 lines
https://patchwork.kernel.org/patch/9656095/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches