[PATCH] mt76: mt7915: always call mt7915_wfsys_reset() during init
Ryder Lee
ryder.lee at mediatek.com
Fri Mar 18 21:53:50 PDT 2022
Soft reboot might not clear certain condition, so always call
mt7915_wfsys_reset() during init.
Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
---
drivers/net/wireless/mediatek/mt76/mt7915/init.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
index fd16d777f2e4..666ea7b0d3e5 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
@@ -651,10 +651,7 @@ static int mt7915_init_hardware(struct mt7915_dev *dev)
dev->dbdc_support = mt7915_band_config(dev);
- /* If MCU was already running, it is likely in a bad state */
- if (mt76_get_field(dev, MT_TOP_MISC, MT_TOP_MISC_FW_STATE) >
- FW_STATE_FW_DOWNLOAD)
- mt7915_wfsys_reset(dev);
+ mt7915_wfsys_reset(dev);
ret = mt7915_dma_init(dev);
if (ret)
@@ -663,14 +660,8 @@ static int mt7915_init_hardware(struct mt7915_dev *dev)
set_bit(MT76_STATE_INITIALIZED, &dev->mphy.state);
ret = mt7915_mcu_init(dev);
- if (ret) {
- /* Reset and try again */
- mt7915_wfsys_reset(dev);
-
- ret = mt7915_mcu_init(dev);
- if (ret)
- return ret;
- }
+ if (ret)
+ return ret;
ret = mt7915_eeprom_init(dev);
if (ret < 0)
--
2.29.2
More information about the Linux-mediatek
mailing list