Skip to content

Commit

Permalink
mt76x0: usb: stop cal/mac workqueues at hw stop
Browse files Browse the repository at this point in the history
Stop mac and calibration work stopping the hw even if the
device has been removed

Fixes: b11e19694dc9 ("mt76x0: add ieee80211_ops ops pointer to
mt76x0_alloc_device signature")

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
  • Loading branch information
LorenzoBianconi authored and nbd168 committed Oct 4, 2018
1 parent 6856ef6 commit 3d43146
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mt76x0/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ static void mt76x0u_cleanup(struct mt76x0_dev *dev)

static void mt76x0u_mac_stop(struct mt76x0_dev *dev)
{
if (test_bit(MT76_REMOVED, &dev->mt76.state))
return;

clear_bit(MT76_STATE_RUNNING, &dev->mt76.state);
cancel_delayed_work_sync(&dev->cal_work);
cancel_delayed_work_sync(&dev->mac_work);
mt76u_stop_stat_wk(&dev->mt76);

if (test_bit(MT76_REMOVED, &dev->mt76.state))
return;

mt76_clear(dev, MT_BEACON_TIME_CFG, MT_BEACON_TIME_CFG_TIMER_EN |
MT_BEACON_TIME_CFG_SYNC_MODE | MT_BEACON_TIME_CFG_TBTT_EN |
MT_BEACON_TIME_CFG_BEACON_TX);
Expand Down

0 comments on commit 3d43146

Please sign in to comment.