mt76x2: dfs: avoid tasklet scheduling during mt76x2_dfs_init_params()
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Tue, 9 Jan 2018 13:13:10 +0000 (14:13 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 24 Jan 2018 15:15:33 +0000 (17:15 +0200)
Substitute tasklet_kill with tasklet_disable/tasklet_enable in order to
guarantee dfs tasklet can not be executed during dfs parameter
initialization

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mediatek/mt76/mt76x2_dfs.c
drivers/net/wireless/mediatek/mt76/mt76x2_main.c

index 5b452a5960168051c2bdc1792b425db5516ab2dc..1a6282a8b64b647d8c26fc1040e66a773fc81f06 100644 (file)
@@ -460,7 +460,6 @@ void mt76x2_dfs_init_params(struct mt76x2_dev *dev)
 {
        struct cfg80211_chan_def *chandef = &dev->mt76.chandef;
 
-       tasklet_kill(&dev->dfs_pd.dfs_tasklet);
        if (chandef->chan->flags & IEEE80211_CHAN_RADAR) {
                mt76x2_dfs_set_bbp_params(dev);
                /* enable debug mode */
index fb9c2dbc040e08f07f092031f4545d2a7606a7ba..aa5fbb64e218dc160ee96c7110709260b2151583 100644 (file)
@@ -127,6 +127,7 @@ mt76x2_set_channel(struct mt76x2_dev *dev, struct cfg80211_chan_def *chandef)
        mt76_set_channel(&dev->mt76);
 
        tasklet_disable(&dev->pre_tbtt_tasklet);
+       tasklet_disable(&dev->dfs_pd.dfs_tasklet);
        cancel_delayed_work_sync(&dev->cal_work);
 
        mt76x2_mac_stop(dev, true);
@@ -139,6 +140,7 @@ mt76x2_set_channel(struct mt76x2_dev *dev, struct cfg80211_chan_def *chandef)
        mt76x2_dfs_init_params(dev);
 
        mt76x2_mac_resume(dev);
+       tasklet_enable(&dev->dfs_pd.dfs_tasklet);
        tasklet_enable(&dev->pre_tbtt_tasklet);
 
        return ret;