diff options
author | Lorenzo Bianconi <lorenzo.bianconi@redhat.com> | 2018-12-06 19:07:39 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2019-01-11 17:10:16 +0300 |
commit | 4989338ed3053372fcf5173a2a4800ac99de07d9 (patch) | |
tree | a4007ccb4b878788676c44f8e2acb0e9189fcb0f /drivers | |
parent | 374eb1b55540c99af4e2417a2d51ff5f56cfdb70 (diff) | |
download | linux-4989338ed3053372fcf5173a2a4800ac99de07d9.tar.xz |
mt76: mac: run mt76x02_mac_work routine atomically
Grab mt76_dev mutex in mt76x02_mac_work handler since it runs
concurrently with mt76x{0,2}_set_channel routines
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76x02_mac.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c index 490368dc9325..64841f40cdcf 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c @@ -784,6 +784,8 @@ void mt76x02_mac_work(struct work_struct *work) mac_work.work); int i, idx; + mutex_lock(&dev->mt76.mutex); + mt76x02_update_channel(&dev->mt76); for (i = 0, idx = 0; i < 16; i++) { u32 val = mt76_rr(dev, MT_TX_AGG_CNT(i)); @@ -796,6 +798,8 @@ void mt76x02_mac_work(struct work_struct *work) if (!dev->beacon_mask) mt76x02_check_mac_err(dev); + mutex_unlock(&dev->mt76.mutex); + mt76_tx_status_check(&dev->mt76, NULL, false); ieee80211_queue_delayed_work(mt76_hw(dev), &dev->mac_work, |