Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mt76 mt7915: restart target on MCU timeout #3212

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions patches/openwrt/0009-mt7915-restart-target-on-MCU-timeout.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
From: David Bauer <[email protected]>
Date: Sat, 2 Mar 2024 23:22:13 +0100
Subject: mt7915: restart target on MCU timeout

Signed-off-by: David Bauer <[email protected]>

diff --git a/package/kernel/mt76/patches/100-mt7915-trigger-reset-upon-MCU-timeout.patch b/package/kernel/mt76/patches/100-mt7915-trigger-reset-upon-MCU-timeout.patch
new file mode 100644
index 0000000000000000000000000000000000000000..93a1807314df519749cf13da4e7e69be9ac145e3
--- /dev/null
+++ b/package/kernel/mt76/patches/100-mt7915-trigger-reset-upon-MCU-timeout.patch
@@ -0,0 +1,32 @@
+From 031d12d6f6a37d53ba0d8f26e0103d70a925d4eb Mon Sep 17 00:00:00 2001
+From: David Bauer <[email protected]>
+Date: Sat, 2 Mar 2024 21:23:06 +0100
+Subject: [PATCH] mt7915: trigger reset upon MCU timeout
+
+---
+ mt7915/mcu.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/mt7915/mcu.c b/mt7915/mcu.c
+index 8224f8be..590a8b24 100644
+--- a/mt7915/mcu.c
++++ b/mt7915/mcu.c
+@@ -157,12 +157,15 @@ static int
+ mt7915_mcu_parse_response(struct mt76_dev *mdev, int cmd,
+ struct sk_buff *skb, int seq)
+ {
++ struct mt7915_dev *dev = container_of(mdev, struct mt7915_dev, mt76);
+ struct mt76_connac2_mcu_rxd *rxd;
+ int ret = 0;
+
+ if (!skb) {
+ dev_err(mdev->dev, "Message %08x (seq %d) timeout\n",
+ cmd, seq);
++ dev->recovery.state |= MT_MCU_CMD_WDT_MASK;
++ mt7915_reset(dev);
+ return -ETIMEDOUT;
+ }
+
+--
+2.43.0
+
Loading