Skip to contentSkip to conversation

mt76: mt7921: continue to probe driver when fw already downloaded

PATCH Applied Aaron Ma 3 participants 3 messages Jul 8, 2021

Subsystems (4)
lore
Share & tools
lore

Aaron Ma

author
#0 lore raw

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

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.

---
 drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +2 -1
index c2c4dc196802..cd690c64f65b 100644
@@ -931,7 +931,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);
@@ -949,6 +949,7 @@ static int mt7921_load_firmware(struct mt7921_dev *dev)
 		return -EIO;
 	}
 
+fw_loaded:
 	mt76_queue_tx_cleanup(dev, dev->mt76.q_mcu[MT_MCUQ_FWDL], false);
 
 #ifdef CONFIG_PM
Signature · 1 line
2.32.0
#1 lore raw

Hi Aaron,

Thanks for this patch. We verified this is good here.

Could you please add fix tag as well? It's better to backport this patch.

Fixes 1c099ab44727c ("mt76: mt7921: add MCU support")

Thanks,
Deren

Quoted 38 lines · Aaron Ma

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.

---
 drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +1 -1
index c2c4dc196802..cd690c64f65b 100644
@@ -931,7 +931,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;
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +1 -0
 	}
 
 	ret = mt7921_load_patch(dev);
@@ -949,6 +949,7 @@ static int mt7921_load_firmware(struct mt7921_dev
 *dev)
 		return -EIO;
 	}
 
+fw_loaded:
 	mt76_queue_tx_cleanup(dev, dev->mt76.q_mcu[MT_MCUQ_FWDL],
 false);

#ifdef CONFIG_PM

#2 lore raw
In reply to Aaron Ma
This patch was applied to netdev/net.git (refs/heads/master):

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

Quoted 9 lines · On Thu, 8 Jul 2021 21:17:10 +0800 you wrote:

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.

[...]

Here is the summary with links:
- mt76: mt7921: continue to probe driver when fw already downloaded

    https://git.kernel.org/netdev/net/c/c34269041185

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html