diff mbox series

mt76: mt7921: get rid of the false positive reset

Message ID 95b03bb77ce93cb2cade98d947309cd669721939.1660519674.git.objelf@gmail.com (mailing list archive)
State New, archived
Headers show
Series mt76: mt7921: get rid of the false positive reset | expand

Commit Message

Sean Wang Aug. 14, 2022, 11:37 p.m. UTC
From: Sean Wang <sean.wang@mediatek.com>

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.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
---
 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(-)

Comments

Lorenzo Bianconi Aug. 16, 2022, 8 a.m. UTC | #1
> From: Sean Wang <sean.wang@mediatek.com>
> 
> 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.
> 
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>

Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>

> ---
>  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(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c
> index 5efda694fb9d..64568536c1e9 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c
> @@ -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;
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c
> index e038d7404323..5c1489766d9f 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c
> @@ -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;
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/usb.c b/drivers/net/wireless/mediatek/mt76/mt7921/usb.c
> index dd3b8884e162..d06cee386acd 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/usb.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/usb.c
> @@ -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;
> -- 
> 2.25.1
>
Kalle Valo Aug. 31, 2022, 11:40 a.m. UTC | #2
<sean.wang@mediatek.com> writes:

> From: Sean Wang <sean.wang@mediatek.com>
>
> 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.
>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>

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.
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c
index 5efda694fb9d..64568536c1e9 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci_mcu.c
@@ -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;
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c
index e038d7404323..5c1489766d9f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c
@@ -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;
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/usb.c b/drivers/net/wireless/mediatek/mt76/mt7921/usb.c
index dd3b8884e162..d06cee386acd 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/usb.c
@@ -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;