Skip to content

Commit 3d78c46

Browse files
Quanzhoucennbd168
authored andcommitted
wifi: mt76: mt7921e: stop chip reset worker in unregister hook
If the chip reset worker is triggered during the remove process, the chip DMA may not be properly pushed back to the idle state. This can lead to corruption of the DMA flow due to the chip reset. Therefore, it is necessary to stop the chip reset before the DMA is finalized. To avoid resetting the chip after the reset worker is cancelled, use __mt7921_mcu_drv_pmctrl() instead of mt7921_mcu_drv_pmctrl(). It is safe to ignore the pm mutex because the pm worker and wake worker have already been cancelled. Fixes: 033ae79 ("mt76: mt7921: refactor init.c to be bus independent") Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Co-developed-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Co-developed-by: Wang Zhao <wang.zhao@mediatek.com> Signed-off-by: Wang Zhao <wang.zhao@mediatek.com> Signed-off-by: Quan Zhou <quan.zhou@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
1 parent 87714bf commit 3d78c46

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • drivers/net/wireless/mediatek/mt76/mt7921

drivers/net/wireless/mediatek/mt76/mt7921/pci.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ static void mt7921e_unregister_device(struct mt7921_dev *dev)
113113
napi_disable(&dev->mt76.napi[i]);
114114
cancel_delayed_work_sync(&pm->ps_work);
115115
cancel_work_sync(&pm->wake_work);
116+
cancel_work_sync(&dev->reset_work);
116117

117118
mt7921_tx_token_put(dev);
118-
mt7921_mcu_drv_pmctrl(dev);
119+
__mt7921_mcu_drv_pmctrl(dev);
119120
mt7921_dma_cleanup(dev);
120121
mt7921_wfsys_reset(dev);
121122
skb_queue_purge(&dev->mt76.mcu.res_q);

0 commit comments

Comments
 (0)