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 <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20260219004007.19733-7-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Sean Wang 2026-02-18 18:40:03 -06:00 committed by Felix Fietkau
parent 14a7ba034f
commit 9eef868b86

View 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;