|
| 1 | +From ceb3262db91a4065437ccdf4f7bec2e56d4eb05c Mon Sep 17 00:00:00 2001 |
| 2 | +From: David Bauer < [email protected]> |
| 3 | +Date: Mon, 13 Jan 2025 09:06:06 +0100 |
| 4 | +Subject: [PATCH] mt76: import MT7915 recovery fixes |
| 5 | + |
| 6 | +--- |
| 7 | + ...10-mt76-import-MT7915-recovery-fixes.patch | 143 ++++++++++++++++++ |
| 8 | + 1 file changed, 143 insertions(+) |
| 9 | + create mode 100644 patches/openwrt/0010-mt76-import-MT7915-recovery-fixes.patch |
| 10 | + |
| 11 | +diff --git a/patches/openwrt/0010-mt76-import-MT7915-recovery-fixes.patch b/patches/openwrt/0010-mt76-import-MT7915-recovery-fixes.patch |
| 12 | +new file mode 100644 |
| 13 | +index 0000000000..6eaf2da555 |
| 14 | +--- /dev/null |
| 15 | ++++ b/patches/openwrt/0010-mt76-import-MT7915-recovery-fixes.patch |
| 16 | +@@ -0,0 +1,143 @@ |
| 17 | ++From: David Bauer <[email protected]> |
| 18 | ++Date: Mon, 13 Jan 2025 11:52:37 +0100 |
| 19 | ++Subject: mt76: import MT7915 recovery fixes |
| 20 | ++ |
| 21 | ++diff --git a/package/kernel/mt76/patches/0001-mt7915-mcu-lower-default-timeout.patch b/package/kernel/mt76/patches/0001-mt7915-mcu-lower-default-timeout.patch |
| 22 | ++new file mode 100644 |
| 23 | ++index 0000000000000000000000000000000000000000..f05d6b830f6c323e8e0dce4ebaf1cc9689f43c86 |
| 24 | ++--- /dev/null |
| 25 | +++++ b/package/kernel/mt76/patches/0001-mt7915-mcu-lower-default-timeout.patch |
| 26 | ++@@ -0,0 +1,32 @@ |
| 27 | +++From 0a577333e89f49fd29f07b70d4d865d221451ac0 Mon Sep 17 00:00:00 2001 |
| 28 | +++From: David Bauer <[email protected]> |
| 29 | +++Date: Mon, 13 Jan 2025 08:48:41 +0100 |
| 30 | +++Subject: [PATCH 1/3] mt7915: mcu: lower default timeout |
| 31 | +++ |
| 32 | +++The default timeout set in mt76_connac2_mcu_fill_message of 20 seconds |
| 33 | +++leads to excessive stalling in case messages are lost. |
| 34 | +++ |
| 35 | +++Testing showed that a much smaller timeout of 3 seconds is sufficient |
| 36 | +++in normal operation. |
| 37 | +++ |
| 38 | +++Signed-off-by: David Bauer <[email protected]> |
| 39 | +++--- |
| 40 | +++ mt7915/mcu.c | 2 ++ |
| 41 | +++ 1 file changed, 2 insertions(+) |
| 42 | +++ |
| 43 | +++diff --git a/mt7915/mcu.c b/mt7915/mcu.c |
| 44 | +++index 9d790f23..809d8f99 100644 |
| 45 | +++--- a/mt7915/mcu.c |
| 46 | ++++++ b/mt7915/mcu.c |
| 47 | +++@@ -197,6 +197,8 @@ mt7915_mcu_parse_response(struct mt76_dev *mdev, int cmd, |
| 48 | +++ static void |
| 49 | +++ mt7915_mcu_set_timeout(struct mt76_dev *mdev, int cmd) |
| 50 | +++ { |
| 51 | ++++ mdev->mcu.timeout = 3 * HZ; |
| 52 | ++++ |
| 53 | +++ if ((cmd & __MCU_CMD_FIELD_ID) != MCU_CMD_EXT_CID) |
| 54 | +++ return; |
| 55 | +++ |
| 56 | +++-- |
| 57 | +++2.45.2 |
| 58 | +++ |
| 59 | ++diff --git a/package/kernel/mt76/patches/0002-mt7915-mcu-increase-command-timeout.patch b/package/kernel/mt76/patches/0002-mt7915-mcu-increase-command-timeout.patch |
| 60 | ++new file mode 100644 |
| 61 | ++index 0000000000000000000000000000000000000000..2aedb9fd791912dd2800074762e316ad27f41d90 |
| 62 | ++--- /dev/null |
| 63 | +++++ b/package/kernel/mt76/patches/0002-mt7915-mcu-increase-command-timeout.patch |
| 64 | ++@@ -0,0 +1,34 @@ |
| 65 | +++From 49894f4ce805ccb73fe0a09c53ffcc8aeaf712b5 Mon Sep 17 00:00:00 2001 |
| 66 | +++From: David Bauer <[email protected]> |
| 67 | +++Date: Mon, 13 Jan 2025 08:51:30 +0100 |
| 68 | +++Subject: [PATCH 2/3] mt7915: mcu: increase command timeout |
| 69 | +++ |
| 70 | +++Increase the timeout for MCU_EXT_CMD_EFUSE_BUFFER_MODE as |
| 71 | +++well as MCU_EXT_CMD_TXBF_ACTION command types. |
| 72 | +++ |
| 73 | +++Regular retries upon hardware-recovery have been observed. Increasing |
| 74 | +++the timeout slightly remedies this problem. |
| 75 | +++ |
| 76 | +++Signed-off-by: David Bauer <[email protected]> |
| 77 | +++--- |
| 78 | +++ mt7915/mcu.c | 4 ++++ |
| 79 | +++ 1 file changed, 4 insertions(+) |
| 80 | +++ |
| 81 | +++diff --git a/mt7915/mcu.c b/mt7915/mcu.c |
| 82 | +++index 809d8f99..f3e9f9f0 100644 |
| 83 | +++--- a/mt7915/mcu.c |
| 84 | ++++++ b/mt7915/mcu.c |
| 85 | +++@@ -210,6 +210,10 @@ mt7915_mcu_set_timeout(struct mt76_dev *mdev, int cmd) |
| 86 | +++ case MCU_EXT_CMD_BSS_INFO_UPDATE: |
| 87 | +++ mdev->mcu.timeout = 2 * HZ; |
| 88 | +++ return; |
| 89 | ++++ case MCU_EXT_CMD_EFUSE_BUFFER_MODE: |
| 90 | ++++ case MCU_EXT_CMD_TXBF_ACTION: |
| 91 | ++++ mdev->mcu.timeout = 5 * HZ; |
| 92 | ++++ return; |
| 93 | +++ default: |
| 94 | +++ break; |
| 95 | +++ } |
| 96 | +++-- |
| 97 | +++2.45.2 |
| 98 | +++ |
| 99 | ++diff --git a/package/kernel/mt76/patches/0003-mt7915-mcu-re-init-MCU-before-loading-FW-patch.patch b/package/kernel/mt76/patches/0003-mt7915-mcu-re-init-MCU-before-loading-FW-patch.patch |
| 100 | ++new file mode 100644 |
| 101 | ++index 0000000000000000000000000000000000000000..c97d4b1d6fd61f3c231dee6971dd019561c313f3 |
| 102 | ++--- /dev/null |
| 103 | +++++ b/package/kernel/mt76/patches/0003-mt7915-mcu-re-init-MCU-before-loading-FW-patch.patch |
| 104 | ++@@ -0,0 +1,55 @@ |
| 105 | +++From 1177b55da6fbc3d095383b3bcfe4ac741985dbff Mon Sep 17 00:00:00 2001 |
| 106 | +++From: David Bauer <[email protected]> |
| 107 | +++Date: Sun, 12 Jan 2025 15:30:54 +0100 |
| 108 | +++Subject: [PATCH 3/3] mt7915: mcu: re-init MCU before loading FW patch |
| 109 | +++ |
| 110 | +++Restart the MCU and release the patch semaphore before loading the MCU |
| 111 | +++patch firmware from the host. |
| 112 | +++ |
| 113 | +++This fixes failures upon error recovery in case the semaphore was |
| 114 | +++previously taken and never released by the host. |
| 115 | +++ |
| 116 | +++Signed-off-by: David Bauer <[email protected]> |
| 117 | +++--- |
| 118 | +++ mt7915/mcu.c | 25 +++++++++++++++---------- |
| 119 | +++ 1 file changed, 15 insertions(+), 10 deletions(-) |
| 120 | +++ |
| 121 | +++diff --git a/mt7915/mcu.c b/mt7915/mcu.c |
| 122 | +++index f3e9f9f0..e03292a8 100644 |
| 123 | +++--- a/mt7915/mcu.c |
| 124 | ++++++ b/mt7915/mcu.c |
| 125 | +++@@ -2098,16 +2098,21 @@ static int mt7915_load_firmware(struct mt7915_dev *dev) |
| 126 | +++ { |
| 127 | +++ int ret; |
| 128 | +++ |
| 129 | +++- /* make sure fw is download state */ |
| 130 | +++- if (mt7915_firmware_state(dev, false)) { |
| 131 | +++- /* restart firmware once */ |
| 132 | +++- mt76_connac_mcu_restart(&dev->mt76); |
| 133 | +++- ret = mt7915_firmware_state(dev, false); |
| 134 | +++- if (ret) { |
| 135 | +++- dev_err(dev->mt76.dev, |
| 136 | +++- "Firmware is not ready for download\n"); |
| 137 | +++- return ret; |
| 138 | +++- } |
| 139 | ++++ /* Release Semaphore if taken by previous failed attempt */ |
| 140 | ++++ ret = mt76_connac_mcu_patch_sem_ctrl(&dev->mt76, false); |
| 141 | ++++ if (ret != PATCH_REL_SEM_SUCCESS) { |
| 142 | ++++ dev_err(dev->mt76.dev, "Could not release semaphore\n"); |
| 143 | ++++ /* Continue anyways */ |
| 144 | ++++ } |
| 145 | ++++ |
| 146 | ++++ /* Always restart MCU firmware */ |
| 147 | ++++ mt76_connac_mcu_restart(&dev->mt76); |
| 148 | ++++ |
| 149 | ++++ /* Check if MCU is ready */ |
| 150 | ++++ ret = mt7915_firmware_state(dev, false); |
| 151 | ++++ if (ret) { |
| 152 | ++++ dev_err(dev->mt76.dev, "Firmware did not enter download state\n"); |
| 153 | ++++ return ret; |
| 154 | +++ } |
| 155 | +++ |
| 156 | +++ ret = mt76_connac2_load_patch(&dev->mt76, fw_name_var(dev, ROM_PATCH)); |
| 157 | +++-- |
| 158 | +++2.45.2 |
| 159 | +++ |
0 commit comments