From 703c6b78c133643a0e53dbd3a76d9e19f5dc3e30 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 11 Oct 2024 18:46:29 +0200 Subject: [PATCH] wifi: mt76: mt7915: firmware restart on devices with a second pcie link It seems that the firmware checks the register used for detecting matching PCIe links in order to figure out if a secondary PCIe link is enabled. Write the register again just before starting the firmware on hw reset, in order to fix an issue that left the second band unusable after restart. Fixes: 9093cfff72e3 ("mt76: mt7915: add support for using a secondary PCIe link for gen1") Signed-off-by: Felix Fietkau --- mt7915/mac.c | 2 ++ mt7915/mt7915.h | 1 + mt7915/pci.c | 1 + 3 files changed, 4 insertions(+) diff --git a/mt7915/mac.c b/mt7915/mac.c index cf77ce0c..b890a58d 100644 --- a/mt7915/mac.c +++ b/mt7915/mac.c @@ -1388,6 +1388,8 @@ mt7915_mac_restart(struct mt7915_dev *dev) if (dev_is_pci(mdev->dev)) { mt76_wr(dev, MT_PCIE_MAC_INT_ENABLE, 0xff); if (dev->hif2) { + mt76_wr(dev, MT_PCIE_RECOG_ID, + dev->hif2->index | MT_PCIE_RECOG_ID_SEM); if (is_mt7915(mdev)) mt76_wr(dev, MT_PCIE1_MAC_INT_ENABLE, 0xff); else diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h index ac0b1f0e..5fe872ef 100644 --- a/mt7915/mt7915.h +++ b/mt7915/mt7915.h @@ -191,6 +191,7 @@ struct mt7915_hif { struct device *dev; void __iomem *regs; int irq; + u32 index; }; struct mt7915_phy { diff --git a/mt7915/pci.c b/mt7915/pci.c index 39132894..07b0a576 100644 --- a/mt7915/pci.c +++ b/mt7915/pci.c @@ -42,6 +42,7 @@ static struct mt7915_hif *mt7915_pci_get_hif2(u32 idx) continue; get_device(hif->dev); + hif->index = idx; goto out; } hif = NULL;