From 8e856ad93d3af52224a9e369a62181626efc2a42 Mon Sep 17 00:00:00 2001 From: Devin Wittmayer Date: Sat, 8 Aug 2026 18:23:09 -0700 Subject: [PATCH] wifi: mt76: mt7921: check drv_pmctrl return in the PCIe reset path mt7921e_mac_reset() ignores the return value of mt792xe_mcu_drv_pmctrl(). When the driver-own handshake fails, __mt792xe_mcu_drv_pmctrl() returns -EIO without reinitialising WPDMA or clearing MT76_STATE_PM, and the reset carries on: it writes the interrupt enable registers, cycles NAPI, resets WPDMA and downloads firmware to a chip the driver does not own. Return the error instead. The call is the first statement in the function, before any teardown, so nothing needs unwinding. Reported-by: moosager Link: https://lore.kernel.org/linux-wireless/anG46qbvCqCHGF-f@fedora.fritz.box/ Fixes: dfc7743de1eb ("mt76: mt7921: refactor mcu.c to be bus independent") Signed-off-by: Devin Wittmayer Tested-by: moosager Link: https://patch.msgid.link/20260809012309.43657-1-lucid_duck@justthetip.ca Signed-off-by: Felix Fietkau --- mt7921/pci_mac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mt7921/pci_mac.c b/mt7921/pci_mac.c index 98b3469a..d5c33a0d 100644 --- a/mt7921/pci_mac.c +++ b/mt7921/pci_mac.c @@ -57,7 +57,9 @@ int mt7921e_mac_reset(struct mt792x_dev *dev) { int i, err; - mt792xe_mcu_drv_pmctrl(dev); + err = mt792xe_mcu_drv_pmctrl(dev); + if (err) + return err; mt76_connac_free_pending_tx_skbs(&dev->pm, NULL);