mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: mt7996: Fix NPU stop procedure
Move mt7996_npu_hw_stop routine before disabling rx NAPIs in order to
fix NPU stop procedure used during device L1 SER recovery.
Add missing usleep_range in mt7996_npu_hw_stop().
Fixes: 377aa17d2aedc ("wifi: mt76: mt7996: Add NPU offload support to MT7996 driver")
Tested-by: Kang Yang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
7dd72bbd6f
commit
e992ff8842
+1
-2
@@ -2503,6 +2503,7 @@ void mt7996_mac_reset_work(struct work_struct *work)
|
||||
if (mtk_wed_device_active(&dev->mt76.mmio.wed))
|
||||
mtk_wed_device_stop(&dev->mt76.mmio.wed);
|
||||
|
||||
mt7996_npu_hw_stop(dev);
|
||||
ieee80211_stop_queues(mt76_hw(dev));
|
||||
|
||||
set_bit(MT76_RESET, &dev->mphy.state);
|
||||
@@ -2529,8 +2530,6 @@ void mt7996_mac_reset_work(struct work_struct *work)
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
|
||||
mt7996_npu_hw_stop(dev);
|
||||
|
||||
mt76_wr(dev, MT_MCU_INT_EVENT, MT_MCU_INT_EVENT_DMA_STOPPED);
|
||||
|
||||
if (mt7996_wait_reset_state(dev, MT_MCU_CMD_RESET_DONE)) {
|
||||
|
||||
+14
-9
@@ -320,33 +320,38 @@ unlock:
|
||||
int mt7996_npu_hw_stop(struct mt7996_dev *dev)
|
||||
{
|
||||
struct airoha_npu *npu;
|
||||
int i, err;
|
||||
int i, err = 0;
|
||||
u32 info;
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
|
||||
npu = rcu_dereference_protected(dev->mt76.mmio.npu, &dev->mt76.mutex);
|
||||
if (!npu)
|
||||
return 0;
|
||||
goto unlock;
|
||||
|
||||
err = mt76_npu_send_msg(npu, 4, WLAN_FUNC_SET_WAIT_INODE_TXRX_REG_ADDR,
|
||||
0, GFP_KERNEL);
|
||||
if (err)
|
||||
return err;
|
||||
goto unlock;
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
err = mt76_npu_get_msg(npu, 3, WLAN_FUNC_GET_WAIT_NPU_INFO,
|
||||
&info, GFP_KERNEL);
|
||||
if (err)
|
||||
continue;
|
||||
if (!err && !info)
|
||||
break;
|
||||
|
||||
if (info) {
|
||||
err = -ETIMEDOUT;
|
||||
continue;
|
||||
}
|
||||
err = -ETIMEDOUT;
|
||||
usleep_range(10000, 15000);
|
||||
}
|
||||
|
||||
if (!err)
|
||||
err = mt76_npu_send_msg(npu, 6,
|
||||
WLAN_FUNC_SET_WAIT_INODE_TXRX_REG_ADDR,
|
||||
0, GFP_KERNEL);
|
||||
else
|
||||
dev_err(dev->mt76.dev, "npu stop failed\n");
|
||||
unlock:
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user