mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rosen Penev <rosenp@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: Felix Fietkau <nbd@nbd.name>,
	Lorenzo Bianconi <lorenzo@kernel.org>,
	Ryder Lee <ryder.lee@mediatek.com>,
	Shayne Chen <shayne.chen@mediatek.com>,
	Sean Wang <sean.wang@mediatek.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Kalle Valo <kvalo@kernel.org>,
	linux-kernel@vger.kernel.org (open list:ARM/Mediatek SoC support),
	linux-arm-kernel@lists.infradead.org (moderated
	list:ARM/Mediatek SoC support),
	linux-mediatek@lists.infradead.org (moderated list:ARM/Mediatek
	SoC support)
Subject: [PATCH wireless] wifi: mt76: mt76x2u: limit TX A-MSDUs to 3 kB at SuperSpeed
Date: Sat, 24 Oct 2026 13:46:36 -0700	[thread overview]
Message-ID: <20261024204636.23484-1-rosenp@gmail.com> (raw)

At SuperSpeed the MT7612U stops accepting bulk OUT data after it was
sent a TX frame longer than 3072 bytes (TXWI and 802.11 frame, the
TXINFO length). The TX URBs never complete, MCU commands time out
("mt76x02u_mcu_wait_resp failed with -110") and only a power cycle
brings the device back; neither a USB reset nor a host reboot with the
port powered recovers it. Single frames never get that long, but
A-MSDUs of two full-size subframes are 3096 bytes.

Behind a USB 3 hub this happens within seconds of continuous traffic,
plugged in directly within minutes. Frames of up to 3072 bytes, at
MTU 1488, ran for minutes behind the hub, frames of 3080 bytes, at
MTU 1492, wedged the device. At high speed the same A-MSDUs work.

Cap the A-MSDU length for all TIDs when the device runs at SuperSpeed.
This keeps A-MSDUs of smaller frames.

Fixes: ee676cd5017c ("mt76: add driver code for MT76x2u based devices")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 .../net/wireless/mediatek/mt76/mt76x2/usb.c   | 26 ++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
index ade15bddefc5..3e53b357858c 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
@@ -29,6 +29,30 @@ static const struct usb_device_id mt76x2u_device_table[] = {
 	{ },
 };
 
+/* At SuperSpeed the MT7612U wedges its bulk OUT path on TX frames longer
+ * than 3072 bytes (TXWI and 802.11 frame), which only A-MSDUs reach. mt76
+ * adds 22 bytes (TXWI, header padding) to the MPDU, and mac80211 counts
+ * each new subframe up to 11 bytes (LLC header, padding) short, plus the
+ * 14-byte subframe header it adds to the first subframe after the check.
+ */
+#define MT76X2U_SS_MAX_AMSDU_LEN	(3072 - 22 - 11 - 14)
+
+static int mt76x2u_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
+			   struct ieee80211_sta *sta)
+{
+	struct usb_device *udev = interface_to_usbdev(to_usb_interface(mdev->dev));
+	int i;
+
+	if (udev->speed >= USB_SPEED_SUPER) {
+		for (i = 0; i < ARRAY_SIZE(sta->deflink.agg.max_tid_amsdu_len); i++)
+			sta->deflink.agg.max_tid_amsdu_len[i] =
+				MT76X2U_SS_MAX_AMSDU_LEN;
+		ieee80211_sta_recalc_aggregates(sta);
+	}
+
+	return mt76x02_sta_add(mdev, vif, sta);
+}
+
 static int mt76x2u_probe(struct usb_interface *intf,
 			 const struct usb_device_id *id)
 {
@@ -43,7 +67,7 @@ static int mt76x2u_probe(struct usb_interface *intf,
 		.tx_status_data = mt76x02_tx_status_data,
 		.rx_skb = mt76x02_queue_rx_skb,
 		.sta_ps = mt76x02_sta_ps,
-		.sta_add = mt76x02_sta_add,
+		.sta_add = mt76x2u_sta_add,
 		.sta_remove = mt76x02_sta_remove,
 	};
 	struct usb_device *udev = interface_to_usbdev(intf);
-- 
2.56.0


                 reply	other threads:[~2026-10-24 20:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261024204636.23484-1-rosenp@gmail.com \
    --to=rosenp@gmail.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=kvalo@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=nbd@nbd.name \
    --cc=ryder.lee@mediatek.com \
    --cc=sean.wang@mediatek.com \
    --cc=shayne.chen@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®