[PATCH 03/11] wifi: mt76: mt7921: handle MT7902 irq_map quirk with mutable copy
Sean Wang
sean.wang at kernel.org
Fri Feb 20 10:39:37 PST 2026
Hi Philip,
On Fri, Feb 20, 2026 at 4:09 AM Philip Müller <philm at manjaro.org> wrote:
>
> Hi Sean,
>
> on Linus master tree we still have 'mt76_mmio_init(&dev->mt76,
> pcim_iomap_table(pdev)[0]);', hence your patch currently won't apply.
The patchset is based on the latest mt76 tree.
If needed, please apply the following commit first so the series
applies cleanly:
https://github.com/nbd168/wireless/commit/4eefc435c985f4dfdba9afb1c705f0e17377c084
That patch will go to Linus’ master first, then this series.
>
> On 2/19/26 01:39, sean.wang at kernel.org wrote:
> > From: Sean Wang <sean.wang at mediatek.com>
> >
> > 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 at mediatek.com>
> > Signed-off-by: Xiong Huang <xiong.huang at mediatek.com>
> > Signed-off-by: Sean Wang <sean.wang at mediatek.com>
> > ---
> > drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 14 ++++++++++++++
> > 1 file changed, 14 insertions(+)
> >
> > 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;
>
>
> --
> Best, Philip
>
More information about the Linux-mediatek
mailing list