Skip to content

Commit 066f417

Browse files
Quanzhoucennbd168
authored andcommitted
wifi: mt76: mt792x: fix wifi init fail by setting MCU_RUNNING after CLC load
Set the MT76_STATE_MCU_RUNNING bit only after mt7921_load_clc() has successfully completed. Previously, the MCU_RUNNING state was set before loading CLC, which could cause conflict between chip mcu_init retry and mac_reset flow, result in chip init fail and chip abnormal status. By moving the state set after CLC load, firmware initialization becomes robust and resolves init fail issue. Signed-off-by: Quan Zhou <quan.zhou@mediatek.com> Reviewed-by: druth@chromium.org Link: https://patch.msgid.link/19ec8e4465142e774f17801025accd0ae2214092.1763465933.git.quan.zhou@mediatek.com Signed-off-by: Felix Fietkau <nbd@nbd.name>
1 parent f804a58 commit 066f417

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

  • drivers/net/wireless/mediatek/mt76

drivers/net/wireless/mediatek/mt76/mt7921/mcu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,10 +646,10 @@ int mt7921_run_firmware(struct mt792x_dev *dev)
646646
if (err)
647647
return err;
648648

649-
set_bit(MT76_STATE_MCU_RUNNING, &dev->mphy.state);
650649
err = mt7921_load_clc(dev, mt792x_ram_name(dev));
651650
if (err)
652651
return err;
652+
set_bit(MT76_STATE_MCU_RUNNING, &dev->mphy.state);
653653

654654
return mt7921_mcu_fw_log_2_host(dev, 1);
655655
}

drivers/net/wireless/mediatek/mt76/mt7925/mcu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,10 +1054,10 @@ int mt7925_run_firmware(struct mt792x_dev *dev)
10541054
if (err)
10551055
return err;
10561056

1057-
set_bit(MT76_STATE_MCU_RUNNING, &dev->mphy.state);
10581057
err = mt7925_load_clc(dev, mt792x_ram_name(dev));
10591058
if (err)
10601059
return err;
1060+
set_bit(MT76_STATE_MCU_RUNNING, &dev->mphy.state);
10611061

10621062
return mt7925_mcu_fw_log_2_host(dev, 1);
10631063
}

0 commit comments

Comments
 (0)