From 07d0a64c8e331a2aa95a0f86ff534966c6217d55 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: May 24 2023 15:05:35 +0000 Subject: wifi: mt76: mt7921e: fix probe timeout after reboot (git-fixes). --- diff --git a/patches.suse/wifi-mt76-mt7921e-fix-probe-timeout-after-reboot.patch b/patches.suse/wifi-mt76-mt7921e-fix-probe-timeout-after-reboot.patch new file mode 100644 index 0000000..cc4f69f --- /dev/null +++ b/patches.suse/wifi-mt76-mt7921e-fix-probe-timeout-after-reboot.patch @@ -0,0 +1,50 @@ +From c397fc1e6365a2a9e5540a85b2c1d4ea412aa0e2 Mon Sep 17 00:00:00 2001 +From: Quan Zhou +Date: Sat, 18 Mar 2023 15:41:12 +0800 +Subject: [PATCH] wifi: mt76: mt7921e: fix probe timeout after reboot +Git-commit: c397fc1e6365a2a9e5540a85b2c1d4ea412aa0e2 +Patch-mainline: v6.4-rc1 +References: git-fixes + +In system warm reboot scene, due to the polling timeout(now 1000us) +is too short to wait dma idle in time, it may make driver probe fail +with error code -ETIMEDOUT. Meanwhile, we also found the dma may take +around 70ms to enter idle state. Change the polling idle timeout to +100ms to avoid the probabilistic probe fail. + +Tested pass with 5000 times warm reboot on x86 platform. + +[4.477496] pci 0000:01:00.0: attach allowed to drvr mt7921e [internal device] +[4.478306] mt7921e 0000:01:00.0: ASIC revision: 79610010 +[4.480063] mt7921e: probe of 0000:01:00.0 failed with error -110 + +Fixes: 0a1059d0f060 ("mt76: mt7921: move mt7921_dma_reset in dma.c") +Signed-off-by: Quan Zhou +Signed-off-by: Deren Wu +Signed-off-by: Felix Fietkau +Acked-by: Takashi Iwai + +--- + drivers/net/wireless/mediatek/mt76/mt7921/dma.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/dma.c b/drivers/net/wireless/mediatek/mt76/mt7921/dma.c +index 1d85c0c10049..28207172c4ef 100644 +--- a/drivers/net/wireless/mediatek/mt76/mt7921/dma.c ++++ b/drivers/net/wireless/mediatek/mt76/mt7921/dma.c +@@ -90,9 +90,9 @@ static int mt7921_dma_disable(struct mt7921_dev *dev, bool force) + MT_WFDMA0_GLO_CFG_OMIT_RX_INFO | + MT_WFDMA0_GLO_CFG_OMIT_RX_INFO_PFET2); + +- if (!mt76_poll(dev, MT_WFDMA0_GLO_CFG, +- MT_WFDMA0_GLO_CFG_TX_DMA_BUSY | +- MT_WFDMA0_GLO_CFG_RX_DMA_BUSY, 0, 1000)) ++ if (!mt76_poll_msec_tick(dev, MT_WFDMA0_GLO_CFG, ++ MT_WFDMA0_GLO_CFG_TX_DMA_BUSY | ++ MT_WFDMA0_GLO_CFG_RX_DMA_BUSY, 0, 100, 1)) + return -ETIMEDOUT; + + return 0; +-- +2.35.3 + diff --git a/series.conf b/series.conf index 3864a7c..836bc6d 100644 --- a/series.conf +++ b/series.conf @@ -19913,6 +19913,7 @@ patches.suse/wifi-mt76-handle-failure-of-vzalloc-in-mt7615_coredu.patch patches.suse/wifi-mt76-add-missing-locking-to-protect-against-con.patch patches.suse/wifi-mt76-mt7921e-Set-memory-space-enable-in-PCI_COM.patch + patches.suse/wifi-mt76-mt7921e-fix-probe-timeout-after-reboot.patch patches.suse/wifi-mt76-fix-6GHz-high-channel-not-be-scanned.patch patches.suse/Revert-Bluetooth-btsdio-fix-use-after-free-bug-in-bt.patch patches.suse/bluetooth-Perform-careful-capability-checks-in-hci_s.patch