]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mt76: mt7921: always wake the device in mt7921_remove_interface
authorLorenzo Bianconi <lorenzo@kernel.org>
Sat, 3 Apr 2021 12:26:39 +0000 (14:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 08:52:53 +0000 (10:52 +0200)
[ Upstream commit 859c85fd19715349ce01539459095fd5fc7e483a ]

Make sure the mcu is not in sleep mode before sending mcu messages in
mt7921_remove_interface routine.

Fixes: 1d8efc741df80 ("mt76: mt7921: introduce Runtime PM support")
Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Co-developed-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/mediatek/mt76/mt7921/main.c

index 3566059e57047fab3169401b0f5d4ad20d7aea5d..166c9c0eb5fd9d67a94064bc4715e5c6ea593d5b 100644 (file)
@@ -348,6 +348,7 @@ static void mt7921_remove_interface(struct ieee80211_hw *hw,
        if (vif == phy->monitor_vif)
                phy->monitor_vif = NULL;
 
+       mt7921_mutex_acquire(dev);
        mt76_connac_free_pending_tx_skbs(&dev->pm, &msta->wcid);
 
        if (dev->pm.enable) {
@@ -360,7 +361,6 @@ static void mt7921_remove_interface(struct ieee80211_hw *hw,
 
        rcu_assign_pointer(dev->mt76.wcid[idx], NULL);
 
-       mt7921_mutex_acquire(dev);
        dev->mt76.vif_mask &= ~BIT(mvif->mt76.idx);
        phy->omac_mask &= ~BIT_ULL(mvif->mt76.omac_idx);
        mt7921_mutex_release(dev);