Skip to content

Commit

Permalink
mt76: mt7921: continue to probe driver when fw already downloaded
Browse files Browse the repository at this point in the history
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@canonical.com>
Fixes: 1c099ab ("mt76: mt7921: add MCU support")
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c342690)
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
  • Loading branch information
Aaron Ma authored and Timo Aaltonen committed Jul 28, 2021
1 parent aad5b7e commit 1ed418e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -928,6 +928,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
Expand Down

0 comments on commit 1ed418e

Please sign in to comment.