public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: sean.wang@kernel.org
To: nbd@nbd.name, lorenzo.bianconi@redhat.com
Cc: linux-wireless@vger.kernel.org,
	linux-mediatek@lists.infradead.org,
	Sean Wang <sean.wang@mediatek.com>
Subject: [PATCH 07/11] wifi: mt76: mt792x: ensure MCU ready before ROM patch download
Date: Wed, 18 Feb 2026 18:40:03 -0600	[thread overview]
Message-ID: <20260219004007.19733-7-sean.wang@kernel.org> (raw)
In-Reply-To: <20260219004007.19733-1-sean.wang@kernel.org>

From: Sean Wang <sean.wang@mediatek.com>

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>
---
 drivers/net/wireless/mediatek/mt76/mt792x_core.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/wireless/mediatek/mt76/mt792x_core.c b/drivers/net/wireless/mediatek/mt76/mt792x_core.c
index 2142fcc4ae27..152cfcca2f90 100644
--- a/drivers/net/wireless/mediatek/mt76/mt792x_core.c
+++ b/drivers/net/wireless/mediatek/mt76/mt792x_core.c
@@ -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;
-- 
2.43.0


  parent reply	other threads:[~2026-02-19  0:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-19  0:39 [PATCH 01/11] wifi: mt76: connac: use is_connac2() to replace is_mt7921() checks sean.wang
2026-02-19  0:39 ` [PATCH 02/11] wifi: mt76: mt7921: use mt76_for_each_q_rx() in reset path sean.wang
2026-02-19  0:39 ` [PATCH 03/11] wifi: mt76: mt7921: handle MT7902 irq_map quirk with mutable copy sean.wang
2026-02-20 10:09   ` Philip Müller
2026-02-20 18:39     ` Sean Wang
2026-02-19  0:40 ` [PATCH 04/11] wifi: mt76: mt7921: add MT7902e DMA layout support sean.wang
2026-02-19  0:40 ` [PATCH 05/11] wifi: mt76: connac: mark MT7902 as hw txp devices sean.wang
2026-02-19  0:40 ` [PATCH 06/11] wifi: mt76: mt792x: add PSE handling barrier for the large MCU cmd sean.wang
2026-02-19  0:40 ` sean.wang [this message]
2026-02-19  0:40 ` [PATCH 08/11] wifi: mt76: mt7921: add MT7902 MCU support sean.wang
2026-02-19  0:40 ` [PATCH 09/11] wifi: mt76: mt792x: add MT7902 WFDMA prefetch configuration sean.wang
2026-02-19  0:40 ` [PATCH 10/11] wifi: mt76: mt7921: add MT7902 PCIe device support sean.wang
2026-02-19  0:40 ` [PATCH 11/11] wifi: mt76: mt7921: add MT7902 SDIO " sean.wang
2026-02-20 20:41 ` [PATCH 01/11] wifi: mt76: connac: use is_connac2() to replace is_mt7921() checks Philip Müller
2026-02-21 20:19   ` Sean Wang
2026-03-22  8:04     ` Philip Müller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260219004007.19733-7-sean.wang@kernel.org \
    --to=sean.wang@kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=nbd@nbd.name \
    --cc=sean.wang@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox