Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Eason Lai <eason.lai@mediatek.com>
To: <nbd@nbd.name>, <lorenzo@kernel.org>
Cc: <linux-wireless@vger.kernel.org>,
	<linux-mediatek@lists.infradead.org>, <kun.wu@mediatek.com>,
	<deren.wu@mediatek.com>, <sean.wang@mediatek.com>,
	<quan.zhou@mediatek.com>, <ryder.lee@mediatek.com>,
	<leon.yen@mediatek.com>, <litien.chang@mediatek.com>,
	<jb.tsai@mediatek.com>, <ck.chang@mediatek.com>,
	<eason.lai@mediatek.com>
Subject: [PATCH v1] wifi: mt76: mt7925: Fix reset panic by removing MT7925 irq mask config on tx done
Date: Wed, 5 Aug 2026 17:24:09 +0800	[thread overview]
Message-ID: <20260805092409.1489401-1-eason.lai@mediatek.com> (raw)

From: "ck.chang" <ck.chang@mediatek.com>

Fix a bug that cause kernel panic when trigger reset.
When reset, reference irq mask and disable napi, but 7925 do not enable tx done napi since dma layout config, cause dereference null pointer in napi_disable function

[  133.383988] BUG: kernel NULL pointer dereference, address: 0000000000000a40
[  133.383993] #PF: supervisor write access in kernel mode
[  133.383994] #PF: error_code(0x0002) - not-present page
[  133.383996] PGD 0 P4D 0
[  133.383998] Oops: Oops: 0002 [#1] SMP NOPTI
[  133.384001] CPU: 2 UID: 0 PID: 457 Comm: kworker/u48:5 Tainted: G S         OE       6.17.0-061700-generic #202509282239 PREEMPT(voluntary)
[  133.384003] Tainted: [S]=CPU_OUT_OF_SPEC, [O]=OOT_MODULE, [E]=UNSIGNED_MODULE
[  133.384004] Hardware name: HP HP EliteBook 840 14 inch G10 Notebook PC/8B41, BIOS V70 Ver. 01.03.00 10/26/2023
[  133.384005] Workqueue: mt76 mt7925_mac_reset_work [mt7925_common]
[  133.384014] RIP: 0010:mutex_lock+0x1c/0x50
[  133.384017] Code: 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 55 48 89 e5 53 48 89 fb e8 9e d1 ff ff 65 48 8b 15 ae 4d 9e 01 31 c0 <f0> 48 0f b1 13 75 10 48 8b 5d f8 c9 31 c0 31 d2 31 ff c3 cc cc cc
[  133.384018] RSP: 0018:ffffcf68009c3d60 EFLAGS: 00010246
[  133.384020] RAX: 0000000000000000 RBX: 0000000000000a40 RCX: 0000000000000000
[  133.384021] RDX: ffff8b25d250aa00 RSI: 0000000000000000 RDI: 0000000000000000
[  133.384022] RBP: ffffcf68009c3d68 R08: 0000000000000000 R09: 0000000000000000
[  133.384023] R10: 0000000000000000 R11: 0000000000000000 R12: ffffffffc1de2880
[  133.384024] R13: ffff8b25ca0b2040 R14: ffff8b25ca0b2900 R15: 0000000000000000
[  133.384025] FS:  0000000000000000(0000) GS:ffff8b2da5b80000(0000) knlGS:0000000000000000
[  133.384026] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  133.384027] CR2: 0000000000000a40 CR3: 0000000158438002 CR4: 0000000000f72ef0
[  133.384028] PKRU: 55555554
[  133.384029] Call Trace:
[  133.384030]  <TASK>
[  133.384033]  napi_disable+0x1d/0x50
[  133.384037]  mt7925e_mac_reset+0x327/0x420 [mt7925e]
[  133.384039]  mt7925_mac_reset_work+0x9a/0x1a0 [mt7925_common]
[  133.384042]  process_one_work+0x18a/0x370
[  133.384045]  worker_thread+0x33a/0x480
[  133.384048]  ? __pfx_worker_thread+0x10/0x10
[  133.384050]  kthread+0x108/0x220
[  133.384052]  ? __pfx_kthread+0x10/0x10
[  133.384053]  ret_from_fork+0x121/0x140
[  133.384055]  ? __pfx_kthread+0x10/0x10
[  133.384057]  ret_from_fork_asm+0x1a/0x30
[  133.384060]  </TASK>

Fixes: 5c2da0751454 ("wifi: mt76: mt7925: replace shared rx irq masks with per-chip definitions")
Signed-off-by: ck.chang <ck.chang@mediatek.com>
---
 drivers/net/wireless/mediatek/mt76/mt7925/pci.c  | 1 -
 drivers/net/wireless/mediatek/mt76/mt7925/regs.h | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/pci.c b/drivers/net/wireless/mediatek/mt76/mt7925/pci.c
index 02ef09dd797d..d2c0a78ae9f2 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/pci.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/pci.c
@@ -493,7 +493,6 @@ static const struct mt792x_irq_map mt7925_irq_map = {
 		.all_complete_mask = MT7925_INT_RX_DONE_ALL,
 		.data_complete_mask = MT7925_INT_RX_DONE_DATA,
 		.wm_complete_mask = MT7925_INT_RX_DONE_WM,
-		.wm2_complete_mask = MT_INT_RX_DONE_WM2,
 	},
 };
 
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/regs.h b/drivers/net/wireless/mediatek/mt76/mt7925/regs.h
index ab6c33b4a180..e040dff321dd 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/regs.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/regs.h
@@ -48,8 +48,7 @@
 #define MT7925_INT_RX_DONE_DATA		HOST_RX_DONE_INT_ENA2
 #define MT7925_INT_RX_DONE_WM		HOST_RX_DONE_INT_ENA0
 #define MT7925_INT_RX_DONE_ALL		(MT7925_INT_RX_DONE_DATA | \
-					 MT7925_INT_RX_DONE_WM | \
-					 MT_INT_RX_DONE_WM2)
+					 MT7925_INT_RX_DONE_WM)
 
 #define MT7927_INT_RX_DONE_DATA		MT7927_RX_DONE_INT_ENA4
 #define MT7927_INT_RX_DONE_WM		MT7927_RX_DONE_INT_ENA6
-- 
2.45.2



                 reply	other threads:[~2026-08-05  9:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20260805092409.1489401-1-eason.lai@mediatek.com \
    --to=eason.lai@mediatek.com \
    --cc=ck.chang@mediatek.com \
    --cc=deren.wu@mediatek.com \
    --cc=jb.tsai@mediatek.com \
    --cc=kun.wu@mediatek.com \
    --cc=leon.yen@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=litien.chang@mediatek.com \
    --cc=lorenzo@kernel.org \
    --cc=nbd@nbd.name \
    --cc=quan.zhou@mediatek.com \
    --cc=ryder.lee@mediatek.com \
    --cc=sean.wang@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