[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230614063252.1650824-1-kai.heng.feng@canonical.com>
Date: Wed, 14 Jun 2023 14:32:50 +0800
From: Kai-Heng Feng <kai.heng.feng@...onical.com>
To: nbd@....name, lorenzo@...nel.org, ryder.lee@...iatek.com
Cc: Kai-Heng Feng <kai.heng.feng@...onical.com>,
Shayne Chen <shayne.chen@...iatek.com>,
Sean Wang <sean.wang@...iatek.com>,
Kalle Valo <kvalo@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Deren Wu <deren.wu@...iatek.com>,
Leon Yen <Leon.Yen@...iatek.com>,
linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org
Subject: [PATCH] wifi: mt76: mt7921e: Perform FLR to recovery the device
When "Pre-boot WiFi" is enabled in BIOS, the mt7921e device may not
work:
mt7921e 0000:02:00.0: ASIC revision: 79220010
mt7921e 0000:02:00.0: Message 00000010 (seq 1) timeout
mt7921e 0000:02:00.0: Failed to get patch semaphore
mt7921e 0000:02:00.0: Message 00000010 (seq 2) timeout
mt7921e 0000:02:00.0: Failed to get patch semaphore
mt7921e 0000:02:00.0: Message 00000010 (seq 3) timeout
mt7921e 0000:02:00.0: Failed to get patch semaphore
mt7921e 0000:02:00.0: Message 00000010 (seq 4) timeout
mt7921e 0000:02:00.0: Failed to get patch semaphore
mt7921e 0000:02:00.0: Message 00000010 (seq 5) timeout
mt7921e 0000:02:00.0: Failed to get patch semaphore
mt7921e 0000:02:00.0: Message 00000010 (seq 6) timeout
mt7921e 0000:02:00.0: Failed to get patch semaphore
mt7921e 0000:02:00.0: Message 00000010 (seq 7) timeout
mt7921e 0000:02:00.0: Failed to get patch semaphore
mt7921e 0000:02:00.0: Message 00000010 (seq 8) timeout
mt7921e 0000:02:00.0: Failed to get patch semaphore
mt7921e 0000:02:00.0: Message 00000010 (seq 9) timeout
mt7921e 0000:02:00.0: Failed to get patch semaphore
mt7921e 0000:02:00.0: Message 00000010 (seq 10) timeout
mt7921e 0000:02:00.0: Failed to get patch semaphore
mt7921e 0000:02:00.0: hardware init failed
After some trials and errors, it shows that PCI function level reset can
recover the device back to a functional state.
So perform FLR at probe routine to workaround the issue.
Signed-off-by: Kai-Heng Feng <kai.heng.feng@...onical.com>
---
drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
index ddb1fa4ee01d..9671fbe35a8e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
@@ -262,6 +262,10 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
int ret;
u16 cmd;
+ ret = pci_reset_function_locked(pdev);
+ if (ret)
+ pci_info(pdev, "Unable to perform FLR\n");
+
ret = pcim_enable_device(pdev);
if (ret)
return ret;
--
2.34.1
Powered by blists - more mailing lists