summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Wang <sean.wang@mediatek.com>2026-02-19 03:39:59 +0300
committerFelix Fietkau <nbd@nbd.name>2026-03-24 18:49:29 +0300
commit222606f43b587c9fb4ae063d04db146100c8951c (patch)
tree28c119d2b778b63d15388b96d6ee1b2aaa12faeb
parent918af1f87f7de988a7e84a7a85390a7d626ee189 (diff)
downloadlinux-222606f43b587c9fb4ae063d04db146100c8951c.tar.xz
wifi: mt76: mt7921: handle MT7902 irq_map quirk with mutable copy
MT7902 PCIe requires a different wm2_complete_mask value, so introduce a mutable per-device copy of the default irq_map and override the field only for this chip. Other devices continue using the shared const template. This is a prerequisite patch before enabling MT7902 PCIe support. Co-developed-by: Xiong Huang <xiong.huang@mediatek.com> Signed-off-by: Xiong Huang <xiong.huang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Link: https://patch.msgid.link/20260219004007.19733-3-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7921/pci.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
index 65c7fe671137..5f857a21f362 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
@@ -327,6 +327,20 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
dev->hif_ops = &mt7921_pcie_ops;
dev->irq_map = &irq_map;
mt76_mmio_init(&dev->mt76, regs);
+
+ if (id->device == 0x7902) {
+ struct mt792x_irq_map *map;
+
+ /* MT7902 needs a mutable copy because wm2_complete_mask differs */
+ map = devm_kmemdup(&pdev->dev, &irq_map,
+ sizeof(irq_map), GFP_KERNEL);
+ if (!map)
+ return -ENOMEM;
+
+ map->rx.wm2_complete_mask = 0;
+ dev->irq_map = map;
+ }
+
tasklet_init(&mdev->irq_tasklet, mt792x_irq_tasklet, (unsigned long)dev);
dev->phy.dev = dev;