summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo@kernel.org>2020-07-03 10:15:51 +0200
committerFelix Fietkau <nbd@nbd.name>2020-07-21 19:01:17 +0200
commitde1f66bab9b7d9c1c80ae18bb1d85b699bbf8f44 (patch)
treeb26870be84cf08061e3fa95df2457c19fe47a399 /drivers/net/wireless/mediatek
parent030aaeddbab161403aa4e4f34b84971bb5db7a9f (diff)
mt76: mt7615: run mt7615_mcu_set_wmm holding mt76 mutex
Make sure to run mt7615_mcu_set_wmm() holding mt76 mutex in order to wake the device from low power state and avoid races Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7615/main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
index eb56cd7cb429..c52b5c68ba97 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
@@ -433,11 +433,17 @@ mt7615_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 queue,
{
struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv;
struct mt7615_dev *dev = mt7615_hw_dev(hw);
+ int err;
+
+ mt7615_mutex_acquire(dev);
queue = mt7615_lmac_mapping(dev, queue);
queue += mvif->wmm_idx * MT7615_MAX_WMM_SETS;
+ err = mt7615_mcu_set_wmm(dev, queue, params);
- return mt7615_mcu_set_wmm(dev, queue, params);
+ mt7615_mutex_release(dev);
+
+ return err;
}
static void mt7615_configure_filter(struct ieee80211_hw *hw,