[PATCH 1/2] mt76: connac: fix txpower_cur not updated in mt76_connac_mcu_set_rate_txpower()
Sean Wang
sean.wang at kernel.org
Sun Mar 8 23:01:20 PDT 2026
On Fri, Feb 27, 2026 at 3:58 AM bryam vargas
<bryamestebanvargas at gmail.com> wrote:
>
> [PATCH 2/2] mt76: mt7921u: add USB reset on SEFI chip recovery
> From 86976b5908219204f7719d947fd6c5f1c5e11c7f Mon Sep 17 00:00:00 2001
> From: bryam <bryamestebanvargas at gmail.com>
> Date: Fri, 27 Feb 2026 04:30:01 -0500
> Subject: [PATCH 2/2] mt76: mt7921u: add USB reset on SEFI chip recovery
>
> The MT7921U chip is susceptible to Single Event Functional Interrupts
> (SEFIs) caused by cosmic radiation, particularly at high altitudes.
> When a SEFI occurs, the chip becomes unresponsive and requires a USB
> reset to recover.
>
> Add usb_queue_reset_device() calls in the SEFI detection path to
> trigger automatic recovery instead of leaving the interface hung.
>
> Tested-on: Minisforum NAB9 (MT7921U USB adapter) at 2400m altitude,
> Bogotá, Colombia. Cosmic radiation causes periodic SEFI
> events; USB reset restores connectivity without intervention.
>
> Signed-off-by: Bryam Vargas <bryamestebanvargas at gmail.com>
> ---
> drivers/net/wireless/mediatek/mt76/mt7921/usb.c | 12 ++++++++++++
> drivers/net/wireless/mediatek/mt76/mt792x_usb.c | 10 ++++++++++
> 2 files changed, 22 insertions(+)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/usb.c
> b/drivers/net/wireless/mediatek/mt76/mt7921/usb.c
> index 100bdba..8c8c78f 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/usb.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/usb.c
> @@ -86,6 +86,7 @@ static int mt7921u_mcu_init(struct mt792x_dev *dev)
>
> static int mt7921u_mac_reset(struct mt792x_dev *dev)
> {
> + struct usb_interface *intf = to_usb_interface(dev->mt76.dev);
> int err;
>
> mt76_txq_schedule_all(&dev->mphy);
> @@ -100,6 +101,17 @@ static int mt7921u_mac_reset(struct mt792x_dev *dev)
> mt76u_stop_rx(&dev->mt76);
> mt76u_stop_tx(&dev->mt76);
>
> + /* When the chip enters a latched state (SEFI - Single Event
> + * Functional Interrupt, e.g. from cosmic radiation at altitude),
> + * all register writes over USB become silent no-ops.
> + * usb_queue_reset_device() electrically resets the chip via the
> + * USB hub regardless of internal state -- identical to probe().
> + * Async variant required to avoid deadlock in workqueue context.
> + */
> + dev_warn(dev->mt76.dev,
> + "mt7921u: scheduling USB reset for chip recovery\n");
> + usb_queue_reset_device(intf);
Hi,
usb_queue_reset_device() is asynchronous. After scheduling the reset,
the driver continues the normal reset flow and still performs reset
operations on the same device, which creates race conditions.
Also, mt792xu_init_reset() also assumes the USB bus is still
functioning, since it relies on normal USB transactions to reset
WFSYS.
A USB reset should be triggered only after detecting USB transaction
errors or after repeated mt792xu_init_reset() failures.
In this case then we could try triggering a USB reset in software to
see if the USB bus can recover.
Thanks.
> +
> mt792xu_wfsys_reset(dev);
>
> clear_bit(MT76_MCU_RESET, &dev->mphy.state);
> diff --git a/drivers/net/wireless/mediatek/mt76/mt792x_usb.c
> b/drivers/net/wireless/mediatek/mt76/mt792x_usb.c
> index 76272a0..cfd385e 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt792x_usb.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt792x_usb.c
> @@ -269,6 +269,8 @@ EXPORT_SYMBOL_GPL(mt792xu_wfsys_reset);
>
> int mt792xu_init_reset(struct mt792x_dev *dev)
> {
> + struct usb_interface *intf = to_usb_interface(dev->mt76.dev);
> +
> set_bit(MT76_RESET, &dev->mphy.state);
>
> wake_up(&dev->mt76.mcu.wait);
> @@ -277,6 +279,14 @@ int mt792xu_init_reset(struct mt792x_dev *dev)
> mt76u_stop_rx(&dev->mt76);
> mt76u_stop_tx(&dev->mt76);
>
> + /* Same rationale as mt7921u_mac_reset(): if the chip is in a
> + * latched state (SEFI), register writes over USB are no-ops.
> + * Schedule a USB port reset before software reset sequence.
> + */
> + dev_warn(dev->mt76.dev,
> + "mt7921u: scheduling USB device reset (init_reset path)\n");
> + usb_queue_reset_device(intf);
> +
> mt792xu_wfsys_reset(dev);
>
> clear_bit(MT76_RESET, &dev->mphy.state);
> --
> 2.43.0
>
More information about the Linux-mediatek
mailing list