wifi: mt76: mt7925: ensure all MCU commands wait for response
authorMichael Lo <michael.lo@mediatek.com>
Mon, 14 Apr 2025 01:39:54 +0000 (09:39 +0800)
committerFelix Fietkau <nbd@nbd.name>
Thu, 22 May 2025 10:57:36 +0000 (12:57 +0200)
Modify MCU command sending functions to wait for a response,
ensuring consistent behavior across all commands and improves
reliability by confirming that each command is processed
successfully.

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Michael Lo <michael.lo@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Link: https://patch.msgid.link/20250414013954.1151774-3-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c

index b19898aee64c744f3118fdf44525154fece529de..0a1a8dff3f9c91477cc79d01869c414cb23ea348 100644 (file)
@@ -783,7 +783,7 @@ int mt7925_mcu_fw_log_2_host(struct mt792x_dev *dev, u8 ctrl)
        int ret;
 
        ret = mt76_mcu_send_and_get_msg(&dev->mt76, MCU_UNI_CMD(WSYS_CONFIG),
-                                       &req, sizeof(req), false, NULL);
+                                       &req, sizeof(req), true, NULL);
        return ret;
 }
 
@@ -1441,7 +1441,7 @@ int mt7925_mcu_set_eeprom(struct mt792x_dev *dev)
        };
 
        return mt76_mcu_send_and_get_msg(&dev->mt76, MCU_UNI_CMD(EFUSE_CTRL),
-                                        &req, sizeof(req), false, NULL);
+                                        &req, sizeof(req), true, NULL);
 }
 EXPORT_SYMBOL_GPL(mt7925_mcu_set_eeprom);
 
@@ -2813,7 +2813,7 @@ int mt7925_mcu_set_dbdc(struct mt76_phy *phy, bool enable)
        conf->band = 0; /* unused */
 
        err = mt76_mcu_skb_send_msg(mdev, skb, MCU_UNI_CMD(SET_DBDC_PARMS),
-                                   false);
+                                   true);
 
        return err;
 }
@@ -2943,7 +2943,7 @@ int mt7925_mcu_hw_scan(struct mt76_phy *phy, struct ieee80211_vif *vif,
        }
 
        err = mt76_mcu_skb_send_msg(mdev, skb, MCU_UNI_CMD(SCAN_REQ),
-                                   false);
+                                   true);
        if (err < 0)
                clear_bit(MT76_HW_SCANNING, &phy->state);
 
@@ -3049,7 +3049,7 @@ int mt7925_mcu_sched_scan_req(struct mt76_phy *phy,
        }
 
        return mt76_mcu_skb_send_msg(mdev, skb, MCU_UNI_CMD(SCAN_REQ),
-                                    false);
+                                    true);
 }
 EXPORT_SYMBOL_GPL(mt7925_mcu_sched_scan_req);
 
@@ -3085,7 +3085,7 @@ mt7925_mcu_sched_scan_enable(struct mt76_phy *phy,
                clear_bit(MT76_HW_SCHED_SCANNING, &phy->state);
 
        return mt76_mcu_skb_send_msg(mdev, skb, MCU_UNI_CMD(SCAN_REQ),
-                                    false);
+                                    true);
 }
 
 int mt7925_mcu_cancel_hw_scan(struct mt76_phy *phy,
@@ -3124,7 +3124,7 @@ int mt7925_mcu_cancel_hw_scan(struct mt76_phy *phy,
        }
 
        return mt76_mcu_send_msg(phy->dev, MCU_UNI_CMD(SCAN_REQ),
-                                &req, sizeof(req), false);
+                                &req, sizeof(req), true);
 }
 EXPORT_SYMBOL_GPL(mt7925_mcu_cancel_hw_scan);
 
@@ -3229,7 +3229,7 @@ int mt7925_mcu_set_channel_domain(struct mt76_phy *phy)
        memcpy(__skb_push(skb, sizeof(req)), &req, sizeof(req));
 
        return mt76_mcu_skb_send_msg(dev, skb, MCU_UNI_CMD(SET_DOMAIN_INFO),
-                                    false);
+                                    true);
 }
 EXPORT_SYMBOL_GPL(mt7925_mcu_set_channel_domain);