Skip to contentSkip to conversation

mt76: mt7921: get rid of the false positive reset

PATCH In review [email protected] 3 participants 3 messages Aug 14, 2022 – Aug 31, 2022

Subsystems (2)
lore
Share & tools
lore

[email protected]

author reviewer
#0 lore raw

PATCH 1/1 mt76: mt7921: get rid of the false positive reset

From: Sean Wang <[email protected]>

False positive reset would be possibly triggered by those commands we applied in suspend with HZ MCU timeout, especially it happened when we enabled kernel log in pm core to diagnose how much time we spend in each driver during suspend procedure. So we enlarge the value and align the MCU timeout as other commands we did to reduce the false positive reset.

---
 drivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c  | 7 +------
 drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c | 7 +------
 drivers/net/wireless/mediatek/mt76/mt7921/usb.c      | 7 +------
 3 files changed, 3 insertions(+), 18 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c +1 -6
index 5efda694fb9d..64568536c1e9 100644
@@ -30,12 +30,7 @@ mt7921_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
 	if (ret)
 		return ret;
 
-	if (cmd == MCU_UNI_CMD(HIF_CTRL) ||
-	    cmd == MCU_UNI_CMD(SUSPEND) ||
-	    cmd == MCU_UNI_CMD(OFFLOAD))
-		mdev->mcu.timeout = HZ;
-	else
-		mdev->mcu.timeout = 3 * HZ;
+	mdev->mcu.timeout = 3 * HZ;
 
 	if (cmd == MCU_CMD(FW_SCATTER))
 		txq = MT_MCUQ_FWDL;
drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c +1 -6
index e038d7404323..5c1489766d9f 100644
@@ -33,12 +33,7 @@ mt7921s_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
 	if (ret)
 		return ret;
 
-	if (cmd == MCU_UNI_CMD(HIF_CTRL) ||
-	    cmd == MCU_UNI_CMD(SUSPEND) ||
-	    cmd == MCU_UNI_CMD(OFFLOAD))
-		mdev->mcu.timeout = HZ;
-	else
-		mdev->mcu.timeout = 3 * HZ;
+	mdev->mcu.timeout = 3 * HZ;
 
 	if (cmd == MCU_CMD(FW_SCATTER))
 		type = MT7921_SDIO_FWDL;
drivers/net/wireless/mediatek/mt76/mt7921/usb.c +1 -6
index dd3b8884e162..d06cee386acd 100644
@@ -106,12 +106,7 @@ mt7921u_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
 	if (ret)
 		return ret;
 
-	if (cmd == MCU_UNI_CMD(HIF_CTRL) ||
-	    cmd == MCU_UNI_CMD(SUSPEND) ||
-	    cmd == MCU_UNI_CMD(OFFLOAD))
-		mdev->mcu.timeout = HZ;
-	else
-		mdev->mcu.timeout = 3 * HZ;
+	mdev->mcu.timeout = 3 * HZ;
 
 	if (cmd != MCU_CMD(FW_SCATTER))
 		ep = MT_EP_OUT_INBAND_CMD;
Signature · 1 line
2.25.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines

From: Sean Wang <[email protected]>

False positive reset would be possibly triggered by those commands we applied in suspend with HZ MCU timeout, especially it happened when we enabled kernel log in pm core to diagnose how much time we spend in each driver during suspend procedure. So we enlarge the value and align the MCU timeout as other commands we did to reduce the false positive reset.

Quoted 63 lines
---
 drivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c  | 7 +------
 drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c | 7 +------
 drivers/net/wireless/mediatek/mt76/mt7921/usb.c      | 7 +------
 3 files changed, 3 insertions(+), 18 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c +1 -6
index 5efda694fb9d..64568536c1e9 100644
@@ -30,12 +30,7 @@ mt7921_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
 	if (ret)
 		return ret;
 
-	if (cmd == MCU_UNI_CMD(HIF_CTRL) ||
-	    cmd == MCU_UNI_CMD(SUSPEND) ||
-	    cmd == MCU_UNI_CMD(OFFLOAD))
-		mdev->mcu.timeout = HZ;
-	else
-		mdev->mcu.timeout = 3 * HZ;
+	mdev->mcu.timeout = 3 * HZ;
 
 	if (cmd == MCU_CMD(FW_SCATTER))
 		txq = MT_MCUQ_FWDL;
drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c +1 -6
index e038d7404323..5c1489766d9f 100644
@@ -33,12 +33,7 @@ mt7921s_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
 	if (ret)
 		return ret;
 
-	if (cmd == MCU_UNI_CMD(HIF_CTRL) ||
-	    cmd == MCU_UNI_CMD(SUSPEND) ||
-	    cmd == MCU_UNI_CMD(OFFLOAD))
-		mdev->mcu.timeout = HZ;
-	else
-		mdev->mcu.timeout = 3 * HZ;
+	mdev->mcu.timeout = 3 * HZ;
 
 	if (cmd == MCU_CMD(FW_SCATTER))
 		type = MT7921_SDIO_FWDL;
drivers/net/wireless/mediatek/mt76/mt7921/usb.c +1 -6
index dd3b8884e162..d06cee386acd 100644
@@ -106,12 +106,7 @@ mt7921u_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
 	if (ret)
 		return ret;
 
-	if (cmd == MCU_UNI_CMD(HIF_CTRL) ||
-	    cmd == MCU_UNI_CMD(SUSPEND) ||
-	    cmd == MCU_UNI_CMD(OFFLOAD))
-		mdev->mcu.timeout = HZ;
-	else
-		mdev->mcu.timeout = 3 * HZ;
+	mdev->mcu.timeout = 3 * HZ;
 
 	if (cmd != MCU_CMD(FW_SCATTER))
 		ep = MT_EP_OUT_INBAND_CMD;
Signature · 1 line
2.25.1
#2 lore raw
In reply to [email protected]
Quoted 9 lines · <[email protected]> writes:

From: Sean Wang <[email protected]>

False positive reset would be possibly triggered by those commands we applied in suspend with HZ MCU timeout, especially it happened when we enabled kernel log in pm core to diagnose how much time we spend in each driver during suspend procedure. So we enlarge the value and align the MCU timeout as other commands we did to reduce the false positive reset.

Please use the new "wifi:" prefix, so for this patch it should be:

wifi: mt76: mt7921: get rid of the false positive reset

No need to resend but please use this in all new patches.

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches