]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mt76: mt792x: ensure MCU ready before ROM patch download
authorSean Wang <sean.wang@mediatek.com>
Thu, 19 Feb 2026 00:40:03 +0000 (18:40 -0600)
committerFelix Fietkau <nbd@nbd.name>
Tue, 24 Mar 2026 15:49:29 +0000 (15:49 +0000)
Restart the MCU and poll FW state to ensure correct MCU status
before downloading the ROM patch.

This is a prerequisite for enabling MT7902 PCIe and has been
validated on MT7921 and MT7925 since they share the common code path.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20260219004007.19733-7-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt792x_core.c

index 2142fcc4ae276fc67d7f778d713ccd1e19dd60ee..152cfcca2f908a8101d6dac84e2c462bae3b40d9 100644 (file)
@@ -926,6 +926,13 @@ int mt792x_load_firmware(struct mt792x_dev *dev)
 {
        int ret;
 
+       mt76_connac_mcu_restart(&dev->mt76);
+
+       if (!mt76_poll_msec(dev, MT_CONN_ON_MISC, MT_TOP_MISC_FW_STATE,
+                           MT_TOP_MISC2_FW_PWR_ON, 1000))
+               dev_warn(dev->mt76.dev,
+                        "MCU is not ready for firmware download\n");
+
        ret = mt76_connac2_load_patch(&dev->mt76, mt792x_patch_name(dev));
        if (ret)
                return ret;