wifi: mt76: mt7925: Simplify HIF suspend handling to avoid suspend fail
authorQuan Zhou <quan.zhou@mediatek.com>
Mon, 24 Feb 2025 13:05:14 +0000 (21:05 +0800)
committerFelix Fietkau <nbd@nbd.name>
Wed, 19 Mar 2025 13:47:03 +0000 (14:47 +0100)
System suspend failures may occur due to inappropriate
handling of traffic not idle event by the WiFi driver.
The WiFi firmware's traffic not idle indication does
not need to be tied to suspend. Fix the flow to ensuring
the system can suspend properly.

Signed-off-by: Quan Zhou <quan.zhou@mediatek.com>
Link: https://patch.msgid.link/34208c7280325f57a651363d339399eb1744d3b7.1740400998.git.quan.zhou@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c

index eee65cf4820340783131e2429b338f4bd4ce545f..7885d71b7a77df03fbf58d23de82b8d70c18af85 100644 (file)
@@ -348,14 +348,10 @@ mt7925_mcu_handle_hif_ctrl_basic(struct mt792x_dev *dev, struct tlv *tlv)
        basic = (struct mt7925_mcu_hif_ctrl_basic_tlv *)tlv;
 
        if (basic->hifsuspend) {
-               if (basic->hif_tx_traffic_status == HIF_TRAFFIC_IDLE &&
-                   basic->hif_rx_traffic_status == HIF_TRAFFIC_IDLE)
-                       /* success */
-                       dev->hif_idle = true;
-               else
-                       /* busy */
-                       /* invalid */
-                       dev->hif_idle = false;
+               dev->hif_idle = true;
+               if (!(basic->hif_tx_traffic_status == HIF_TRAFFIC_IDLE &&
+                     basic->hif_rx_traffic_status == HIF_TRAFFIC_IDLE))
+                       dev_info(dev->mt76.dev, "Hif traffic not idle.\n");
        } else {
                dev->hif_resumed = true;
        }