From a902bfa6db2f387a3860290a426aa8b6763449ff Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 8 Oct 2024 20:11:26 +0200 Subject: [PATCH] wifi: mt76: mt7915: disable the second PCIe link for MT7915 The second PCIe link is only used to improve performance on older generation PCIe devices (e.g. MT7621) where the bus speed of one link is not enough to saturate both wifi bands under really good conditions. Unfortunately it seems that resetting the hardware after a firmware error causes the second band to stop working if the second link is in use. Disable the link until the issue is properly fixed. For testing, the link can still be enabled via module parameter. Fixes: 9093cfff72e3 ("mt76: mt7915: add support for using a secondary PCIe link for gen1") Signed-off-by: Felix Fietkau --- mt7915/pci.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mt7915/pci.c b/mt7915/pci.c index 39132894..a3be9fbd 100644 --- a/mt7915/pci.c +++ b/mt7915/pci.c @@ -16,6 +16,10 @@ static LIST_HEAD(hif_list); static DEFINE_SPINLOCK(hif_lock); static u32 hif_idx; +static int hif2_enable = -1; +module_param(hif2_enable, int, 0644); +MODULE_PARM_DESC(hif2_enable, "Enable second PCIe link support"); + static const struct pci_device_id mt7915_pci_device_table[] = { { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7915) }, { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7906) }, @@ -84,6 +88,13 @@ static int mt7915_pci_hif2_probe(struct pci_dev *pdev) { struct mt7915_hif *hif; + if (!hif2_enable) + return -ENODEV; + + /* Skip the second PCIe link on MT7915 due to SER failure */ + if (hif2_enable < 0 && pdev->device == 0x7916) + return -ENODEV; + hif = devm_kzalloc(&pdev->dev, sizeof(*hif), GFP_KERNEL); if (!hif) return -ENOMEM;