mt76: mt7921: add PATCH_FINISH_REQ cmd response handling
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/2 mt76: mt7921: add PATCH_FINISH_REQ cmd response handling
From: YN Chen <[email protected]>
add new case to fetch the return value of PATCH_FINISH_REQ
Signed-off-by YN Chen <[email protected]>
Signed-off-by Deren Wu <[email protected]>
--- 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
@@ -111,7 +111,8 @@ int mt7921_mcu_parse_response(struct mt76_dev *mdev, int cmd,if (seq != rxd->seq)return -EAGAIN ; -if (cmd ==MCU_CMD (PATCH_SEM_CONTROL )) { +if (cmd ==MCU_CMD (PATCH_SEM_CONTROL ) || + cmd ==MCU_CMD (PATCH_FINISH_REQ )) {skb_pull (skb,sizeof (*rxd) -4 ); ret = *skb->data; }else if (cmd ==MCU_EXT_CMD (THERMAL_CTRL )) {
Signature · 1 line
2.18.0
PATCH 2/2 mt76: mt7921s: fix firmware download random fail
In reply to a message not in the archiveFrom: YN Chen <[email protected]>
To avoid racing problems in chip, mt7921s should reacquire drv-own after firmware semaphore is released.
Fixes 78b217580c509 ("mt76: mt7921s: fix bus hang with wrong privilege")
Signed-off-by YN Chen <[email protected]>
Signed-off-by Deren Wu <[email protected]>
--- drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +8 -7
@@ -583,13 +583,6 @@ static int mt7921_load_patch(struct mt7921_dev *dev)if (ret)dev_err (dev->mt76.dev,"Failed to start patch\n" ); -if (mt76_is_sdio (&dev->mt76)) { -/* activate again */ - ret =__mt7921_mcu_fw_pmctrl (dev); -if (!ret) - ret =__mt7921_mcu_drv_pmctrl (dev); - } - out: sem =mt76_connac_mcu_patch_sem_ctrl (&dev->mt76, false);switch (sem) {
@@ -600,6 +593,14 @@ static int mt7921_load_patch(struct mt7921_dev *dev)dev_err (dev->mt76.dev,"Failed to release patch semaphore\n" );break ; } + +if (!ret &&mt76_is_sdio (&dev->mt76)) { +/* activate again */ + ret =__mt7921_mcu_fw_pmctrl (dev); +if (!ret) + ret =__mt7921_mcu_drv_pmctrl (dev); + } +release_firmware (fw);return ret;
Signature · 1 line
2.18.0