Skip to contentSkip to conversation

mt76: mt7921: Fix resume fail if fw was dropped

PATCH In review Deren Wu 2 participants 3 messages Jul 9, 2021

Subsystems (3)
lore
Share & tools
lore

Deren Wu

author
#0 lore raw

cover mt76: mt7921: Fix resume fail if fw was dropped

From: Deren Wu <[email protected]>

Hi,

The bug is found on some devices which power off pcie bus in suspend mode. In this case, mt7921 would resume fail on interactive commands. This patch could recover the failure in command timeout.

Need to apply patches below for dependency. Those patches work for stability improvment as well.

upstream patches:
commit f92f81d35ac2 ("mt76: mt7921: check mcu returned values in mt7921_start") commit d32464e68ffc ("mt76: mt7921: introduce mt7921_run_firmware utility routine.") commit 1f7396acfef4 ("mt76: mt7921: introduce __mt7921_start utility routine") commit 3990465db682 ("mt76: dma: introduce mt76_dma_queue_reset routine") commit c001df978e4c ("mt76: dma: export mt76_dma_rx_cleanup routine") commit 0c1ce9884607 ("mt76: mt7921: add wifi reset support")
commit e513ae49088b ("mt76: mt7921: abort uncompleted scan by wifi reset")

Lorenzo Bianconi (1):
mt76: mt7921: get rid of mcu_reset function pointer

 drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 1/1 mt76: mt7921: get rid of mcu_reset function pointer

From: Lorenzo Bianconi <[email protected]>

[ Upstream commit d43b3257621dfe57c71d875afd3f624b9a042fc5 ]

since mcu_reset it used only by mt7921, move the reset callback to mt7921_mcu_parse_response routine and get rid of the function pointer.

Cc <[email protected]> # 5.12: f92f81d35ac2 mt76: mt7921: check mcu returned values in mt7921_start
Cc <[email protected]> # 5.12: d32464e68ffc mt76: mt7921: introduce mt7921_run_firmware utility routine.
Cc <[email protected]> # 5.12: 1f7396acfef4 mt76: mt7921: introduce __mt7921_start utility routine
Cc <[email protected]> # 5.12: 3990465db682 mt76: dma: introduce mt76_dma_queue_reset routine
Cc <[email protected]> # 5.12: c001df978e4c mt76: dma: export mt76_dma_rx_cleanup routine
Cc <[email protected]> # 5.12: 0c1ce9884607 mt76: mt7921: add wifi reset support
Cc <[email protected]> # 5.12: e513ae49088b mt76: mt7921: abort uncompleted scan by wifi reset
Cc <[email protected]> # 5.12
---
 drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +2 -1
index d0d6de3f6d41..a4f070cd78fd 100644
@@ -161,6 +161,8 @@ mt7921_mcu_parse_response(struct mt76_dev *mdev, int cmd,
 	if (!skb) {
 		dev_err(mdev->dev, "Message %d (seq %d) timeout\n",
 			cmd, seq);
+		mt7921_reset(mdev);
+
 		return -ETIMEDOUT;
 	}
 
@@ -952,7 +954,6 @@ int mt7921_mcu_init(struct mt7921_dev *dev)
 		.mcu_skb_send_msg = mt7921_mcu_send_message,
 		.mcu_parse_response = mt7921_mcu_parse_response,
 		.mcu_restart = mt7921_mcu_restart,
-		.mcu_reset = mt7921_reset,
 	};
 
 	dev->mt76.mcu_ops = &mt7921_mcu_ops;
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH 1/1] mt76: mt7921: get rid of mcu_reset function pointer

Quoted 19 lines · Deren Wu

From: Lorenzo Bianconi <[email protected]>

[ Upstream commit d43b3257621dfe57c71d875afd3f624b9a042fc5 ]

since mcu_reset it used only by mt7921, move the reset callback to mt7921_mcu_parse_response routine and get rid of the function pointer.

Cc <[email protected]> # 5.12: f92f81d35ac2 mt76: mt7921: check mcu returned values in mt7921_start
Cc <[email protected]> # 5.12: d32464e68ffc mt76: mt7921: introduce mt7921_run_firmware utility routine.
Cc <[email protected]> # 5.12: 1f7396acfef4 mt76: mt7921: introduce __mt7921_start utility routine
Cc <[email protected]> # 5.12: 3990465db682 mt76: dma: introduce mt76_dma_queue_reset routine
Cc <[email protected]> # 5.12: c001df978e4c mt76: dma: export mt76_dma_rx_cleanup routine
Cc <[email protected]> # 5.12: 0c1ce9884607 mt76: mt7921: add wifi reset support
Cc <[email protected]> # 5.12: e513ae49088b mt76: mt7921: abort uncompleted scan by wifi reset
Cc <[email protected]> # 5.12
Quoted 3 lines
---
 drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

All now queued up, thanks.

greg k-h