[PATCH 1/1] mt76: mt7921: continue to probe driver when fw already downloaded

Aaron Ma aaron.ma at canonical.com
Mon Jul 19 09:07:01 UTC 2021

BugLink: https://bugs.launchpad.net/bugs/1936790

When reboot system, no power cycles, firmware is already downloaded,
return -EIO will break driver as error:
mt7921e: probe of 0000:03:00.0 failed with error -5

Skip firmware download and continue to probe.

Signed-off-by: Aaron Ma <aaron.ma at canonical.com>
Fixes: 1c099ab44727c ("mt76: mt7921: add MCU support")
Signed-off-by: David S. Miller <davem at davemloft.net>
(cherry picked from commit c34269041185dad1bab7a34f42ef9fab967a1684)
Signed-off-by: Aaron Ma <aaron.ma at canonical.com>
 drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
index 67dc4b4cc094..f7459ad2a073 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
@@ -910,7 +910,7 @@ static int mt7921_load_firmware(struct mt7921_dev *dev)
 	ret = mt76_get_field(dev, MT_CONN_ON_MISC, MT_TOP_MISC2_FW_N9_RDY);
 	if (ret) {
 		dev_dbg(dev->mt76.dev, "Firmware is already download\n");
-		return -EIO;
+		goto fw_loaded;
 	ret = mt7921_load_patch(dev);
@@ -928,6 +928,7 @@ static int mt7921_load_firmware(struct mt7921_dev *dev)
 		return -EIO;
 	mt76_queue_tx_cleanup(dev, dev->mt76.q_mcu[MT_MCUQ_FWDL], false);
 #ifdef CONFIG_PM

More information about the kernel-team mailing list