mt76: mt7921: fix dma hang in rmmod
authorDeren Wu <deren.wu@mediatek.com>
Tue, 27 Jul 2021 09:47:09 +0000 (17:47 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:36 +0000 (19:16 +0100)
commitc8c0958687c7ab9fdbb96d31f32b254fcf9b2d06
treeba90fae9cbdeb298408f027d774b6878ec983f89
parent2bfda0a8dc7770bffc2d77b4dfb386b4086f9ccf
mt76: mt7921: fix dma hang in rmmod

[ Upstream commit a23f80aa9c5e6ad4ec8df88037b7ffd4162b1ec4 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/mediatek/mt76/mt7921/init.c