wifi: mt76: mt7921u: escalate broken USB transport to device reset

Check the USB control path before running the normal WFSYS reset flow.

If USB access is no longer reliable, stop the WFSYS-only reset path,
mark the device as bus_hung, and queue a USB device reset instead.

Reuse the existing bus_hung state to represent transport-level failure,
keeping the semantics consistent with the SDIO path.

Also initialize bus_hung explicitly during probe for consistency.

Reported-by: Bryam Vargas <[email protected]>
Closes: https://lore.kernel.org/r/CANAPQziOh3sB7B8G+U3AZsFfeFN1uAg4munhwA_feZi56D7W+Q@mail.gmail.com
Signed-off-by: Sean Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Sean Wang
2026-06-02 13:22:04 +02:00
committed by Felix Fietkau
parent 600dbf1233
commit 91f19ba393
4 changed files with 35 additions and 1 deletions
+26
View File
@@ -60,6 +60,32 @@ int mt792xu_check_bus(struct mt792x_dev *dev)
}
EXPORT_SYMBOL_GPL(mt792xu_check_bus);
int mt792xu_reset_on_bus_error(struct mt792x_dev *dev)
{
int err = 0;
if (!atomic_read(&dev->mt76.bus_hung))
err = mt792xu_check_bus(dev);
if (err) {
atomic_set(&dev->mt76.bus_hung, true);
if (!atomic_xchg(&dev->usb_reset_pending, 1)) {
dev_warn(dev->mt76.dev,
"USB transport access failed (%d), queueing device reset\n",
err);
schedule_work(&dev->usb_reset_work);
}
return err;
}
atomic_set(&dev->mt76.bus_hung, false);
return 0;
}
EXPORT_SYMBOL_GPL(mt792xu_reset_on_bus_error);
u32 mt792xu_rr(struct mt76_dev *dev, u32 addr)
{
u32 ret;