Skip to contentSkip to conversation

mt76: mt7915: add missing bh-disable around tx napi enable/schedule

PATCH New Felix Fietkau 1 participant 2 messages Jun 2, 2022

Subsystems (2)
lore
Share & tools
lore

Felix Fietkau

author maintainer
#0 lore raw

PATCH 1/2 mt76: mt7915: add missing bh-disable around tx napi enable/schedule

napi_schedule() can call __raise_softirq_irqoff(), which can perform softirq handling, so it must not be called in a pure process context with BH enabled.

---
 drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/wireless/mediatek/mt76/mt7915/mac.c +2 -0
index 27b3080469a1..00d670fa26c9 100644
@@ -2183,8 +2183,10 @@ void mt7915_mac_reset_work(struct work_struct *work)
 
 	mt76_worker_enable(&dev->mt76.tx_worker);
 
+	local_bh_disable();
 	napi_enable(&dev->mt76.tx_napi);
 	napi_schedule(&dev->mt76.tx_napi);
+	local_bh_enable();
 
 	ieee80211_wake_queues(mt76_hw(dev));
 	if (ext_phy)
Signature · 1 line
2.36.1
author maintainer
#1 lore raw

PATCH 2/2 mt76: mt7615: add missing bh-disable around rx napi schedule

napi_schedule() can call __raise_softirq_irqoff(), which can perform softirq handling, so it must not be called in a pure process context with BH enabled.

---
 drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/wireless/mediatek/mt76/mt7615/mac.c +2 -0
index bd687f7de628..f26213c4e64c 100644
@@ -2094,8 +2094,10 @@ void mt7615_pm_wake_work(struct work_struct *work)
 			mt76_connac_pm_dequeue_skbs(mphy, &dev->pm);
 			mt76_worker_schedule(&mdev->sdio.txrx_worker);
 		} else {
+			local_bh_disable();
 			mt76_for_each_q_rx(mdev, i)
 				napi_schedule(&mdev->napi[i]);
+			local_bh_enable();
 			mt76_connac_pm_dequeue_skbs(mphy, &dev->pm);
 			mt76_queue_tx_cleanup(dev, mdev->q_mcu[MT_MCUQ_WM],
 					      false);
Signature · 1 line
2.36.1