diff mbox series

[10/10] wifi: mt76: mt7996: add sanity check for NAPI schedule

Message ID 20240320110918.3488-10-shayne.chen@mediatek.com (mailing list archive)
State Superseded
Delegated to: Felix Fietkau
Headers show
Series [01/10] wifi: mt76: connac: use peer address for station BMC entry | expand

Commit Message

Shayne Chen March 20, 2024, 11:09 a.m. UTC
From: Henry Yen <henry.yen@mediatek.com>

It's observed that host driver might occasionally receive
interrupts from unexpected Rx ring, whose Rx NAPI hasn't been
prepared yet. Under such situation, __napi_poll crash issue
would occur, so we add a sanity check to prevent it.

Without this patch, we might encounter kernel crash issue
especially in WED-on & RRO-on software path.

Signed-off-by: Henry Yen <henry.yen@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
---
 drivers/net/wireless/mediatek/mt76/mt7996/mmio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Felix Fietkau April 3, 2024, 10:57 a.m. UTC | #1
On 20.03.24 12:09, Shayne Chen wrote:
> From: Henry Yen <henry.yen@mediatek.com>
> 
> It's observed that host driver might occasionally receive
> interrupts from unexpected Rx ring, whose Rx NAPI hasn't been
> prepared yet. Under such situation, __napi_poll crash issue
> would occur, so we add a sanity check to prevent it.
> 
> Without this patch, we might encounter kernel crash issue
> especially in WED-on & RRO-on software path.

Does this issue occur even with Lorenzo's fix "wifi: mt76: mt7996: fix 
uninitialized variable in mt7996_irq_tasklet()"?

- Felix
Shayne Chen April 8, 2024, 5:57 a.m. UTC | #2
On Wed, 2024-04-03 at 12:57 +0200, Felix Fietkau wrote:
>  	 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>  On 20.03.24 12:09, Shayne Chen wrote:
> > From: Henry Yen <henry.yen@mediatek.com>
> > 
> > It's observed that host driver might occasionally receive
> > interrupts from unexpected Rx ring, whose Rx NAPI hasn't been
> > prepared yet. Under such situation, __napi_poll crash issue
> > would occur, so we add a sanity check to prevent it.
> > 
> > Without this patch, we might encounter kernel crash issue
> > especially in WED-on & RRO-on software path.
> 
> Does this issue occur even with Lorenzo's fix "wifi: mt76: mt7996:
> fix 
> uninitialized variable in mt7996_irq_tasklet()"?
> 
They achieve the same purpose, please drop this patch.

Thanks,
Shayne
> - Felix
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mmio.c b/drivers/net/wireless/mediatek/mt76/mt7996/mmio.c
index 304e5fd14803..6de5b7de4ac8 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mmio.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mmio.c
@@ -560,7 +560,7 @@  static void mt7996_irq_tasklet(struct tasklet_struct *t)
 		napi_schedule(&dev->mt76.tx_napi);
 
 	for (i = 0; i < __MT_RXQ_MAX; i++) {
-		if ((intr & MT_INT_RX(i)))
+		if ((intr & MT_INT_RX(i)) && dev->mt76.napi[i].poll)
 			napi_schedule(&dev->mt76.napi[i]);
 	}