diff mbox series

wifi: mt76: mt7925: Simplify HIF suspend handling to avoid suspend fail

Message ID 34208c7280325f57a651363d339399eb1744d3b7.1740400998.git.quan.zhou@mediatek.com (mailing list archive)
State New
Delegated to: Felix Fietkau
Headers show
Series wifi: mt76: mt7925: Simplify HIF suspend handling to avoid suspend fail | expand

Checks

Context Check Description
jmberg/fixes_present success Fixes tag not required for -next series
jmberg/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
jmberg/tree_selection success Guessed tree name to be wireless-next
jmberg/ynl success Generated files up to date; no warnings/errors; no diff in generated;
jmberg/build_32bit success Errors and warnings before: 0 this patch: 0
jmberg/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
jmberg/build_clang success Errors and warnings before: 0 this patch: 0
jmberg/build_clang_rust success No Rust files in patch. Skipping build
jmberg/build_tools success No tools touched, skip
jmberg/check_selftest success No net selftest shell script
jmberg/checkpatch success total: 0 errors, 0 warnings, 0 checks, 18 lines checked
jmberg/deprecated_api success None detected
jmberg/header_inline success No static functions without inline keyword in header files
jmberg/kdoc success Errors and warnings before: 0 this patch: 0
jmberg/source_inline success Was 0 now: 0
jmberg/verify_fixes success No Fixes tag
jmberg/verify_signedoff success Signed-off-by tag matches author and committer

Commit Message

Quan Zhou Feb. 24, 2025, 1:05 p.m. UTC
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>
---
 drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
index 04762a8eac51..740e5c62929a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
@@ -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;
 	}