Commit 898422c1 authored by Sean Wang's avatar Sean Wang Committed by Felix Fietkau

mt76: mt7921s: clear MT76_STATE_MCU_RUNNING immediately after reset

clear the flag MT76_STATE_MCU_RUNNING immediately after reset to indicate
the MCU has already stopped working at the point. That is a preliminary
patch for the following patch to perform the register access in the
remaining reset handler using SDIO mailbox way instead of MCU command
because the RAM firmware is cleared out.
Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 491e3731
...@@ -60,6 +60,8 @@ int mt7921s_wfsys_reset(struct mt7921_dev *dev) ...@@ -60,6 +60,8 @@ int mt7921s_wfsys_reset(struct mt7921_dev *dev)
sdio_release_host(sdio->func); sdio_release_host(sdio->func);
clear_bit(MT76_STATE_MCU_RUNNING, &dev->mphy.state);
/* activate mt7921s again */ /* activate mt7921s again */
mt7921s_mcu_fw_pmctrl(dev); mt7921s_mcu_fw_pmctrl(dev);
mt7921s_mcu_drv_pmctrl(dev); mt7921s_mcu_drv_pmctrl(dev);
...@@ -81,7 +83,6 @@ int mt7921s_init_reset(struct mt7921_dev *dev) ...@@ -81,7 +83,6 @@ int mt7921s_init_reset(struct mt7921_dev *dev)
mt7921s_wfsys_reset(dev); mt7921s_wfsys_reset(dev);
mt76_worker_enable(&dev->mt76.sdio.txrx_worker); mt76_worker_enable(&dev->mt76.sdio.txrx_worker);
clear_bit(MT76_STATE_MCU_RUNNING, &dev->mphy.state);
clear_bit(MT76_MCU_RESET, &dev->mphy.state); clear_bit(MT76_MCU_RESET, &dev->mphy.state);
mt7921s_enable_irq(&dev->mt76); mt7921s_enable_irq(&dev->mt76);
...@@ -114,7 +115,6 @@ int mt7921s_mac_reset(struct mt7921_dev *dev) ...@@ -114,7 +115,6 @@ int mt7921s_mac_reset(struct mt7921_dev *dev)
mt76_worker_enable(&dev->mt76.sdio.net_worker); mt76_worker_enable(&dev->mt76.sdio.net_worker);
dev->fw_assert = false; dev->fw_assert = false;
clear_bit(MT76_STATE_MCU_RUNNING, &dev->mphy.state);
clear_bit(MT76_MCU_RESET, &dev->mphy.state); clear_bit(MT76_MCU_RESET, &dev->mphy.state);
mt7921s_enable_irq(&dev->mt76); mt7921s_enable_irq(&dev->mt76);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment