mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: mt7996: reset device after MCU message timeout
Trigger a full reset after MCU message timeout. Signed-off-by: Chad Monroe <[email protected]> Link: https://patch.msgid.link/6e05ed063f3763ad3457633c56b60a728a49a6f0.1765203753.git.chad@monroe.io Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
db0460d663
commit
07ae843cd4
@@ -2709,6 +2709,11 @@ void mt7996_reset(struct mt7996_dev *dev)
|
||||
return;
|
||||
}
|
||||
|
||||
if (READ_ONCE(dev->recovery.state) & MT_MCU_CMD_STOP_DMA) {
|
||||
set_bit(MT76_MCU_RESET, &dev->mphy.state);
|
||||
wake_up(&dev->mt76.mcu.wait);
|
||||
}
|
||||
|
||||
queue_work(dev->mt76.wq, &dev->reset_work);
|
||||
wake_up(&dev->reset_wait);
|
||||
}
|
||||
|
||||
@@ -209,6 +209,7 @@ static int
|
||||
mt7996_mcu_parse_response(struct mt76_dev *mdev, int cmd,
|
||||
struct sk_buff *skb, int seq)
|
||||
{
|
||||
struct mt7996_dev *dev = container_of(mdev, struct mt7996_dev, mt76);
|
||||
struct mt7996_mcu_rxd *rxd;
|
||||
struct mt7996_mcu_uni_event *event;
|
||||
int mcu_cmd = FIELD_GET(__MCU_CMD_FIELD_ID, cmd);
|
||||
@@ -217,6 +218,14 @@ mt7996_mcu_parse_response(struct mt76_dev *mdev, int cmd,
|
||||
if (!skb) {
|
||||
dev_err(mdev->dev, "Message %08x (seq %d) timeout\n",
|
||||
cmd, seq);
|
||||
|
||||
if (!test_and_set_bit(MT76_MCU_RESET, &dev->mphy.state)) {
|
||||
dev->recovery.restart = true;
|
||||
wake_up(&dev->mt76.mcu.wait);
|
||||
queue_work(dev->mt76.wq, &dev->reset_work);
|
||||
wake_up(&dev->reset_wait);
|
||||
}
|
||||
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user