Skip to contentSkip to conversation

mt76x2: init: disable all pending tasklets during device removal

PATCH In review Lorenzo Bianconi 3 participants 3 messages Jan 23, 2018 – Jan 24, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH v2 1/1 mt76x2: init: disable all pending tasklets during device removal

There is a possible race in mt76x2_stop_hardware() since pre_tbtt and dfs tasklets could run during driver cleanup. Fix it disabling all pending tasklets during device removal

---
Changes since v1:
- add proper commit message
- squash patch 1/2 and 2/2

---
 drivers/net/wireless/mediatek/mt76/mt76x2_init.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/wireless/mediatek/mt76/mt76x2_init.c +2 -0
index 9f20a308ff76..7b4851481dd6 100644
@@ -614,6 +614,8 @@ void mt76x2_stop_hardware(struct mt76x2_dev *dev)
 
 void mt76x2_cleanup(struct mt76x2_dev *dev)
 {
+	tasklet_disable(&dev->dfs_pd.dfs_tasklet);
+	tasklet_disable(&dev->pre_tbtt_tasklet);
 	mt76x2_stop_hardware(dev);
 	mt76x2_dma_cleanup(dev);
 	mt76x2_mcu_cleanup(dev);
Signature · 1 line
2.14.3
#3 lore raw
In reply to Lorenzo Bianconi
Quoted 6 lines · Lorenzo Bianconi

There is a possible race in mt76x2_stop_hardware() since pre_tbtt and dfs tasklets could run during driver cleanup. Fix it disabling all pending tasklets during device removal

Patch applied to wireless-drivers-next.git, thanks.

ba9797b2a7a5 mt76x2: init: disable all pending tasklets during device removal

Signature · 3 lines
https://patchwork.kernel.org/patch/10179831/

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