From cc343793ad657e4b21f0bf1e3cae8ec824fb8d7e Mon Sep 17 00:00:00 2001 From: Sean Wang Date: Wed, 18 Feb 2026 18:40:03 -0600 Subject: [PATCH] wifi: mt76: mt792x: ensure MCU ready before ROM patch download 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 Link: https://patch.msgid.link/20260219004007.19733-7-sean.wang@kernel.org Signed-off-by: Felix Fietkau --- mt792x_core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mt792x_core.c b/mt792x_core.c index 9d66aef8..5a5d7534 100644 --- a/mt792x_core.c +++ b/mt792x_core.c @@ -925,6 +925,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;