From: Quan Zhou <quan.zhou@xxxxxxxxxxxx> If chip reset worker triggered in remove process, chip dma may not be pushed back to idle state properly. Since chip reset may corrupt the dma flow, stop it before dma finalized. mt7921_mcu_drv_pmctrl() may trigger reset worker, take __mt7921_mcu_drv_pmctrl() instead. Fixes: 033ae79b3830 ("mt76: mt7921: refactor init.c to be bus independent") Signed-off-by: Quan Zhou <quan.zhou@xxxxxxxxxxxx> Signed-off-by: Deren Wu <deren.wu@xxxxxxxxxxxx> --- drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c index 1a8a54a46dcc..c592903157d0 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c @@ -115,9 +115,10 @@ static void mt7921e_unregister_device(struct mt7921_dev *dev) napi_disable(&dev->mt76.napi[i]); cancel_delayed_work_sync(&pm->ps_work); cancel_work_sync(&pm->wake_work); + cancel_work_sync(&dev->reset_work); mt7921_tx_token_put(dev); - mt7921_mcu_drv_pmctrl(dev); + __mt7921_mcu_drv_pmctrl(dev); mt7921_dma_cleanup(dev); mt7921_wfsys_reset(dev); skb_queue_purge(&dev->mt76.mcu.res_q); -- 2.18.0