Skip to content

Commit

Permalink
mt76x2: dfs: avoid tasklet scheduling during mt76x2_dfs_init_params()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
LorenzoBianconi authored and nbd168 committed Jan 18, 2018
1 parent 2b7fae4 commit 939e3e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion mt76x2_dfs.c
Expand Up @@ -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 */
Expand Down
2 changes: 2 additions & 0 deletions mt76x2_main.c
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit 939e3e0

Please sign in to comment.