mt76: mt7921: fix dma hang in rmmod
authorDeren Wu <deren.wu@mediatek.com>
Tue, 27 Jul 2021 09:47:09 +0000 (17:47 +0800)
committerFelix Fietkau <nbd@nbd.name>
Wed, 20 Oct 2021 08:36:32 +0000 (10:36 +0200)
commita23f80aa9c5e6ad4ec8df88037b7ffd4162b1ec4
tree6de540893bd8cac3be3124d1a791a12e0f62cadb
parent33920b2bf04834b286981763686be0bc9f141d40
mt76: mt7921: fix dma hang in rmmod

The dma would be broken after rmmod flow. There are two different
cases causing this issue.
1. dma access without privilege.
2. hw access sequence borken by another context.

This patch handle both cases to avoid hw crash.

Fixes: 2b9ea5a8cf1bd ("mt76: mt7921: add mt7921_dma_cleanup in mt7921_unregister_device")
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7921/init.c