public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: sean.wang@kernel.org
To: nbd@nbd.name, lorenzo.bianconi@redhat.com
Cc: linux-wireless@vger.kernel.org,
	linux-mediatek@lists.infradead.org,
	Sean Wang <sean.wang@mediatek.com>,
	Xiong Huang <xiong.huang@mediatek.com>
Subject: [PATCH 03/11] wifi: mt76: mt7921: handle MT7902 irq_map quirk with mutable copy
Date: Wed, 18 Feb 2026 18:39:59 -0600	[thread overview]
Message-ID: <20260219004007.19733-3-sean.wang@kernel.org> (raw)
In-Reply-To: <20260219004007.19733-1-sean.wang@kernel.org>

From: Sean Wang <sean.wang@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@mediatek.com>
Signed-off-by: Xiong Huang <xiong.huang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@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;
-- 
2.43.0


  parent reply	other threads:[~2026-02-19  0:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-19  0:39 [PATCH 01/11] wifi: mt76: connac: use is_connac2() to replace is_mt7921() checks sean.wang
2026-02-19  0:39 ` [PATCH 02/11] wifi: mt76: mt7921: use mt76_for_each_q_rx() in reset path sean.wang
2026-02-19  0:39 ` sean.wang [this message]
2026-02-20 10:09   ` [PATCH 03/11] wifi: mt76: mt7921: handle MT7902 irq_map quirk with mutable copy Philip Müller
2026-02-20 18:39     ` Sean Wang
2026-02-19  0:40 ` [PATCH 04/11] wifi: mt76: mt7921: add MT7902e DMA layout support sean.wang
2026-02-19  0:40 ` [PATCH 05/11] wifi: mt76: connac: mark MT7902 as hw txp devices sean.wang
2026-02-19  0:40 ` [PATCH 06/11] wifi: mt76: mt792x: add PSE handling barrier for the large MCU cmd sean.wang
2026-02-19  0:40 ` [PATCH 07/11] wifi: mt76: mt792x: ensure MCU ready before ROM patch download sean.wang
2026-02-19  0:40 ` [PATCH 08/11] wifi: mt76: mt7921: add MT7902 MCU support sean.wang
2026-02-19  0:40 ` [PATCH 09/11] wifi: mt76: mt792x: add MT7902 WFDMA prefetch configuration sean.wang
2026-02-19  0:40 ` [PATCH 10/11] wifi: mt76: mt7921: add MT7902 PCIe device support sean.wang
2026-02-19  0:40 ` [PATCH 11/11] wifi: mt76: mt7921: add MT7902 SDIO " sean.wang
2026-02-20 20:41 ` [PATCH 01/11] wifi: mt76: connac: use is_connac2() to replace is_mt7921() checks Philip Müller
2026-02-21 20:19   ` Sean Wang
2026-03-22  8:04     ` Philip Müller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260219004007.19733-3-sean.wang@kernel.org \
    --to=sean.wang@kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=nbd@nbd.name \
    --cc=sean.wang@mediatek.com \
    --cc=xiong.huang@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox