]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mt76: mt7915: firmware restart on devices with a second pcie link
authorFelix Fietkau <nbd@nbd.name>
Mon, 30 Dec 2024 19:41:59 +0000 (20:41 +0100)
committerFelix Fietkau <nbd@nbd.name>
Tue, 14 Jan 2025 12:34:36 +0000 (13:34 +0100)
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")
Link: https://patch.msgid.link/20241230194202.95065-11-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7915/mac.c
drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h
drivers/net/wireless/mediatek/mt76/mt7915/pci.c

index 1b9dcdec142bafc77141873d1f0713d1ff1b57a7..9b9158fdd4d958f7af25fbaee3ac6e10d48ef371 100644 (file)
@@ -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
index ac0b1f0eb27c143c10a7e11a713e80ab63e212da..5fe872ef2e939bf87fec2fd3494cc5dcd0885751 100644 (file)
@@ -191,6 +191,7 @@ struct mt7915_hif {
        struct device *dev;
        void __iomem *regs;
        int irq;
+       u32 index;
 };
 
 struct mt7915_phy {
index 39132894e8ea295b4e283d04a056ab420c1517d1..07b0a5766eab7dbdcd019b3648809385ba70d022 100644 (file)
@@ -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;