* [PATCH] wifi: mt76: mt7925: do not report resume failure after reset recovery
@ 2026-10-22 8:51 Yi Cong
0 siblings, 0 replies; only message in thread
From: Yi Cong @ 2026-10-22 8:51 UTC (permalink / raw)
To: nbd, lorenzo, ryder.lee
Cc: linux-wireless, linux-kernel, linux-mediatek, shayne.chen,
sean.wang, mingyen.hsieh, emery.hsin, Yi Cong
From: Yi Cong <yicong@kylinos.cn>
When the firmware loses its state over suspend-to-RAM, e.g. on
platforms that cut PCIe auxiliary power, the HIF resume handshake on
the resume path always times out. The mt792x_reset() fallback already
recovers the device with a full reinitialization, just like the
hibernate restore path:
commit d54424fbc53b4 ("wifi: mt76: mt7925: add pci restore for hibernate")
Yet the callback still returns -ETIMEDOUT, so the PM core reports a
resume failure for an already recovered device on every resume:
mt7925e 0000:12:00.0: PM: dpm_run_callback(): pci_pm_resume returns -110
mt7925e 0000:12:00.0: PM: failed to resume async: error -110
Report success instead once the reset fallback is scheduled, and skip
the follow-up commands that the reloaded firmware cannot answer.
Platforms whose firmware survives suspend are unaffected.
Signed-off-by: Yi Cong <yicong@kylinos.cn>
---
drivers/net/wireless/mediatek/mt76/mt7925/pci.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/pci.c b/drivers/net/wireless/mediatek/mt76/mt7925/pci.c
index 0d477dc1086c..82ee58eca78c 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/pci.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/pci.c
@@ -886,6 +886,7 @@ static int _mt7925_pci_resume(struct device *device, bool restore)
struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
struct mt76_connac_pm *pm = &dev->pm;
int i, err, ret;
+ bool hif_timeout = false;
dev->hif_idle = false;
err = mt792x_mcu_drv_pmctrl(dev);
@@ -927,7 +928,9 @@ static int _mt7925_pci_resume(struct device *device, bool restore)
ret = wait_event_timeout(dev->wait,
dev->hif_resumed, 3 * HZ);
if (!ret) {
- err = -ETIMEDOUT;
+ hif_timeout = true;
+ dev_info(mdev->dev,
+ "HIF resume handshake timed out, recovering through reset\n");
goto failed;
}
@@ -939,7 +942,7 @@ static int _mt7925_pci_resume(struct device *device, bool restore)
failed:
pm->suspended = false;
- if (err < 0 || restore)
+ if (err < 0 || restore || hif_timeout)
mt792x_reset(&dev->mt76);
return err;
--
2.25.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-22 8:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-22 8:51 [PATCH] wifi: mt76: mt7925: do not report resume failure after reset recovery Yi Cong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®