From 4f2aa9910e0c61ad9a16f22aefb4dc515ea27582 Mon Sep 17 00:00:00 2001 From: Devin Wittmayer Date: Sun, 9 Aug 2026 13:55:59 -0700 Subject: [PATCH] wifi: mt76: mt7925: check drv_pmctrl return in the PCIe reset path mt7925e_mac_reset() ignores the return value of mt792xe_mcu_drv_pmctrl(), unlike the two pmctrl calls later in the same function. 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 calls mt7925_run_firmware() on a chip the driver does not own. Return the error instead. The call is the first statement in the function, before MT76_RESET is set and before the TX worker and NAPI are disabled, so nothing needs unwinding. Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips") Signed-off-by: Devin Wittmayer Link: https://patch.msgid.link/20260809205559.32116-1-lucid_duck@justthetip.ca Signed-off-by: Felix Fietkau --- mt7925/pci_mac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mt7925/pci_mac.c b/mt7925/pci_mac.c index 8477d21a..280797fa 100644 --- a/mt7925/pci_mac.c +++ b/mt7925/pci_mac.c @@ -73,7 +73,9 @@ int mt7925e_mac_reset(struct mt792x_dev *dev) const struct mt792x_irq_map *irq_map = dev->irq_map; 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);